CEGUI.h | CEGUI.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUI_h_ | #ifndef _CEGUI_h_ | |||
#define _CEGUI_h_ | #define _CEGUI_h_ | |||
// base stuff | // base stuff | |||
#include "CEGUIBase.h" | #include "CEGUIBasicRenderedStringParser.h" | |||
#include "CEGUIString.h" | #include "CEGUIBiDiVisualMapping.h" | |||
#include "CEGUIRect.h" | #include "CEGUICentredRenderedString.h" | |||
#include "CEGUIcolour.h" | ||||
#include "CEGUIColourRect.h" | ||||
#include "CEGUICoordConverter.h" | ||||
#include "CEGUIDataContainer.h" | ||||
#include "CEGUIDefaultLogger.h" | ||||
#include "CEGUIDefaultRenderedStringParser.h" | ||||
#include "CEGUIDefaultResourceProvider.h" | ||||
#include "CEGUIDynamicModule.h" | ||||
#include "CEGUIExceptions.h" | #include "CEGUIExceptions.h" | |||
#include "CEGUITexture.h" | #include "CEGUIFactoryModule.h" | |||
#include "CEGUIRenderer.h" | ||||
#include "CEGUIImageset.h" | ||||
#include "CEGUIImagesetManager.h" | ||||
#include "CEGUILogger.h" | ||||
#include "CEGUIMouseCursor.h" | ||||
#include "CEGUIFont.h" | ||||
#include "CEGUIFontManager.h" | #include "CEGUIFontManager.h" | |||
#include "CEGUIEventArgs.h" | #include "CEGUIGeometryBuffer.h" | |||
#include "CEGUIEvent.h" | ||||
#include "CEGUIEventSet.h" | ||||
#include "CEGUIGlobalEventSet.h" | #include "CEGUIGlobalEventSet.h" | |||
#include "CEGUIProperty.h" | #include "CEGUIImageCodec.h" | |||
#include "CEGUIImagesetManager.h" | ||||
#include "CEGUIInputEvent.h" | ||||
#include "CEGUIJustifiedRenderedString.h" | ||||
#include "CEGUILeftAlignedRenderedString.h" | ||||
#include "CEGUIMouseCursor.h" | ||||
#include "CEGUIPropertyHelper.h" | ||||
#include "CEGUIPropertySet.h" | #include "CEGUIPropertySet.h" | |||
#include "CEGUIWindow.h" | #include "CEGUIRect.h" | |||
#include "CEGUIRegexMatcher.h" | ||||
#include "CEGUIRenderedString.h" | ||||
#include "CEGUIRenderedStringImageComponent.h" | ||||
#include "CEGUIRenderedStringParser.h" | ||||
#include "CEGUIRenderedStringTextComponent.h" | ||||
#include "CEGUIRenderedStringWidgetComponent.h" | ||||
#include "CEGUIRenderedStringWordWrapper.h" | ||||
#include "CEGUIRenderEffect.h" | ||||
#include "CEGUIRenderer.h" | ||||
#include "CEGUIRenderingContext.h" | ||||
#include "CEGUIRenderingRoot.h" | ||||
#include "CEGUIRenderingSurface.h" | ||||
#include "CEGUIRenderingWindow.h" | ||||
#include "CEGUIRenderQueue.h" | ||||
#include "CEGUIRenderTarget.h" | ||||
#include "CEGUIRightAlignedRenderedString.h" | ||||
#include "CEGUISchemeManager.h" | ||||
#include "CEGUIScriptModule.h" | ||||
#include "CEGUISize.h" | ||||
#include "CEGUISystem.h" | ||||
#include "CEGUITexture.h" | ||||
#include "CEGUITextureTarget.h" | ||||
#include "CEGUITextUtils.h" | ||||
#include "CEGUITplWindowFactory.h" | ||||
#include "CEGUITplWindowRendererFactory.h" | ||||
#include "CEGUITplWRFactoryRegisterer.h" | ||||
#include "CEGUIVector.h" | ||||
#include "CEGUIVersion.h" | ||||
#include "CEGUIVertex.h" | ||||
#include "CEGUIWidgetModule.h" | ||||
#include "CEGUIWindowFactory.h" | #include "CEGUIWindowFactory.h" | |||
#include "CEGUIWindowFactoryManager.h" | #include "CEGUIWindowFactoryManager.h" | |||
#include "CEGUIWindow.h" | ||||
#include "CEGUIWindowManager.h" | #include "CEGUIWindowManager.h" | |||
#include "CEGUIWindowRenderer.h" | ||||
#include "CEGUIWindowRendererManager.h" | #include "CEGUIWindowRendererManager.h" | |||
#include "CEGUIScheme.h" | #include "CEGUIWindowRendererModule.h" | |||
#include "CEGUISchemeManager.h" | #include "CEGUIWRFactoryRegisterer.h" | |||
#include "CEGUIScriptWindowHelper.h" | #include "CEGUIXMLAttributes.h" | |||
#include "CEGUISystem.h" | #include "CEGUIXMLHandler.h" | |||
#include "CEGUIScriptModule.h" | #include "CEGUIXMLParser.h" | |||
#include "CEGUICoordConverter.h" | #include "CEGUIXMLSerializer.h" | |||
#include "CEGUIPropertyHelper.h" | ||||
// Falagard core system include | // Falagard core system include | |||
#include "falagard/CEGUIFalWidgetLookManager.h" | #include "falagard/CEGUIFalWidgetLookManager.h" | |||
// gui elements | // gui elements | |||
#include "elements/CEGUIButtonBase.h" | #include "elements/CEGUIAll.h" | |||
#include "elements/CEGUIPushButton.h" | ||||
#include "elements/CEGUICheckbox.h" | ||||
#include "elements/CEGUIRadioButton.h" | ||||
#include "elements/CEGUITitlebar.h" | ||||
#include "elements/CEGUIFrameWindow.h" | ||||
#include "elements/CEGUIProgressBar.h" | ||||
#include "elements/CEGUIEditbox.h" | ||||
#include "elements/CEGUIThumb.h" | ||||
#include "elements/CEGUISlider.h" | ||||
#include "elements/CEGUIScrollbar.h" | ||||
#include "elements/CEGUIListbox.h" | ||||
#include "elements/CEGUICombobox.h" | ||||
#include "elements/CEGUIListHeader.h" | ||||
#include "elements/CEGUIMultiColumnList.h" | ||||
#include "elements/CEGUIGUISheet.h" | ||||
#include "elements/CEGUIListboxTextItem.h" | ||||
#include "elements/CEGUIComboDropList.h" | ||||
#include "elements/CEGUIMultiLineEditbox.h" | ||||
#include "elements/CEGUITabButton.h" | ||||
#include "elements/CEGUITabControl.h" | ||||
#include "elements/CEGUISpinner.h" | ||||
#include "elements/CEGUIDragContainer.h" | ||||
#include "elements/CEGUIScrolledContainer.h" | ||||
#include "elements/CEGUIScrollablePane.h" | ||||
#include "elements/CEGUITooltip.h" | ||||
#include "elements/CEGUIItemEntry.h" | ||||
#include "elements/CEGUIMenuItem.h" | ||||
#include "elements/CEGUIItemListBase.h" | ||||
#include "elements/CEGUIMenuBase.h" | ||||
#include "elements/CEGUIMenubar.h" | ||||
#include "elements/CEGUIPopupMenu.h" | ||||
#include "elements/CEGUIScrolledItemListBase.h" | ||||
#include "elements/CEGUIItemListbox.h" | ||||
#include "elements/CEGUITree.h" | ||||
#include "elements/CEGUITreeItem.h" | ||||
#include "elements/CEGUIGroupBox.h" | ||||
#endif // end of guard _CEGUI_h_ | #endif // end of guard _CEGUI_h_ | |||
End of changes. 9 change blocks. | ||||
60 lines changed or deleted | 59 lines changed or added | |||
CEGUIBoundSlot.h | CEGUIBoundSlot.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIBoundSlot_h_ | #ifndef _CEGUIBoundSlot_h_ | |||
#define _CEGUIBoundSlot_h_ | #define _CEGUIBoundSlot_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUISubscriberSlot.h" | #include "CEGUISubscriberSlot.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// forward references | ||||
class Event; | ||||
/*! | /*! | |||
\brief | \brief | |||
Class that tracks a SubscriberSlot, its group, and the Event to which i t was | Class that tracks a SubscriberSlot, its group, and the Event to which i t was | |||
subscribed. This is effectively what gets returned from the calls to t he | subscribed. This is effectively what gets returned from the calls to t he | |||
Event::subscribe members, though BoundSlot is always wrapped in a | Event::subscribe members, though BoundSlot is always wrapped in a | |||
reference counted pointer. When a BoundSlot is deleted, the connection is | reference counted pointer. When a BoundSlot is deleted, the connection is | |||
unsubscribed and the SubscriberSlot is deleted. | unsubscribed and the SubscriberSlot is deleted. | |||
*/ | */ | |||
class CEGUIEXPORT BoundSlot | class CEGUIEXPORT BoundSlot | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 0 lines changed or added | |||
CEGUIButtonBase.h | CEGUIButtonBase.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIButtonBase_h_ | #ifndef _CEGUIButtonBase_h_ | |||
#define _CEGUIButtonBase_h_ | #define _CEGUIButtonBase_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUICheckbox.h | CEGUICheckbox.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUICheckbox_h_ | #ifndef _CEGUICheckbox_h_ | |||
#define _CEGUICheckbox_h_ | #define _CEGUICheckbox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "elements/CEGUIButtonBase.h" | #include "CEGUIButtonBase.h" | |||
#include "elements/CEGUICheckboxProperties.h" | #include "CEGUICheckboxProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUICheckboxProperties.h | CEGUICheckboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUICheckboxProperties_h_ | #ifndef _CEGUICheckboxProperties_h_ | |||
#define _CEGUICheckboxProperties_h_ | #define _CEGUICheckboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of CheckboxProperties namespace section | // Start of CheckboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Checkbox class | Namespace containing all classes that make up the properties interfa ce for the Checkbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIClippedContainer.h | CEGUIClippedContainer.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIClippedContainer_h_ | #ifndef _CEGUIClippedContainer_h_ | |||
#define _CEGUIClippedContainer_h_ | #define _CEGUIClippedContainer_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIWindowFactory.h" | #include "../CEGUIWindowFactory.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Helper container window that has configurable clipping. | Helper container window that has configurable clipping. | |||
Used by the ItemListbox widget. | Used by the ItemListbox widget. | |||
\deprecated | ||||
This class is deprecated and is scheduled for removal. The function th | ||||
is | ||||
class used to provide was broken when the inner-rect (aka client area) | ||||
support got fixed. The good news is that fixing inner-rect support | ||||
effectively negated the need for this class anyway - clipping areas can | ||||
now be established in the looknfeel and extracted via the WindowRendere | ||||
r. | ||||
*/ | */ | |||
class CEGUIEXPORT ClippedContainer : public Window | class CEGUIEXPORT ClippedContainer : public Window | |||
{ | { | |||
public: | public: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Constants | Constants | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
static const String WidgetTypeName; //!< Type name for ClippedConta iner. | static const String WidgetTypeName; //!< Type name for ClippedConta iner. | |||
static const String EventNamespace; //!< Namespace for global event s | static const String EventNamespace; //!< Namespace for global event s | |||
skipping to change at line 126 | skipping to change at line 133 | |||
*/ | */ | |||
virtual bool testClassName_impl(const String& class_name) const | virtual bool testClassName_impl(const String& class_name) const | |||
{ | { | |||
if (class_name=="ClippedContainer") return true; | if (class_name=="ClippedContainer") return true; | |||
return Window::testClassName_impl(class_name); | return Window::testClassName_impl(class_name); | |||
} | } | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Overridden from Window. | Overridden from Window. | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
virtual void drawSelf(float) {} | virtual void drawSelf(const RenderingContext&) {} | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Data fields | Data fields | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
//! the pixel rect to be used for clipping relative to either a window or the screen. | //! the pixel rect to be used for clipping relative to either a window or the screen. | |||
Rect d_clipArea; | Rect d_clipArea; | |||
//! the base window which the clipping rect is relative to. | //! the base window which the clipping rect is relative to. | |||
Window* d_clipperWindow; | Window* d_clipperWindow; | |||
}; | }; | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 12 lines changed or added | |||
CEGUIComboDropList.h | CEGUIComboDropList.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIComboDropList_h_ | #ifndef _CEGUIComboDropList_h_ | |||
#define _CEGUIComboDropList_h_ | #define _CEGUIComboDropList_h_ | |||
#include "elements/CEGUIListbox.h" | #include "CEGUIListbox.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUICombobox.h | CEGUICombobox.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUICombobox_h_ | #ifndef _CEGUICombobox_h_ | |||
#define _CEGUICombobox_h_ | #define _CEGUICombobox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIComboboxProperties.h" | #include "CEGUIComboboxProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
skipping to change at line 89 | skipping to change at line 89 | |||
static const String EventDropListRemoved; //!< Event triggered when the drop-down list is removed / hidden. | static const String EventDropListRemoved; //!< Event triggered when the drop-down list is removed / hidden. | |||
static const String EventListSelectionAccepted; //!< Event t riggered when the user accepts a selection from the drop-down list | static const String EventListSelectionAccepted; //!< Event t riggered when the user accepts a selection from the drop-down list | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Child Widget name suffix constants | Child Widget name suffix constants | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
static const String EditboxNameSuffix; //!< Widget name suffix for the editbox component. | static const String EditboxNameSuffix; //!< Widget name suffix for the editbox component. | |||
static const String DropListNameSuffix; //!< Widget name suffix for t he drop list component. | static const String DropListNameSuffix; //!< Widget name suffix for t he drop list component. | |||
static const String ButtonNameSuffix; //!< Widget name suffix for the button component. | static const String ButtonNameSuffix; //!< Widget name suffix for the button component. | |||
/*! | // override from Window class | |||
\brief | bool isHit(const Vector2& position, | |||
check if the given position would hit this window. | const bool allow_disabled = false) const; | |||
\param position | ||||
Point object describing the position to check in screen pixe | ||||
ls | ||||
\return | ||||
true if \a position 'hits' this Window, else false. | ||||
*/ | ||||
virtual bool isHit(const Point& position) const {ret | ||||
urn false;} | ||||
/*! | /*! | |||
\brief | \brief | |||
returns the mode of operation for the combo box. | returns the mode of operation for the combo box. | |||
\return | \return | |||
- true if the user can show the list and select an item with a single mouse click. | - true if the user can show the list and select an item with a single mouse click. | |||
- false if the user must click to show the list and then cli ck again to select an item. | - false if the user must click to show the list and then cli ck again to select an item. | |||
*/ | */ | |||
bool getSingleClickEnabled(void) const; | bool getSingleClickEnabled(void) const; | |||
skipping to change at line 733 | skipping to change at line 725 | |||
\return | \return | |||
true if this window was inherited from \a class_name. false if not. | true if this window was inherited from \a class_name. false if not. | |||
*/ | */ | |||
virtual bool testClassName_impl(const String& class_name) const | virtual bool testClassName_impl(const String& class_name) const | |||
{ | { | |||
if (class_name=="Combobox") return true; | if (class_name=="Combobox") return true; | |||
return Window::testClassName_impl(class_name); | return Window::testClassName_impl(class_name); | |||
} | } | |||
/*! | ||||
\brief | ||||
Update the Combobox text to reflect programmatically made changes t | ||||
o | ||||
selected list item. | ||||
*/ | ||||
void itemSelectChangeTextUpdate(const ListboxItem* const item, | ||||
bool new_state, bool old_state); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Handlers to relay child widget events so they appear to come from us | Handlers to relay child widget events so they appear to come from us | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
bool editbox_ReadOnlyChangedHandler(const EventArgs& e); | bool editbox_ReadOnlyChangedHandler(const EventArgs& e); | |||
bool editbox_ValidationStringChangedHandler(const EventArgs& e); | bool editbox_ValidationStringChangedHandler(const EventArgs& e); | |||
bool editbox_MaximumTextLengthChangedHandler(const EventArgs& e); | bool editbox_MaximumTextLengthChangedHandler(const EventArgs& e); | |||
bool editbox_TextInvalidatedEventHandler(const EventArgs& e); | bool editbox_TextInvalidatedEventHandler(const EventArgs& e); | |||
bool editbox_InvalidEntryAttemptedHandler(const EventArgs& e); | bool editbox_InvalidEntryAttemptedHandler(const EventArgs& e); | |||
bool editbox_CaratMovedHandler(const EventArgs& e); | bool editbox_CaratMovedHandler(const EventArgs& e); | |||
bool editbox_TextSelectionChangedHandler(const EventArgs& e); | bool editbox_TextSelectionChangedHandler(const EventArgs& e); | |||
End of changes. 3 change blocks. | ||||
16 lines changed or deleted | 15 lines changed or added | |||
CEGUIComboboxProperties.h | CEGUIComboboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIComboboxProperties_h_ | #ifndef _CEGUIComboboxProperties_h_ | |||
#define _CEGUIComboboxProperties_h_ | #define _CEGUIComboboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ComboboxProperties namespace section | // Start of ComboboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Combobox class | Namespace containing all classes that make up the properties interfa ce for the Combobox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIConfig.h | CEGUIConfig.h | |||
---|---|---|---|---|
skipping to change at line 86 | skipping to change at line 86 | |||
#ifndef CEGUI_TINYXML_H | #ifndef CEGUI_TINYXML_H | |||
# define CEGUI_TINYXML_H "ceguitinyxml/tinyxml.h" | # define CEGUI_TINYXML_H "ceguitinyxml/tinyxml.h" | |||
#endif | #endif | |||
// Namespace that contains TinyXML. | // Namespace that contains TinyXML. | |||
#ifndef CEGUI_TINYXML_NAMESPACE | #ifndef CEGUI_TINYXML_NAMESPACE | |||
# define CEGUI_TINYXML_NAMESPACE CEGUITinyXML | # define CEGUI_TINYXML_NAMESPACE CEGUITinyXML | |||
#endif | #endif | |||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | |||
// The following controls the version of Lua that is going to be used. | // The following controls the version of Lua that is going to be used. | |||
// 50 is for Lua 5.0.x versions | // Note that from 0.7.0 and up, Lua 5.0 is no longer supported. | |||
// 51 is for Lua 5.1.x versions (and above?) | // 51 is for Lua 5.1.x versions (and above?) | |||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | |||
#ifndef CEGUI_LUA_VER | #ifndef CEGUI_LUA_VER | |||
# define CEGUI_LUA_VER 51 | # define CEGUI_LUA_VER 51 | |||
#endif | #endif | |||
////////////////////////////////////////////////////////////////////////// | ||||
// The following controls whether freetype based font support will be | ||||
// compiled in (default). If you want to build CEGUI /without/ freetype | ||||
// support, comment the following line. | ||||
////////////////////////////////////////////////////////////////////////// | ||||
#define CEGUI_HAS_FREETYPE | ||||
////////////////////////////////////////////////////////////////////////// | ||||
// PCRE library | ||||
// CEGUI uses the pcre library for it's regular expression based string | ||||
// validation as used in the Editbox (and derived classes, such as Spinner) | ||||
. | ||||
// To disable the use of PCRE (and therefore the validation factilities), | ||||
// comment the following line. (Attempts to set validation string will thr | ||||
ow). | ||||
////////////////////////////////////////////////////////////////////////// | ||||
#define CEGUI_HAS_PCRE_REGEX | ||||
////////////////////////////////////////////////////////////////////////// | ||||
// The following controls whether the default logger be (possibly) used. | ||||
// If you want to build CEGUI so that it does not use the default logger, | ||||
// comment the following line. | ||||
// | ||||
// Note: If you disable the default logger you MUST provide an alternative | ||||
// CEGUI::Logger based class and instantiate it before creating the main | ||||
// CEGUI::System object. | ||||
////////////////////////////////////////////////////////////////////////// | ||||
#define CEGUI_HAS_DEFAULT_LOGGER | ||||
////////////////////////////////////////////////////////////////////////// | ||||
// The following defines control bidirectional text support. | ||||
// | ||||
// Uncomment the CEGUI_BIDI_SUPPORT definition to enable bidirectional | ||||
// text in CEGUI. | ||||
// | ||||
// With bidirectional text support enabled, you must then choose to uncomme | ||||
nt | ||||
// either the CEGUI_USE_MINIBIDI or CEGUI_USE_FRIBIDI definitions (but you | ||||
// should not uncomment both!) | ||||
// | ||||
// Uncommenting CEGUI_USE_MINIBIDI uses an integrated copy of minibidi to | ||||
// provide the bidirectional support. | ||||
// | ||||
// Uncommenting CEGUI_USE_FRIBIDI uses an external copy of fribidi to | ||||
// provide the bidirectional support (not supplied). | ||||
////////////////////////////////////////////////////////////////////////// | ||||
//#define CEGUI_BIDI_SUPPORT | ||||
// Uncomment this to use the embedded minibidi library. | ||||
//#define CEGUI_USE_MINIBIDI | ||||
// - or - | ||||
// Uncomment this to use an external fribidi library. | ||||
//#define CEGUI_USE_FRIBIDI | ||||
#endif // defined(__APPLE__) | #endif // defined(__APPLE__) | |||
#endif // end of guard _CEGUIConfig_h_ | #endif // end of guard _CEGUIConfig_h_ | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 55 lines changed or added | |||
CEGUIConfig_xmlHandler.h | CEGUIConfig_xmlHandler.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIConfig_xmlHandler.h | filename: CEGUIConfig_xmlHandler.h | |||
created: 17/7/2004 | created: Sat Jul 25 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Interface to configuration file parser | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 37 | skipping to change at line 35 | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIConfig_xmlHandler_h_ | #ifndef _CEGUIConfig_xmlHandler_h_ | |||
#define _CEGUIConfig_xmlHandler_h_ | #define _CEGUIConfig_xmlHandler_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUILogger.h" | #include "CEGUILogger.h" | |||
#include "CEGUIXMLHandler.h" | #include "CEGUIXMLHandler.h" | |||
#include <vector> | #include <vector> | |||
#if defined (_MSC_VER) | ||||
# pragma warning(push) | ||||
# pragma warning(disable : 4251) | ||||
#endif | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | //! Handler class used to parse the Configuration XML file. | |||
\brief | ||||
Handler class used to parse the Configuration XML file. | ||||
*/ | ||||
class Config_xmlHandler : public XMLHandler | class Config_xmlHandler : public XMLHandler | |||
{ | { | |||
public: | public: | |||
/******************************************************************* | //! Name of xsd schema file used for validation. | |||
****** | static const String CEGUIConfigSchemaName; | |||
Construction & Destruction | // xml tag names | |||
******************************************************************** | static const String CEGUIConfigElement; | |||
*****/ | static const String LoggingElement; | |||
/*! | static const String AutoLoadElement; | |||
\brief | static const String ResourceDirectoryElement; | |||
Constructor for GUILayout_xmlHandler objects | static const String DefaultResourceGroupElement; | |||
*/ | static const String ScriptingElement; | |||
Config_xmlHandler(void) {} | static const String XMLParserElement; | |||
static const String ImageCodecElement; | ||||
/*! | static const String DefaultFontElement; | |||
\brief | static const String DefaultMouseCursorElement; | |||
Destructor for GUILayout_xmlHandler objects | static const String DefaultTooltipElement; | |||
*/ | static const String DefaultGUISheetElement; | |||
virtual ~Config_xmlHandler(void) {} | // xml attribute names | |||
static const String FilenameAttribute; | ||||
static const String LevelAttribute; | ||||
static const String TypeAttribute; | ||||
static const String GroupAttribute; | ||||
static const String PatternAttribute; | ||||
static const String DirectoryAttribute; | ||||
static const String InitScriptAttribute; | ||||
static const String TerminateScriptAttribute; | ||||
static const String ImagesetAttribute; | ||||
static const String ImageAttribute; | ||||
static const String NameAttribute; | ||||
/******************************************************************* | //! Constructor. | |||
****** | Config_xmlHandler(); | |||
SAX2 Handler overrides | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
document processing (only care about elements, schema valida | ||||
tes format) | ||||
*/ | ||||
virtual void elementStart(const String& element, const XMLAttributes& a | ||||
ttributes); | ||||
/******************************************************************* | //! Destructor. | |||
****** | ~Config_xmlHandler(); | |||
Functions used by our implementation | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Return log filename | ||||
*/ | ||||
const String& getLogFilename(void) const | ||||
{return d_logFilename;} | ||||
/*! | //! Initialise the CEGUI XMLParser according to info parsed from config | |||
\brief | . | |||
Return initial scheme filename to load | void initialiseXMLParser() const; | |||
*/ | //! Initialise the CEGUI ImageCodec according to info parsed from confi | |||
const String& getSchemeFilename(void) const {ret | g. | |||
urn d_schemeFilename;} | void initialiseImageCodec() const; | |||
//! Initialise the CEGUI Logger according to info parsed from config. | ||||
void initialiseLogger(const String& default_filename) const; | ||||
//! Set resource group dirs read from the config. (DefaultResourceProvi | ||||
der only). | ||||
void initialiseResourceGroupDirectories() const; | ||||
//! Set default resource groups according to those in the config. | ||||
void initialiseDefaultResourceGroups() const; | ||||
//! Auto-load all resources specified in the config. | ||||
void loadAutoResources() const; | ||||
//! initialise the system default font according to the config. | ||||
void initialiseDefaultFont() const; | ||||
//! initialise the system default mouse cursor image according to the c | ||||
onfig. | ||||
void initialiseDefaultMouseCursor() const; | ||||
//! initialise the system default tooltip according to the config. | ||||
void initialiseDefaulTooltip() const; | ||||
//! initialise the initial / default GUI Sheet according to the config. | ||||
void initialiseDefaultGUISheet() const; | ||||
//! execute the init script as specified in the config. | ||||
void executeInitScript() const; | ||||
//! return the name of the terminate script from the config (hacky!) | ||||
const String& getTerminateScriptName() const; | ||||
/*! | // XMLHandler overrides | |||
\brief | void elementStart(const String& element, const XMLAttributes& attribute | |||
Return initial layout filename to load and set as the GUI sh | s); | |||
eet. | void elementEnd(const String& element); | |||
*/ | ||||
const String& getLayoutFilename(void) const {ret | ||||
urn d_layoutFilename;} | ||||
/*! | private: | |||
\brief | //! enumeration of resource types. | |||
Return the name of the initialisation script to run | enum ResourceType | |||
*/ | { | |||
const String& getInitScriptFilename(void) const {ret | RT_IMAGESET, | |||
urn d_initScriptFilename;} | RT_FONT, | |||
RT_SCHEME, | ||||
RT_LOOKNFEEL, | ||||
RT_LAYOUT, | ||||
RT_SCRIPT, | ||||
RT_XMLSCHEMA, | ||||
RT_DEFAULT | ||||
}; | ||||
/*! | //! struct to track a resource group directory specification. | |||
\brief | struct ResourceDirectory | |||
Return the name of the termination script to run | { | |||
*/ | String group; | |||
const String& getTermScriptFilename(void) const {ret | String directory; | |||
urn d_termScriptFilename;} | }; | |||
/*! | //! struct to track a default resource group specification. | |||
\brief | struct DefaultResourceGroup | |||
Return name of font to use as default. | { | |||
*/ | ResourceType type; | |||
const String& getDefaultFontName(void) const {return d_de | String group; | |||
faultFontName;} | }; | |||
/*! | //! struct to track a set of resources to be auto-loaded. | |||
\brief | struct AutoLoadResource | |||
Return name of default resource group. | { | |||
*/ | String type_string; | |||
const String& getDefaultResourceGroup(void) const {ret | ResourceType type; | |||
urn d_defaultResourceGroup;} | String group; | |||
String pattern; | ||||
}; | ||||
/*! | // functions to handle the various elements | |||
\brief | void handleCEGUIConfigElement(const XMLAttributes& attr); | |||
Return logging level which was read from the config file. | void handleLoggingElement(const XMLAttributes& attr); | |||
*/ | void handleAutoLoadElement(const XMLAttributes& attr); | |||
LoggingLevel getLoggingLevel(void) const {return d_logLevel;} | void handleResourceDirectoryElement(const XMLAttributes& attr); | |||
void handleDefaultResourceGroupElement(const XMLAttributes& attr); | ||||
void handleScriptingElement(const XMLAttributes& attr); | ||||
void handleXMLParserElement(const XMLAttributes& attr); | ||||
void handleImageCodecElement(const XMLAttributes& attr); | ||||
void handleDefaultTooltipElement(const XMLAttributes& attr); | ||||
void handleDefaultGUISheetElement(const XMLAttributes& attr); | ||||
void handleDefaultFontElement(const XMLAttributes& attr); | ||||
void handleDefaultMouseCursorElement(const XMLAttributes& attr); | ||||
private: | //! helper to convert resource type string to something more useful. | |||
/******************************************************************* | ResourceType stringToResourceType(const String& type) const; | |||
****** | //! helper to auto-load layouts | |||
Implementation Constants | void autoLoadLayouts(const String& pattern, const String& group) const; | |||
******************************************************************** | //! helper to auto-load looknfeels | |||
*****/ | void autoLoadLookNFeels(const String& pattern, const String& group) con | |||
static const String CEGUIConfigElement; //!< | st; | |||
Tag name for CEGUIConfig elements. | ||||
static const char ConfigLogfileAttribute[]; | ||||
//!< Attribute name that stores the filename to use for the log. | ||||
static const char ConfigSchemeAttribute[]; | ||||
//!< Attribute name that stores the filename of a scheme to load. | ||||
static const char ConfigLayoutAttribute[]; | ||||
//!< Attribute name that stores the filename of a layout to load. | ||||
static const char ConfigDefaultFontAttribute[]; //!< | ||||
Attribute name that stores the name of the default font to set (as loaded | ||||
by scheme) | ||||
static const char ConfigInitScriptAttribute[]; //!< | ||||
Attribute name that stores the filename of an initialisation script to run | ||||
. | ||||
static const char ConfigTerminateScriptAttribute[]; //!< | ||||
Attribute name that stores the filename of a termination script to run. | ||||
static const char ConfigDefaultResourceGroupAttribute[]; //!< Attribu | ||||
te name that stores the default resource group (also used when loading conf | ||||
ig resources). | ||||
static const char ConfigLoggingLevelAttribute[]; //!< Attribute | ||||
name that stores the logging level to be used. | ||||
/******************************************************************* | //! type of collection holding resource group directory specifications. | |||
****** | typedef std::vector<ResourceDirectory> ResourceDirVector; | |||
Implementation Data | //! type of collection holding default resource group specifications. | |||
******************************************************************** | typedef std::vector<DefaultResourceGroup> DefaultGroupVector; | |||
*****/ | //! type of collection holding specifications of resources to auto-load | |||
String d_logFilename; //!< filename for th | . | |||
e log. | typedef std::vector<AutoLoadResource> AutoResourceVector; | |||
String d_schemeFilename; //!< filename for th | //! The name to use for the CEGUI log file. | |||
e scheme to auto-load. | String d_logFileName; | |||
String d_layoutFilename; //!< filename for th | //! The logging level to be set. | |||
e layout to auto-load. | LoggingLevel d_logLevel; | |||
String d_initScriptFilename; //!< filename for the script | //! The name of the XML parser module to initialise. | |||
to run after system init. | String d_xmlParserName; | |||
String d_termScriptFilename; //!< filename for the script | //! The name of the image codec module to initialise. | |||
to run before system shutdown. | String d_imageCodecName; | |||
String d_defaultFontName; //!< Holds name of d | //! The name of the default font to be set. | |||
efault font to set. | String d_defaultFont; | |||
String d_defaultResourceGroup; //!< Holds default resource group n | //! The name of the imageset holding the default mouse cursor image. | |||
ame. | String d_defaultMouseImageset; | |||
LoggingLevel d_logLevel; //!< Holds the logging level read f | //! The name of the default mouse cursor image to use. | |||
rom the config. | String d_defaultMouseImage; | |||
//! The name of the default tooltip window type. | ||||
String d_defaultTooltipType; | ||||
//! The name of Window to use as the default GUI layout / sheet | ||||
String d_defaultGUISheet; | ||||
//! name of the initialisation script. | ||||
String d_scriptingInitScript; | ||||
//! name of the termination script. | ||||
String d_scriptingTerminateScript; | ||||
//! Collection of resouce group directories to be set. | ||||
ResourceDirVector d_resourceDirectories; | ||||
//! Collection of default resource groups to be set. | ||||
DefaultGroupVector d_defaultResourceGroups; | ||||
//! Collection of resource specifications to be auto-loaded. | ||||
AutoResourceVector d_autoLoadResources; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIConfig_xmlHandler_h_ | #if defined (_MSC_VER) | |||
# pragma warning(pop) | ||||
#endif | ||||
#endif // end of guard _CEGUIConfig_xmlHandler_h_ | ||||
End of changes. 18 change blocks. | ||||
140 lines changed or deleted | 161 lines changed or added | |||
CEGUIDefaultResourceProvider.h | CEGUIDefaultResourceProvider.h | |||
---|---|---|---|---|
skipping to change at line 104 | skipping to change at line 104 | |||
identifier. | identifier. | |||
\param resourceGroup | \param resourceGroup | |||
The resource group identifier for which the associated directory is to | The resource group identifier for which the associated directory is to | |||
be cleared. | be cleared. | |||
*/ | */ | |||
void clearResourceGroupDirectory(const String& resourceGroup); | void clearResourceGroupDirectory(const String& resourceGroup); | |||
void loadRawDataContainer(const String& filename, RawDataContainer& out put, const String& resourceGroup); | void loadRawDataContainer(const String& filename, RawDataContainer& out put, const String& resourceGroup); | |||
void unloadRawDataContainer(RawDataContainer& data); | void unloadRawDataContainer(RawDataContainer& data); | |||
size_t getResourceGroupFileNames(std::vector<String>& out_vec, | ||||
const String& file_pattern, | ||||
const String& resource_group); | ||||
protected: | protected: | |||
/*! | /*! | |||
\brief | \brief | |||
Return the final path and filename, taking into account the given | Return the final path and filename, taking into account the given | |||
resource group identifier that should be used when attempting to | resource group identifier that should be used when attempting to | |||
load the data. | load the data. | |||
*/ | */ | |||
String getFinalFilename(const String& filename, const String& resourceG roup) const; | String getFinalFilename(const String& filename, const String& resourceG roup) const; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
CEGUIDragContainer.h | CEGUIDragContainer.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIDragContainer_h_ | #ifndef _CEGUIDragContainer_h_ | |||
#define _CEGUIDragContainer_h_ | #define _CEGUIDragContainer_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIWindowFactory.h" | #include "../CEGUIWindowFactory.h" | |||
#include "elements/CEGUIDragContainerProperties.h" | #include "CEGUIDragContainerProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
skipping to change at line 248 | skipping to change at line 248 | |||
The drop target for a DragContainer is basically the Window tha t the DragContainer | The drop target for a DragContainer is basically the Window tha t the DragContainer | |||
is within while being dragged. The drop target may be 0 to ind icate no target. | is within while being dragged. The drop target may be 0 to ind icate no target. | |||
\return | \return | |||
Pointer to a Window object that contains the DragContainer whil st being dragged, or | Pointer to a Window object that contains the DragContainer whil st being dragged, or | |||
0 to indicate no current target. | 0 to indicate no current target. | |||
*/ | */ | |||
Window* getCurrentDropTarget(void) const; | Window* getCurrentDropTarget(void) const; | |||
/*! | ||||
\brief | ||||
Return whether sticky mode is enable or disabled. | ||||
\return | ||||
- true if sticky mode is enabled. | ||||
- false if sticky mode is disabled. | ||||
*/ | ||||
bool isStickyModeEnabled() const; | ||||
/*! | ||||
\brief | ||||
Enable or disable sticky mode. | ||||
\param setting | ||||
- true to enable sticky mode. | ||||
- false to disable sticky mode. | ||||
*/ | ||||
void setStickyModeEnabled(bool setting); | ||||
// Window class overrides. | ||||
void getRenderingContext_impl(RenderingContext& ctx) const; | ||||
protected: | protected: | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Protected Implementation Methods | Protected Implementation Methods | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether the required minimum movement threshold before i nitiating dragging | Return whether the required minimum movement threshold before i nitiating dragging | |||
has been exceeded. | has been exceeded. | |||
\param local_mouse | \param local_mouse | |||
skipping to change at line 435 | skipping to change at line 458 | |||
bool d_dragging; //!< true when being dragged. | bool d_dragging; //!< true when being dragged. | |||
UVector2 d_dragPoint; //!< point we are being dragged at. | UVector2 d_dragPoint; //!< point we are being dragged at. | |||
UVector2 d_startPosition; //!< position prior to dragging. | UVector2 d_startPosition; //!< position prior to dragging. | |||
float d_dragThreshold; //!< Pixels mouse must move before drag ging commences. | float d_dragThreshold; //!< Pixels mouse must move before drag ging commences. | |||
float d_dragAlpha; //!< Alpha value to set when dragging. | float d_dragAlpha; //!< Alpha value to set when dragging. | |||
float d_storedAlpha; //!< Alpha value to re-set when draggin g ends. | float d_storedAlpha; //!< Alpha value to re-set when draggin g ends. | |||
bool d_storedClipState; //!< Parent clip state to re-set. | bool d_storedClipState; //!< Parent clip state to re-set. | |||
Window* d_dropTarget; //!< Target window for possible drop op eration. | Window* d_dropTarget; //!< Target window for possible drop op eration. | |||
const Image* d_dragCursorImage; //!< Image to use for mouse cursor when dragging. | const Image* d_dragCursorImage; //!< Image to use for mouse cursor when dragging. | |||
bool d_dropflag; //!< True when we're being dropped | bool d_dropflag; //!< True when we're being dropped | |||
//! true when we're in 'sticky' mode. | ||||
bool d_stickyMode; | ||||
//! true after been picked-up / dragged via sticky mode | ||||
bool d_pickedUp; | ||||
private: | private: | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Static properties for the Spinner widget | Static properties for the Spinner widget | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
static DragContainerProperties::DragAlpha d_dragAlphaProperty ; | static DragContainerProperties::DragAlpha d_dragAlphaProperty ; | |||
static DragContainerProperties::DragCursorImage d_dragCursorImagePr operty; | static DragContainerProperties::DragCursorImage d_dragCursorImagePr operty; | |||
static DragContainerProperties::DraggingEnabled d_dragEnabledProper ty; | static DragContainerProperties::DraggingEnabled d_dragEnabledProper ty; | |||
static DragContainerProperties::DragThreshold d_dragThresholdProp erty; | static DragContainerProperties::DragThreshold d_dragThresholdProp erty; | |||
static DragContainerProperties::StickyMode d_stickyModePropert y; | ||||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Implementation methods | Implementation methods | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
/*! | /*! | |||
\brief | \brief | |||
Adds properties specific to the DragContainer base class. | Adds properties specific to the DragContainer base class. | |||
\return | \return | |||
Nothing. | Nothing. | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 31 lines changed or added | |||
CEGUIDragContainerProperties.h | CEGUIDragContainerProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIDragContainerProperties_h_ | #ifndef _CEGUIDragContainerProperties_h_ | |||
#define _CEGUIDragContainerProperties_h_ | #define _CEGUIDragContainerProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of DragContainerProperties namespace section | // Start of DragContainerProperties namespace section | |||
namespace DragContainerProperties | namespace DragContainerProperties | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the state of the dragging enabled setting. | Property to access the state of the dragging enabled setting. | |||
skipping to change at line 139 | skipping to change at line 139 | |||
DragCursorImage() : Property( | DragCursorImage() : Property( | |||
"DragCursorImage", | "DragCursorImage", | |||
"Property to get/set the mouse cursor image used when dr agging. Value should be \"set:<imageset name> image:<image name>\".", | "Property to get/set the mouse cursor image used when dr agging. Value should be \"set:<imageset name> image:<image name>\".", | |||
"") | "") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value) ; | void set(PropertyReceiver* receiver, const String& value) ; | |||
}; | }; | |||
/*! | ||||
\brief | ||||
Property to access the state of the sticky mode setting. | ||||
\par Usage: | ||||
- Name: StickyMode | ||||
- Format: "[text]". | ||||
\par Where [Text] is: | ||||
- "True" to indicate that sticky mode is enabled. | ||||
- "False" to indicate that sticky mode is disabled. | ||||
*/ | ||||
class StickyMode : public Property | ||||
{ | ||||
public: | ||||
StickyMode() : Property( | ||||
"StickyMode", | ||||
"Property to get/set the state of the sticky mode setting for t | ||||
he " | ||||
"DragContainer. Value is either \"True\" or \"False\".", | ||||
"True") | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
} // End of DragContainerProperties namespace section | } // End of DragContainerProperties namespace section | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIDragContainerProperties_h_ | #endif // end of guard _CEGUIDragContainerProperties_h_ | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 28 lines changed or added | |||
CEGUIDynamicModule.h | CEGUIDynamicModule.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
#ifndef _CEGUIDynamicModule_h_ | #ifndef _CEGUIDynamicModule_h_ | |||
#define _CEGUIDynamicModule_h_ | #define _CEGUIDynamicModule_h_ | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
/************************************************************************* | /************************************************************************* | |||
The following is basically taken from DynLib.h, which is part of | The following is basically taken from DynLib.h, which is part of | |||
the Ogre project (http://www.ogre3d.org/) | the Ogre project (http://www.ogre3d.org/) | |||
*************************************************************************/ | *************************************************************************/ | |||
#if defined(__WIN32__) || defined(_WIN32) | #if defined(__WIN32__) || defined(_WIN32) | |||
# define DYNLIB_HANDLE hInstance | # define DYNLIB_HANDLE hInstance | |||
# define DYNLIB_LOAD( a ) LoadLibrary( a ) | # define DYNLIB_LOAD( a ) LoadLibrary( a ) | |||
# define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b ) | # define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b ) | |||
# define DYNLIB_UNLOAD( a ) !FreeLibrary( a ) | # define DYNLIB_UNLOAD( a ) !FreeLibrary( a ) | |||
struct HINSTANCE__; | struct HINSTANCE__; | |||
typedef struct HINSTANCE__* hInstance; | typedef struct HINSTANCE__* hInstance; | |||
#elif defined(__linux__) | #elif defined(__linux__) || defined(__FreeBSD__) | |||
# define DYNLIB_HANDLE void* | # define DYNLIB_HANDLE void* | |||
# define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY ) | # define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY ) | |||
# define DYNLIB_GETSYM( a, b ) dlsym( a, b ) | # define DYNLIB_GETSYM( a, b ) dlsym( a, b ) | |||
# define DYNLIB_UNLOAD( a ) dlclose( a ) | # define DYNLIB_UNLOAD( a ) dlclose( a ) | |||
# define DYNLIB_ERROR( ) dlerror( ) | # define DYNLIB_ERROR( ) dlerror( ) | |||
#elif defined(__APPLE_CC__) | #elif defined(__APPLE_CC__) | |||
# define DYNLIB_HANDLE CFBundleRef | # define DYNLIB_HANDLE CFBundleRef | |||
# define DYNLIB_LOAD( a ) mac_loadExeBundle( a ) | # define DYNLIB_LOAD( a ) mac_loadExeBundle( a ) | |||
# define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b ) | # define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b ) | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added | |||
CEGUIEditbox.h | CEGUIEditbox.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIEditbox.h | filename: CEGUIEditbox.h | |||
created: 13/4/2004 | created: 13/4/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Interface to base class for Editbox widget | purpose: Interface to base class for Editbox widget | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIEditbox_h_ | #ifndef _CEGUIEditbox_h_ | |||
#define _CEGUIEditbox_h_ | #define _CEGUIEditbox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIEditboxProperties.h" | #include "CEGUIEditboxProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// forward declare implementation data type | //! Base class for the EditboxWindowRenderer class | |||
struct RegexValidator; | ||||
/*! | ||||
\brief | ||||
Base class for the EditboxWindowRenderer class | ||||
*/ | ||||
class CEGUIEXPORT EditboxWindowRenderer : public WindowRenderer | class CEGUIEXPORT EditboxWindowRenderer : public WindowRenderer | |||
{ | { | |||
public: | public: | |||
/*! | //! Constructor | |||
\brief | ||||
Constructor | ||||
*/ | ||||
EditboxWindowRenderer(const String& name); | EditboxWindowRenderer(const String& name); | |||
/*! | /*! | |||
\brief | \brief | |||
Return the text code point index that is rendered closest to screen | Return the text code point index that is rendered closest to screen | |||
position \a pt. | position \a pt. | |||
\param pt | \param pt | |||
Point object describing a position on the screen in pixels. | Point object describing a position on the screen in pixels. | |||
\return | \return | |||
Code point index into the text that is rendered closest to screen p | Code point index into the text that is rendered closest to screen | |||
osition \a pt. | position \a pt. | |||
*/ | */ | |||
virtual size_t getTextIndexFromPosition(const Point& pt) const = 0; | virtual size_t getTextIndexFromPosition(const Point& pt) const = 0; | |||
}; | }; | |||
/*! | //------------------------------------------------------------------------- | |||
\brief | ---// | |||
Base class for an Editbox widget | ||||
*/ | //! Base class for an Editbox widget | |||
class CEGUIEXPORT Editbox : public Window | class CEGUIEXPORT Editbox : public Window | |||
{ | { | |||
public: | public: | |||
static const String EventNamespace; //!< | //! Namespace for global events | |||
Namespace for global events | static const String EventNamespace; | |||
static const String WidgetTypeName; //!< Window factory nam | //! Window factory name | |||
e | static const String WidgetTypeName; | |||
//! The read-only mode for the edit box has been changed. | ||||
/******************************************************************* | static const String EventReadOnlyModeChanged; | |||
****** | //! The masked rendering mode (password mode) has been changed. | |||
Event name constants | static const String EventMaskedRenderingModeChanged; | |||
******************************************************************** | //! The code point (character) to use for masked text has been changed. | |||
*****/ | static const String EventMaskCodePointChanged; | |||
static const String EventReadOnlyModeChanged; //!< | //! The validation string has been changed. | |||
The read-only mode for the edit box has been changed. | static const String EventValidationStringChanged; | |||
static const String EventMaskedRenderingModeChanged; //!< The mas | //! The maximum allowable string length has been changed. | |||
ked rendering mode (password mode) has been changed. | static const String EventMaximumTextLengthChanged; | |||
static const String EventMaskCodePointChanged; //!< The cod | //! The current text has become invalid as regards to the validation st | |||
e point (character) to use for masked text has been changed. | ring. | |||
static const String EventValidationStringChanged; //!< | static const String EventTextInvalidated; | |||
The validation string has been changed. | //! The user attempted to chage the text in a way that was invalid. | |||
static const String EventMaximumTextLengthChanged; //!< The max | static const String EventInvalidEntryAttempted; | |||
imum allowable string length has been changed. | //! The text carat (insert point) has changed. | |||
static const String EventTextInvalidated; | static const String EventCaratMoved; | |||
//!< Some operation has made the current text invalid with regards to t | //! The current text selection has changed. | |||
he validation string. | static const String EventTextSelectionChanged; | |||
static const String EventInvalidEntryAttempted; //!< The use | //! The number of characters in the edit box reached the current maximu | |||
r attempted to modify the text in a way that would have made it invalid. | m. | |||
static const String EventCaratMoved; | static const String EventEditboxFull; | |||
//!< The text carat (insert point) has changed. | //! The user accepted the current text by pressing Return, Enter, or Ta | |||
static const String EventTextSelectionChanged; //!< The cur | b. | |||
rent text selection has changed. | static const String EventTextAccepted; | |||
static const String EventEditboxFull; | ||||
//!< The number of characters in the edit box has reached the current m | ||||
aximum. | ||||
static const String EventTextAccepted; //!< | ||||
The user has accepted the current text by pressing Return, Enter, or Tab. | ||||
/******************************************************************* | /*! | |||
****** | \brief | |||
Accessor Functions | return true if the Editbox has input focus. | |||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
return true if the Editbox has input focus. | ||||
\return | \return | |||
true if the Editbox has keyboard input focus, false if the E | - true if the Editbox has keyboard input focus. | |||
ditbox does not have keyboard input focus. | - false if the Editbox does not have keyboard input focus. | |||
*/ | */ | |||
bool hasInputFocus(void) const; | bool hasInputFocus(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return true if the Editbox is read-only. | return true if the Editbox is read-only. | |||
\return | \return | |||
true if the Editbox is read only and can't be edited by the | true if the Editbox is read only and can't be edited by the user, f | |||
user, false if the Editbox is not | alse | |||
read only and may be edited by the user. | if the Editbox is not read only and may be edited by the user. | |||
*/ | */ | |||
bool isReadOnly(void) const {return d_readOnly;} | bool isReadOnly(void) const | |||
{return d_readOnly;} | ||||
/*! | /*! | |||
\brief | \brief | |||
return true if the text for the Editbox will be rendered mas | return true if the text for the Editbox will be rendered masked. | |||
ked. | ||||
\return | \return | |||
true if the Editbox text will be rendered masked using the c | true if the Editbox text will be rendered masked using the currentl | |||
urrently set mask code point, false if the Editbox | y set | |||
text will be rendered as plain text. | mask code point, false if the Editbox text will be rendered as ordi | |||
*/ | nary | |||
bool isTextMasked(void) const {return d_maskText;} | text. | |||
*/ | ||||
bool isTextMasked(void) const | ||||
{return d_maskText;} | ||||
/*! | /*! | |||
\brief | \brief | |||
return true if the Editbox text is valid given the currently | return true if the Editbox text is valid given the currently set | |||
set validation string. | validation string. | |||
\note | \note | |||
It is possible to programmatically set 'invalid' text for th | It is possible to programmatically set 'invalid' text for the Editb | |||
e Editbox by calling setText. This has certain | ox by | |||
implications since if invalid text is set, whatever the user | calling setText. This has certain implications since if invalid te | |||
types into the box will be rejected when the input | xt is | |||
is validated. | set, whatever the user types into the box will be rejected when the | |||
input is validated. | ||||
\note | \note | |||
Validation is performed by means of a regular expression. I | Validation is performed by means of a regular expression. If the t | |||
f the text matches the regex, the text is said to have passed | ext | |||
validation. If the text does not match with the regex then | matches the regex, the text is said to have passed validation. If | |||
the text fails validation. | the | |||
text does not match with the regex then the text fails validation. | ||||
\return | \return | |||
true if the current Editbox text passes validation, false if | - true if the current Editbox text passes validation. | |||
the text does not pass validation. | - false if the text does not pass validation. | |||
*/ | */ | |||
bool isTextValid(void) const; | bool isTextValid(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return the currently set validation string | return the currently set validation string | |||
\note | \note | |||
Validation is performed by means of a regular expression. I | Validation is performed by means of a regular expression. If the t | |||
f the text matches the regex, the text is said to have passed | ext | |||
validation. If the text does not match with the regex then | matches the regex, the text is said to have passed validation. If | |||
the text fails validation. | the | |||
text does not match with the regex then the text fails validation. | ||||
\return | \return | |||
String object containing the current validation regex data | String object containing the current validation regex data | |||
*/ | */ | |||
const String& getValidationString(void) const {return d_va | const String& getValidationString(void) const | |||
lidationString;} | {return d_validationString;} | |||
/*! | /*! | |||
\brief | \brief | |||
return the current position of the carat. | return the current position of the carat. | |||
\return | \return | |||
Index of the insert carat relative to the start of the text. | Index of the insert carat relative to the start of the text. | |||
*/ | */ | |||
size_t getCaratIndex(void) const {return d_caratPos;} | size_t getCaratIndex(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return the current selection start point. | return the current selection start point. | |||
\return | \return | |||
Index of the selection start point relative to the start of | Index of the selection start point relative to the start of the tex | |||
the text. If no selection is defined this function returns | t. | |||
the position of the carat. | If no selection is defined this function returns the position of th | |||
*/ | e | |||
size_t getSelectionStartIndex(void) const; | carat. | |||
*/ | ||||
size_t getSelectionStartIndex(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return the current selection end point. | return the current selection end point. | |||
\return | \return | |||
Index of the selection end point relative to the start of th | Index of the selection end point relative to the start of the text. | |||
e text. If no selection is defined this function returns | If | |||
the position of the carat. | no selection is defined this function returns the position of the c | |||
*/ | arat. | |||
size_t getSelectionEndIndex(void) const; | */ | |||
size_t getSelectionEndIndex(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return the length of the current selection (in code points / | return the length of the current selection (in code points / | |||
characters). | characters). | |||
\return | \return | |||
Number of code points (or characters) contained within the c | Number of code points (or characters) contained within the currentl | |||
urrently defined selection. | y | |||
*/ | defined selection. | |||
size_t getSelectionLength(void) const; | */ | |||
size_t getSelectionLength(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return the utf32 code point used when rendering masked text. | return the utf32 code point used when rendering masked text. | |||
\return | \return | |||
utf32 code point value representing the Unicode code point t | utf32 code point value representing the Unicode code point that wil | |||
hat will be rendered instead of the Editbox text | l be | |||
when rendering in masked mode. | rendered instead of the Editbox text when rendering in masked mode. | |||
*/ | */ | |||
utf32 getMaskCodePoint(void) const {return d_maskCodePo | utf32 getMaskCodePoint(void) const | |||
int;} | {return d_maskCodePoint;} | |||
/*! | /*! | |||
\brief | \brief | |||
return the maximum text length set for this Editbox. | return the maximum text length set for this Editbox. | |||
\return | \return | |||
The maximum number of code points (characters) that can be e | The maximum number of code points (characters) that can be entered | |||
ntered into this Editbox. | into | |||
this Editbox. | ||||
\note | \note | |||
Depending on the validation string set, the actual length of | Depending on the validation string set, the actual length of text t | |||
text that can be entered may be less than the value | hat | |||
returned here (it will never be more). | can be entered may be less than the value returned here | |||
*/ | (it will never be more). | |||
size_t getMaxTextLength(void) const {return d_maxTextLen | */ | |||
;} | size_t getMaxTextLength(void) const | |||
{return d_maxTextLen;} | ||||
/******************************************************************* | /*! | |||
****** | \brief | |||
Manipulators | Specify whether the Editbox is read-only. | |||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Specify whether the Editbox is read-only. | ||||
\param setting | \param setting | |||
true if the Editbox is read only and can't be edited by the | true if the Editbox is read only and can't be edited by the user, f | |||
user, false if the Editbox is not | alse | |||
read only and may be edited by the user. | if the Editbox is not read only and may be edited by the user. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setReadOnly(bool setting); | void setReadOnly(bool setting); | |||
/*! | /*! | |||
\brief | \brief | |||
Specify whether the text for the Editbox will be rendered ma | Specify whether the text for the Editbox will be rendered masked. | |||
sked. | ||||
\param setting | \param setting | |||
true if the Editbox text should be rendered masked using the | - true if the Editbox text should be rendered masked using the curr | |||
currently set mask code point, false if the Editbox | ently | |||
text should be rendered as plain text. | set mask code point. | |||
- false if the Editbox text should be rendered as ordinary text. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setTextMasked(bool setting); | void setTextMasked(bool setting); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the text validation string. | Set the text validation string. | |||
\note | \note | |||
Validation is performed by means of a regular expression. I | Validation is performed by means of a regular expression. If the t | |||
f the text matches the regex, the text is said to have passed | ext | |||
validation. If the text does not match with the regex then | matches the regex, the text is said to have passed validation. If | |||
the text fails validation. | the | |||
text does not match with the regex then the text fails validation. | ||||
\param validation_string | \param validation_string | |||
String object containing the validation regex data to be use | String object containing the validation regex data to be used. | |||
d. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setValidationString(const String& validation_string); | void setValidationString(const String& validation_string); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the current position of the carat. | Set the current position of the carat. | |||
\param carat_pos | \param carat_pos | |||
New index for the insert carat relative to the start of the | New index for the insert carat relative to the start of the text. | |||
text. If the value specified is greater than the | If | |||
number of characters in the Editbox, the carat is positioned | the value specified is greater than the number of characters in the | |||
at the end of the text. | Editbox, the carat is positioned at the end of the text. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setCaratIndex(size_t carat_pos); | void setCaratIndex(size_t carat_pos); | |||
/*! | /*! | |||
\brief | \brief | |||
Define the current selection for the Editbox | Define the current selection for the Editbox | |||
\param start_pos | \param start_pos | |||
Index of the starting point for the selection. If this valu | Index of the starting point for the selection. If this value is gr | |||
e is greater than the number of characters in the Editbox, the | eater | |||
selection start will be set to the end of the text. | than the number of characters in the Editbox, the selection start w | |||
ill | ||||
be set to the end of the text. | ||||
\param end_pos | \param end_pos | |||
Index of the ending point for the selection. If this value | Index of the ending point for the selection. If this value is grea | |||
is greater than the number of characters in the Editbox, the | ter | |||
selection end will be set to the end of the text. | than the number of characters in the Editbox, the selection end wil | |||
l be | ||||
set to the end of the text. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setSelection(size_t start_pos, size_t end_pos); | void setSelection(size_t start_pos, size_t end_pos); | |||
/*! | /*! | |||
\brief | \brief | |||
set the utf32 code point used when rendering masked text. | set the utf32 code point used when rendering masked text. | |||
\param code_point | \param code_point | |||
utf32 code point value representing the Unicode code point t | utf32 code point value representing the Unicode code point that sho | |||
hat should be rendered instead of the Editbox text | uld | |||
when rendering in masked mode. | be rendered instead of the Editbox text when rendering in masked mo | |||
de. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setMaskCodePoint(utf32 code_point); | void setMaskCodePoint(utf32 code_point); | |||
/*! | /*! | |||
\brief | \brief | |||
set the maximum text length for this Editbox. | set the maximum text length for this Editbox. | |||
\param max_len | \param max_len | |||
The maximum number of code points (characters) that can be e | The maximum number of code points (characters) that can be entered | |||
ntered into this Editbox. | into | |||
this Editbox. | ||||
\note | \note | |||
Depending on the validation string set, the actual length of | Depending on the validation string set, the actual length of text t | |||
text that can be entered may be less than the value | hat | |||
set here (it will never be more). | can be entered may be less than the value set here | |||
(it will never be more). | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setMaxTextLength(size_t max_len); | void setMaxTextLength(size_t max_len); | |||
/******************************************************************* | //! Constructor for Editbox class. | |||
****** | Editbox(const String& type, const String& name); | |||
Construction / Destruction | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Constructor for Editbox class. | ||||
*/ | ||||
Editbox(const String& type, const String& name); | ||||
/*! | //! Destructor for Editbox class. | |||
\brief | virtual ~Editbox(void); | |||
Destructor for Editbox class. | ||||
*/ | ||||
virtual ~Editbox(void); | ||||
protected: | protected: | |||
/******************************************************************* | ||||
****** | ||||
Implementation functions | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Return the text code point index that is rendered closest to | ||||
screen position \a pt. | ||||
\param pt | ||||
Point object describing a position on the screen in pixels. | ||||
\return | ||||
Code point index into the text that is rendered closest to s | ||||
creen position \a pt. | ||||
*/ | ||||
size_t getTextIndexFromPosition(const Point& pt) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the text code point index that is rendered closest to screen | Return the text code point index that is rendered closest to screen | |||
position \a pt. | position \a pt. | |||
\param pt | \param pt | |||
Point object describing a position on the screen in pixels. | Point object describing a position on the screen in pixels. | |||
\return | \return | |||
Code point index into the text that is rendered closest to screen p | Code point index into the text that is rendered closest to screen | |||
osition \a pt. | position \a pt. | |||
*/ | */ | |||
//virtual size_t getTextIndexFromPosition_impl(const Point& pt) const = 0; | size_t getTextIndexFromPosition(const Point& pt) const; | |||
/*! | //! Clear the currently defined selection (just the region, not the tex | |||
\brief | t). | |||
Clear the current selection setting | void clearSelection(void); | |||
*/ | ||||
void clearSelection(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
Erase the currently selected text. | Erase the currently selected text. | |||
\param modify_text | \param modify_text | |||
when true, the actual text will be modified. When false, ev | when true, the actual text will be modified. When false, everythin | |||
erything is done except erasing the characters. | g is | |||
*/ | done except erasing the characters. | |||
void eraseSelectedText(bool modify_text = true); | */ | |||
void eraseSelectedText(bool modify_text = true); | ||||
/*! | /*! | |||
\brief | \brief | |||
return true if the given string matches the validation regul | return true if the given string matches the validation regular | |||
ar expression. | expression. | |||
*/ | */ | |||
bool isStringValid(const String& str) const; | bool isStringValid(const String& str) const; | |||
/*! | //! Processing for backspace key | |||
\brief | void handleBackspace(void); | |||
Processing for backspace key | ||||
*/ | ||||
void handleBackspace(void); | ||||
/*! | //! Processing for Delete key | |||
\brief | void handleDelete(void); | |||
Processing for Delete key | ||||
*/ | ||||
void handleDelete(void); | ||||
/*! | //! Processing to move carat one character left | |||
\brief | void handleCharLeft(uint sysKeys); | |||
Processing to move carat one character left | ||||
*/ | ||||
void handleCharLeft(uint sysKeys); | ||||
/*! | //! Processing to move carat one word left | |||
\brief | void handleWordLeft(uint sysKeys); | |||
Processing to move carat one word left | ||||
*/ | ||||
void handleWordLeft(uint sysKeys); | ||||
/*! | //! Processing to move carat one character right | |||
\brief | void handleCharRight(uint sysKeys); | |||
Processing to move carat one character right | ||||
*/ | ||||
void handleCharRight(uint sysKeys); | ||||
/*! | //! Processing to move carat one word right | |||
\brief | void handleWordRight(uint sysKeys); | |||
Processing to move carat one word right | ||||
*/ | ||||
void handleWordRight(uint sysKeys); | ||||
/*! | //! Processing to move carat to the start of the text. | |||
\brief | void handleHome(uint sysKeys); | |||
Processing to move carat to the start of the text. | ||||
*/ | ||||
void handleHome(uint sysKeys); | ||||
/*! | //! Processing to move carat to the end of the text | |||
\brief | void handleEnd(uint sysKeys); | |||
Processing to move carat to the end of the text | ||||
*/ | ||||
void handleEnd(uint sysKeys); | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the given clas | Return whether this window was inherited from the given class name | |||
s name at some point in the inheritance hierarchy. | at | |||
some point in the inheritance hierarchy. | ||||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name. false | - true if this window was inherited from \a class_name. | |||
if not. | - false if not. | |||
*/ | */ | |||
virtual bool testClassName_impl(const String& class_name) const | virtual bool testClassName_impl(const String& class_name) const | |||
{ | { | |||
if (class_name=="Editbox") return true; | if (class_name=="Editbox") return true; | |||
return Window::testClassName_impl(class_name); | return Window::testClassName_impl(class_name); | |||
} | } | |||
// validate window renderer | //! validate window renderer | |||
virtual bool validateWindowRenderer(const String& name) const | virtual bool validateWindowRenderer(const String& name) const | |||
{ | { | |||
return (name == "Editbox"); | return (name == "Editbox"); | |||
} | } | |||
/******************************************************************* | /*! | |||
****** | \brief | |||
New event handlers | Handler called when the read only state of the Editbox has been cha | |||
******************************************************************** | nged. | |||
*****/ | */ | |||
/*! | virtual void onReadOnlyChanged(WindowEventArgs& e); | |||
\brief | ||||
Event fired internally when the read only state of the Editb | ||||
ox has been changed | ||||
*/ | ||||
virtual void onReadOnlyChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the masked rendering mode (passw | Handler called when the masked rendering mode (password mode) has b | |||
ord mode) has been changed | een | |||
*/ | changed. | |||
virtual void onMaskedRenderingModeChanged(WindowEventArgs& e); | */ | |||
virtual void onMaskedRenderingModeChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the code point to use for masked | Handler called when the code point to use for masked rendering has | |||
rendering has been changed. | been | |||
*/ | changed. | |||
virtual void onMaskCodePointChanged(WindowEventArgs& e); | */ | |||
virtual void onMaskCodePointChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the validation string is changed | Event fired internally when the validation string is changed. | |||
. | */ | |||
*/ | virtual void onValidationStringChanged(WindowEventArgs& e); | |||
virtual void onValidationStringChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the maximum text length for the | Handler called when the maximum text length for the edit box is cha | |||
edit box is changed. | nged. | |||
*/ | */ | |||
virtual void onMaximumTextLengthChanged(WindowEventArgs& e); | virtual void onMaximumTextLengthChanged(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when something has caused the current | Handler called when something has caused the current text to now fa | |||
text to now fail validation | il | |||
validation. | ||||
This can be caused by changing the validation string or sett | This can be caused by changing the validation string or setting a | |||
ing a maximum length that causes the | maximum length that causes the current text to be truncated. | |||
current text to be truncated. | */ | |||
*/ | virtual void onTextInvalidatedEvent(WindowEventArgs& e); | |||
virtual void onTextInvalidatedEvent(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the user attempted to make a cha | Handler called when the user attempted to make a change to the edit | |||
nge to the edit box that would | box | |||
have caused it to fail validation. | that would have caused it to fail validation. | |||
*/ | */ | |||
virtual void onInvalidEntryAttempted(WindowEventArgs& e); | virtual void onInvalidEntryAttempted(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the carat (insert point) positio | Handler called when the carat (insert point) position changes. | |||
n changes. | */ | |||
*/ | virtual void onCaratMoved(WindowEventArgs& e); | |||
virtual void onCaratMoved(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the current text selection chang | Handler called when the current text selection changes. | |||
es. | */ | |||
*/ | virtual void onTextSelectionChanged(WindowEventArgs& e); | |||
virtual void onTextSelectionChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the edit box text has reached th | Handler called when the edit box text has reached the set maximum | |||
e set maximum length. | length. | |||
*/ | */ | |||
virtual void onEditboxFullEvent(WindowEventArgs& e); | virtual void onEditboxFullEvent(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Event fired internally when the user accepts the edit box te | Handler called when the user accepts the edit box text by pressing | |||
xt by pressing Return, Enter, or Tab. | Return, Enter, or Tab. | |||
*/ | */ | |||
virtual void onTextAcceptedEvent(WindowEventArgs& e); | virtual void onTextAcceptedEvent(WindowEventArgs& e); | |||
/******************************************************************* | // Overridden event handlers | |||
****** | void onMouseButtonDown(MouseEventArgs& e); | |||
Overridden event handlers | void onMouseButtonUp(MouseEventArgs& e); | |||
******************************************************************** | void onMouseDoubleClicked(MouseEventArgs& e); | |||
*****/ | void onMouseTripleClicked(MouseEventArgs& e); | |||
virtual void onMouseButtonDown(MouseEventArgs& e); | void onMouseMove(MouseEventArgs& e); | |||
virtual void onMouseButtonUp(MouseEventArgs& e); | void onCaptureLost(WindowEventArgs& e); | |||
virtual void onMouseDoubleClicked(MouseEventArgs& e); | void onCharacter(KeyEventArgs& e); | |||
virtual void onMouseTripleClicked(MouseEventArgs& e); | void onKeyDown(KeyEventArgs& e); | |||
virtual void onMouseMove(MouseEventArgs& e); | void onTextChanged(WindowEventArgs& e); | |||
virtual void onCaptureLost(WindowEventArgs& e); | ||||
virtual void onCharacter(KeyEventArgs& e); | ||||
virtual void onKeyDown(KeyEventArgs& e); | ||||
virtual void onTextChanged(WindowEventArgs& e); | ||||
/******************************************************************* | //! True if the editbox is in read-only mode | |||
****** | bool d_readOnly; | |||
Implementation data | //! True if the editbox text should be rendered masked. | |||
******************************************************************** | bool d_maskText; | |||
*****/ | //! Code point to use when rendering masked text. | |||
bool d_readOnly; //!< True if the editbox is | utf32 d_maskCodePoint; | |||
in read-only mode | //! Maximum number of characters for this Editbox. | |||
bool d_maskText; //!< True if the editbox tex | size_t d_maxTextLen; | |||
t should be rendered masked. | //! Position of the carat / insert-point. | |||
utf32 d_maskCodePoint; //!< Code point to use when renderin | size_t d_caratPos; | |||
g masked text. | //! Start of selection area. | |||
size_t d_maxTextLen; //!< Maximum number of characters fo | size_t d_selectionStart; | |||
r this Editbox. | //! End of selection area. | |||
size_t d_caratPos; //!< Position of the carat / | size_t d_selectionEnd; | |||
insert-point. | //! Copy of validation reg-ex string. | |||
size_t d_selectionStart; //!< Start of selection area. | String d_validationString; | |||
size_t d_selectionEnd; //!< End of selection area. | //! Pointer to class used for validation of text. | |||
String d_validationString; //!< Copy of validation reg-ex strin | RegexMatcher* d_validator; | |||
g. | //! true when a selection is being dragged. | |||
RegexValidator* d_validator; //!< RegEx String used for v | bool d_dragging; | |||
alidation of text. | //! Selection index for drag selection anchor point. | |||
bool d_dragging; //!< true when a selection i | size_t d_dragAnchorIdx; | |||
s being dragged. | ||||
size_t d_dragAnchorIdx; //!< Selection index for drag select | ||||
ion anchor point. | ||||
private: | private: | |||
/******************************************************************* | static EditboxProperties::ReadOnly d_readOnlyProperty; | |||
****** | static EditboxProperties::MaskText d_maskTextProperty; | |||
Static Properties for this class | static EditboxProperties::MaskCodepoint d_maskCodepointProperty; | |||
******************************************************************** | static EditboxProperties::ValidationString d_validationStringProperty; | |||
*****/ | static EditboxProperties::CaratIndex d_caratIndexProperty; | |||
static EditboxProperties::ReadOnly | static EditboxProperties::SelectionStart d_selectionStartProperty; | |||
d_readOnlyProperty; | static EditboxProperties::SelectionLength d_selectionLengthProperty; | |||
static EditboxProperties::MaskText | static EditboxProperties::MaxTextLength d_maxTextLengthProperty; | |||
d_maskTextProperty; | ||||
static EditboxProperties::MaskCodepoint d_ma | ||||
skCodepointProperty; | ||||
static EditboxProperties::ValidationString d_va | ||||
lidationStringProperty; | ||||
static EditboxProperties::CaratIndex d_ca | ||||
ratIndexProperty; | ||||
static EditboxProperties::SelectionStart d_se | ||||
lectionStartProperty; | ||||
static EditboxProperties::SelectionLength d_se | ||||
lectionLengthProperty; | ||||
static EditboxProperties::MaxTextLength d_ma | ||||
xTextLengthProperty; | ||||
/******************************************************************* | void addEditboxProperties(void); | |||
****** | ||||
Private methods | ||||
******************************************************************** | ||||
*****/ | ||||
void addEditboxProperties(void); | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIEditbox_h_ | #endif // end of guard _CEGUIEditbox_h_ | |||
End of changes. 101 change blocks. | ||||
537 lines changed or deleted | 447 lines changed or added | |||
CEGUIEditboxProperties.h | CEGUIEditboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIEditboxProperties_h_ | #ifndef _CEGUIEditboxProperties_h_ | |||
#define _CEGUIEditboxProperties_h_ | #define _CEGUIEditboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of EditboxProperties namespace section | // Start of EditboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Editbox class | Namespace containing all classes that make up the properties interfa ce for the Editbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIEvent.h | CEGUIEvent.h | |||
---|---|---|---|---|
skipping to change at line 209 | skipping to change at line 209 | |||
slots attached to this Event, thus 'unsubscribing' it. | slots attached to this Event, thus 'unsubscribing' it. | |||
\note | \note | |||
This is an implementation member, and is not available to client co de. | This is an implementation member, and is not available to client co de. | |||
In order to detach / unsubscribe from an Event you should be using the | In order to detach / unsubscribe from an Event you should be using the | |||
Connection object(s) returned when you initially subscribed. | Connection object(s) returned when you initially subscribed. | |||
*/ | */ | |||
void unsubscribe(const BoundSlot& slot); | void unsubscribe(const BoundSlot& slot); | |||
// Copy constructor and assignment are not allowed for events | // Copy constructor and assignment are not allowed for events | |||
Event(const Event& other) {} | Event(const Event&) {} | |||
Event& operator=(const Event& other) {return *this;} | Event& operator=(const Event&) {return *this;} | |||
typedef std::multimap<Group, Connection> SlotContainer; | typedef std::multimap<Group, Connection> SlotContainer; | |||
SlotContainer d_slots; //!< Collection holding ref-counted bound slots | SlotContainer d_slots; //!< Collection holding ref-counted bound slots | |||
const String d_name; //!< Name of this event | const String d_name; //!< Name of this event | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIEventArgs.h | CEGUIEventArgs.h | |||
---|---|---|---|---|
skipping to change at line 57 | skipping to change at line 57 | |||
The \a handled field is used to signal whether an event was actually handled or not. While | The \a handled field is used to signal whether an event was actually handled or not. While | |||
the event system does not look at this value, code at a higher level can use it to determine | the event system does not look at this value, code at a higher level can use it to determine | |||
how far to propagate an event. | how far to propagate an event. | |||
*/ | */ | |||
class CEGUIEXPORT EventArgs | class CEGUIEXPORT EventArgs | |||
{ | { | |||
public: | public: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Construction | Construction | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
EventArgs(void) : handled(false), d_hasWindow(false) {} | EventArgs(void) : handled(0) {} | |||
virtual ~EventArgs(void) {} | virtual ~EventArgs(void) {} | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Data members | Data members | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
bool handled; //!< handlers should set this to tru | //! handlers should increment this if they handled the event. | |||
e if they handled the event, or false otherwise. | uint handled; | |||
bool d_hasWindow; //!< Indicates if this event set has a parent w | ||||
indow. | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIEventArgs_h_ | #endif // end of guard _CEGUIEventArgs_h_ | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 3 lines changed or added | |||
CEGUIEventSet.h | CEGUIEventSet.h | |||
---|---|---|---|---|
skipping to change at line 275 | skipping to change at line 275 | |||
*/ | */ | |||
Event* getEventObject(const String& name, bool autoAdd = false); | Event* getEventObject(const String& name, bool autoAdd = false); | |||
/*! | /*! | |||
\brief | \brief | |||
Implementation event firing member | Implementation event firing member | |||
*/ | */ | |||
void fireEvent_impl(const String& name, EventArgs& args); | void fireEvent_impl(const String& name, EventArgs& args); | |||
// Do not allow copying, assignment, or any other usage than simple creation. | // Do not allow copying, assignment, or any other usage than simple creation. | |||
EventSet(EventSet& e) {} | EventSet(EventSet&) {} | |||
EventSet& operator=(EventSet& e) {return *this;} | EventSet& operator=(EventSet&) {return *this;} | |||
typedef std::map<String, Event*, String::FastLessCompare> Even tMap; | typedef std::map<String, Event*, String::FastLessCompare> Even tMap; | |||
EventMap d_events; | EventMap d_events; | |||
bool d_muted; //!< true if events for this EventSet have b een muted. | bool d_muted; //!< true if events for this EventSet have b een muted. | |||
public: | public: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Iterator stuff | Iterator stuff | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIExceptions.h | CEGUIExceptions.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIExceptions.h | filename: CEGUIExceptions.h | |||
created: 20/2/2004 | created: 20/2/2004 | |||
author: Paul D Turner, Frederico Jeronimo (fjeronimo) | author: Paul D Turner, Frederico Jeronimo (fjeronimo) | |||
purpose: Defines exceptions used within the system | purpose: Defines exceptions used within the system | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2007 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
*************************************************************************** / | *************************************************************************** / | |||
#ifndef _CEGUIExceptions_h_ | #ifndef _CEGUIExceptions_h_ | |||
#define _CEGUIExceptions_h_ | #define _CEGUIExceptions_h_ | |||
////////////////////////////////////////////////////////////////////////// | ||||
// INCLUDES | ||||
////////////////////////////////////////////////////////////////////////// | ||||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include <exception> | ||||
////////////////////////////////////////////////////////////////////////// | ||||
// CEGUI NAMESPACE | ||||
////////////////////////////////////////////////////////////////////////// | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/////////////////////////////////////////////////////////////////////// | //! Root exception class used within the GUI system. | |||
/// | class CEGUIEXPORT Exception : public std::exception | |||
// EXCEPTION | { | |||
/////////////////////////////////////////////////////////////////////// | public: | |||
/// | //! Virtual destructor. | |||
virtual ~Exception(void) throw(); | ||||
/*! | /*! | |||
\brief | \brief | |||
Root exception class used within the GUI system. | Return a reference to the String object describing the reason for t | |||
*/ | he | |||
class CEGUIEXPORT Exception | exception being thrown. | |||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* DESTRUCTOR | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Virtual destructor. | ||||
*/ | ||||
virtual ~Exception(void); | ||||
/****************************************************************** | ||||
***** | ||||
* PUBLIC FUNCTIONS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Return a reference to the String object describing the reason for t | ||||
he exception being thrown. | ||||
\return | \return | |||
String object containing a message describing the reason for the ex | String object containing a message describing the reason for the | |||
ception. | exception. | |||
*/ | */ | |||
const String& getMessage(void) const {return d_message;} | const String& getMessage(void) const | |||
{ return d_message; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a reference to the String object containing the exception na | Return a reference to the String object containing the exception na | |||
me (i.e. class type). | me | |||
(i.e. class type). | ||||
\return | \return | |||
String object containing the exception name. | String object containing the exception name. | |||
*/ | */ | |||
const String& getName() const { return d_name; } | const String& getName() const | |||
{ return d_name; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a reference to the String object containing the name of the | Return a reference to the String object containing the name of the | |||
file where the exception occurred. | file | |||
where the exception occurred. | ||||
\return | \return | |||
String object containing the name of the file where the exception o | String object containing the name of the file where the exception | |||
ccurred. | occurred. | |||
*/ | */ | |||
const String& getFileName(void) const {return d_filename;} | const String& getFileName(void) const | |||
{ return d_filename; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the line number where the exception occurred. | Return the line number where the exception occurred. | |||
\Return | \Return | |||
Integer representing the line number where the exception occurred. | Integer representing the line number where the exception occurred. | |||
*/ | */ | |||
const int getLine(void) const {return d_line;} | int getLine(void) const | |||
{ return d_line; } | ||||
protected: | ||||
/****************************************************************** | // override from std::exception. | |||
***** | const char* what() const throw(); | |||
* CONSTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | protected: | |||
\brief | /*! | |||
Protected constructor that prevents instantiations (users should em | \brief | |||
ploy derived | Protected constructor that prevents instantiations (users should em | |||
exception classes instead) and that is responsible for logging the | ploy | |||
exception. | derived exception classes instead) and that is responsible for logg | |||
ing | ||||
the exception. | ||||
\param message | \param message | |||
String object describing the reason for the exception being thrown. | String object describing the reason for the exception being thrown. | |||
\param name | \param name | |||
String object describing the exception class name (e.g. CEGUI::Unkn | String object describing the exception class name | |||
ownObjectException) | (e.g. CEGUI::UnknownObjectException) | |||
\param filename | \param filename | |||
String object containing the name of the file where the exception o | String object containing the name of the file where the exception | |||
ccurred. | occurred. | |||
\param line | \param line | |||
Integer representing the line number where the exception occurred. | Integer representing the line number where the exception occurred. | |||
*/ | */ | |||
Exception(const String& message = "", const String& name ="CEGUI::E | Exception(const String& message = "", | |||
xception", const String& filename = "", int line = 0); | const String& name = "CEGUI::Exception", | |||
const String& filename = "", | ||||
/****************************************************************** | int line = 0); | |||
***** | ||||
* PROTECTED VARIABLES | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Holds the reason for the exception being thrown. | ||||
*/ | ||||
String d_message; | ||||
/*! | ||||
\brief | ||||
Holds the name of the file where the exception occurred. | ||||
*/ | ||||
String d_filename; | ||||
/*! | ||||
\brief | ||||
Holds the class name of the exception (e.g. CEGUI::ObjectInUseExcep | ||||
tion) | ||||
*/ | ||||
String d_name; | ||||
/*! | //! Holds the reason for the exception being thrown. | |||
\brief | String d_message; | |||
Holds the line number where the exception occurred. | //! Holds the name of the file where the exception occurred. | |||
*/ | String d_filename; | |||
int d_line; | //! Holds the class name of the exception (e.g. CEGUI::ObjectInUseExcep | |||
}; | tion) | |||
String d_name; | ||||
//! Holds the line number where the exception occurred. | ||||
int d_line; | ||||
//! Holds the default error message. | ||||
String d_what; | ||||
}; | ||||
/////////////////////////////////////////////////////////////////////// | //------------------------------------------------------------------------- | |||
/// | ---// | |||
// GENERIC EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
//! Exception class used when none of the other classes are applicable | ||||
class CEGUIEXPORT GenericException : public Exception | ||||
{ | ||||
public: | ||||
/*! | /*! | |||
\brief | \brief | |||
Exception class used when none of the other classes are applicable | Constructor that is responsible for logging the generic exception b | |||
*/ | y | |||
class CEGUIEXPORT GenericException : public Exception | calling the base class. | |||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the generic exception b | ||||
y calling | ||||
the base class. | ||||
\param message | \param message | |||
String object describing the reason for the generic exception being | String object describing the reason for the generic exception being | |||
thrown. | thrown. | |||
\param filename | \param filename | |||
String object containing the name of the file where the generic exc | String object containing the name of the file where the generic | |||
eption occurred. | exception occurred. | |||
\param line | \param line | |||
Integer representing the line number where the generic exception oc | Integer representing the line number where the generic exception | |||
curred. | occurred. | |||
\remarks | \remarks | |||
The generic exception name is automatically passed to the base clas s as | The generic exception name is automatically passed to the base clas s as | |||
"CEGUI::GenericException". | "CEGUI::GenericException". | |||
*/ | */ | |||
GenericException(const String& message, const String& file = "unkno | GenericException(const String& message, | |||
wn", int line = 0) | const String& file = "unknown", int line = 0) : | |||
: Exception(message, "CEGUI::GenericException", file, line) {} | Exception(message, "CEGUI::GenericException", file, line) | |||
}; | {} | |||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
This helper macro ensures the correct filename and line number where th | This helper macro ensures the correct filename and line number where th | |||
e generic | e | |||
exception occurred are passed to the exception itself. | generic exception occurred are passed to the exception itself. | |||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | There's a bug in Visual Studio 7.1 | |||
/199057/en) | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | o | |||
ide a | incorrect __LINE__ macro expansion if used inside a function and compil | |||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ed | |||
where | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
instead of a constant expressing line number you'll get the | constant expressing line number you'll get the following: | |||
following: (__LINE__Var+constant). The workaround consists in using com | (__LINE__Var+constant). The workaround consists in using compiler opti | |||
piler | on | |||
option "Program Database" (/Zi) instead | "Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | |||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ebug | |||
atabase (/Zi). | Information Format\Program Database (/Zi). Visual Studio 2005 corrects | |||
Visual Studio 2005 corrects the problem. Premake files were | the | |||
modified to contemplate this for VS2002 and VS2003. | problem. Premake files were modified to contemplate this for VS2002 and | |||
*/ | VS2003. | |||
#define GenericException(message) \ | */ | |||
GenericException(message, __FILE__, __LINE__) | #define GenericException(message) \ | |||
GenericException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | //------------------------------------------------------------------------- | |||
/// | ---// | |||
// UNKNOWN OBJECT EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
//! Exception class used when a request was made for an unknown object | ||||
class CEGUIEXPORT UnknownObjectException : public Exception | ||||
{ | ||||
public: | ||||
/*! | /*! | |||
\brief | \brief | |||
Exception class used when a request was made using a name of an unknown | Constructor that is responsible for logging the unknown object exce | |||
object | ption | |||
*/ | by calling the base class. | |||
class CEGUIEXPORT UnknownObjectException : public Exception | ||||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the unknown object exce | ||||
ption by calling | ||||
the base class. | ||||
\param message | ||||
String object describing the reason for the unknown object exceptio | ||||
n being thrown. | ||||
\param filename | ||||
String object containing the name of the file where the unknown obj | ||||
ect exception occurred. | ||||
\param line | \param message | |||
Integer representing the line number where the unknown object excep | String object describing the reason for the unknown object exceptio | |||
tion occurred. | n | |||
being thrown. | ||||
\remarks | \param filename | |||
The unknown object exception name is automatically passed to the ba | String object containing the name of the file where the unknown obj | |||
se class as | ect | |||
"CEGUI::UnknownObjectException". | exception occurred. | |||
*/ | ||||
UnknownObjectException(const String& message, const String& file = | ||||
"unknown", int line = 0) | ||||
: Exception(message, "CEGUI::UnknownObjectException", file, lin | ||||
e) {} | ||||
}; | ||||
/*! | \param line | |||
\brief | Integer representing the line number where the unknown object excep | |||
This helper macro ensures the correct filename and line number where th | tion | |||
e unknown object | occurred. | |||
exception occurred are passed to the exception itself. | ||||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | The unknown object exception name is automatically passed to the ba | |||
/199057/en) | se | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | class as "CEGUI::UnknownObjectException". | |||
ide a | ||||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ||||
where | ||||
instead of a constant expressing line number you'll get the | ||||
following: (__LINE__Var+constant). The workaround consists in using com | ||||
piler | ||||
option "Program Database" (/Zi) instead | ||||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ||||
atabase (/Zi). | ||||
Visual Studio 2005 corrects the problem. Premake files were | ||||
modified to contemplate this for VS2002 and VS2003. | ||||
*/ | ||||
#define UnknownObjectException(message) \ | ||||
UnknownObjectException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
// INVALID REQUEST EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
/*! | ||||
\brief | ||||
Exception class used when some impossible request was made for the curr | ||||
ent system state | ||||
*/ | */ | |||
class CEGUIEXPORT InvalidRequestException : public Exception | UnknownObjectException(const String& message, | |||
{ | const String& file = "unknown", int line = 0) : | |||
public: | Exception(message, "CEGUI::UnknownObjectException", file, line) | |||
{} | ||||
}; | ||||
/****************************************************************** | /*! | |||
***** | \brief | |||
* CONSTRUCTORS/DESTRUCTORS | This helper macro ensures the correct filename and line number where th | |||
****************************************************************** | e | |||
****/ | unknown object exception occurred are passed to the exception itself. | |||
/*! | \remarks | |||
\brief | There's a bug in Visual Studio 7.1 | |||
Constructor that is responsible for logging the invalid request exc | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
eption by calling | o | |||
the base class. | incorrect __LINE__ macro expansion if used inside a function and compil | |||
ed | ||||
with "Program Database for Edit & Continue" (/ZI) where instead of a | ||||
constant expressing line number you'll get the following: | ||||
(__LINE__Var+constant). The workaround consists in using compiler opti | ||||
on | ||||
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | ||||
ebug | ||||
Information Format\Program Database (/Zi). Visual Studio 2005 corrects | ||||
the | ||||
problem. Premake files were modified to contemplate this for VS2002 and | ||||
VS2003. | ||||
*/ | ||||
#define UnknownObjectException(message) \ | ||||
UnknownObjectException(message, __FILE__, __LINE__) | ||||
\param message | //------------------------------------------------------------------------- | |||
String object describing the reason for the invalid request excepti | ---// | |||
on being thrown. | ||||
\param filename | //! Exception class used when some impossible request was made of the syste | |||
String object containing the name of the file where the invalid req | m. | |||
uest exception occurred. | class CEGUIEXPORT InvalidRequestException : public Exception | |||
{ | ||||
public: | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the invalid request | ||||
exception by calling the base class. | ||||
\param line | \param message | |||
Integer representing the line number where the invalid request exce | String object describing the reason for the invalid request excepti | |||
ption occurred. | on | |||
being thrown. | ||||
\remarks | \param filename | |||
The invalid request exception name is automatically passed to the b | String object containing the name of the file where the invalid req | |||
ase class as | uest | |||
"CEGUI::InvalidRequestException". | exception occurred. | |||
*/ | ||||
InvalidRequestException(const String& message, const String& file = | ||||
"unknown", int line = 0) | ||||
: Exception(message, "CEGUI::InvalidRequestException", file, li | ||||
ne) {} | ||||
}; | ||||
/*! | \param line | |||
\brief | Integer representing the line number where the invalid request exce | |||
This helper macro ensures the correct filename and line number where th | ption | |||
e invalid request | occurred. | |||
exception occurred are passed to the exception itself. | ||||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | The invalid request exception name is automatically passed to the b | |||
/199057/en) | ase | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | class as "CEGUI::InvalidRequestException". | |||
ide a | ||||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ||||
where | ||||
instead of a constant expressing line number you'll get the | ||||
following: (__LINE__Var+constant). The workaround consists in using com | ||||
piler | ||||
option "Program Database" (/Zi) instead | ||||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ||||
atabase (/Zi). | ||||
Visual Studio 2005 corrects the problem. Premake files were | ||||
modified to contemplate this for VS2002 and VS2003. | ||||
*/ | */ | |||
#define InvalidRequestException(message) \ | InvalidRequestException(const String& message, | |||
InvalidRequestException(message, __FILE__, __LINE__) | const String& file = "unknown", int line = 0) : | |||
Exception(message, "CEGUI::InvalidRequestException", file, line) | ||||
{} | ||||
}; | ||||
/////////////////////////////////////////////////////////////////////// | /*! | |||
/// | \brief | |||
// FILE IO EXCEPTION | This helper macro ensures the correct filename and line number where th | |||
/////////////////////////////////////////////////////////////////////// | e | |||
/// | invalid request exception occurred are passed to the exception itself. | |||
/*! | \remarks | |||
\brief | There's a bug in Visual Studio 7.1 | |||
Exception class used when a file handling problem occurs | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
*/ | o | |||
class CEGUIEXPORT FileIOException : public Exception | incorrect __LINE__ macro expansion if used inside a function and compil | |||
{ | ed | |||
public: | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
constant expressing line number you'll get the following: | ||||
(__LINE__Var+constant). The workaround consists in using compiler opti | ||||
on | ||||
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | ||||
ebug | ||||
Information Format\Program Database (/Zi). Visual Studio 2005 corrects | ||||
the | ||||
problem. Premake files were modified to contemplate this for VS2002 and | ||||
VS2003. | ||||
*/ | ||||
#define InvalidRequestException(message) \ | ||||
InvalidRequestException(message, __FILE__, __LINE__) | ||||
/****************************************************************** | //------------------------------------------------------------------------- | |||
***** | ---// | |||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | //! Exception class used when a file handling problem occurs | |||
\brief | class CEGUIEXPORT FileIOException : public Exception | |||
Constructor that is responsible for logging the file IO exception b | { | |||
y calling | public: | |||
the base class. | /*! | |||
\brief | ||||
Constructor that is responsible for logging the file IO exception b | ||||
y | ||||
calling the base class. | ||||
\param message | \param message | |||
String object describing the reason for the file IO exception being | String object describing the reason for the file IO exception being | |||
thrown. | thrown. | |||
\param filename | \param filename | |||
String object containing the name of the file where the file IO exc | String object containing the name of the file where the file IO | |||
eption occurred. | exception occurred. | |||
\param line | \param line | |||
Integer representing the line number where the file IO exception oc | Integer representing the line number where the file IO exception | |||
curred. | occurred. | |||
\remarks | \remarks | |||
The file IO exception name is automatically passed to the base clas s as | The file IO exception name is automatically passed to the base clas s as | |||
"CEGUI::FileIOException". | "CEGUI::FileIOException". | |||
*/ | */ | |||
FileIOException(const String& message, const String& file = "unknow | FileIOException(const String& message, | |||
n", int line = 0) | const String& file = "unknown", int line = 0) : | |||
: Exception(message, "CEGUI::FileIOException", file, line) {} | Exception(message, "CEGUI::FileIOException", file, line) | |||
}; | {} | |||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
This helper macro ensures the correct filename and line number where th | This helper macro ensures the correct filename and line number where th | |||
e file IO | e | |||
exception occurred are passed to the exception itself. | file IO exception occurred are passed to the exception itself. | |||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | There's a bug in Visual Studio 7.1 | |||
/199057/en) | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | o | |||
ide a | incorrect __LINE__ macro expansion if used inside a function and compil | |||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ed | |||
where | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
instead of a constant expressing line number you'll get the | constant expressing line number you'll get the following: | |||
following: (__LINE__Var+constant). The workaround consists in using com | (__LINE__Var+constant). The workaround consists in using compiler opti | |||
piler | on | |||
option "Program Database" (/Zi) instead | "Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | |||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ebug | |||
atabase (/Zi). | Information Format\Program Database (/Zi). Visual Studio 2005 corrects | |||
Visual Studio 2005 corrects the problem. Premake files were | the | |||
modified to contemplate this for VS2002 and VS2003. | problem. Premake files were modified to contemplate this for VS2002 and | |||
*/ | VS2003. | |||
#define FileIOException(message) \ | */ | |||
FileIOException(message, __FILE__, __LINE__) | #define FileIOException(message) \ | |||
FileIOException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | //------------------------------------------------------------------------- | |||
/// | ---// | |||
// RENDERER EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
//! Exception class used for problems in the rendering subsystem classes. | ||||
class CEGUIEXPORT RendererException : public Exception | ||||
{ | ||||
public: | ||||
/*! | /*! | |||
\brief | \brief | |||
Exception class used when an problem is detected within the Renderer or | Constructor that is responsible for logging the renderer exception | |||
related objects | by | |||
*/ | calling the base class. | |||
class CEGUIEXPORT RendererException : public Exception | ||||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the renderer exception | ||||
by calling | ||||
the base class. | ||||
\param message | \param message | |||
String object describing the reason for the renderer exception bein | String object describing the reason for the renderer exception bein | |||
g thrown. | g | |||
thrown. | ||||
\param filename | \param filename | |||
String object containing the name of the file where the renderer ex | String object containing the name of the file where the renderer | |||
ception occurred. | exception occurred. | |||
\param line | \param line | |||
Integer representing the line number where the renderer exception o | Integer representing the line number where the renderer exception | |||
ccurred. | occurred. | |||
\remarks | \remarks | |||
The renderer exception name is automatically passed to the base cla ss as | The renderer exception name is automatically passed to the base cla ss as | |||
"CEGUI::RendererException". | "CEGUI::RendererException". | |||
*/ | */ | |||
RendererException(const String& message, const String& file = "unkn | RendererException(const String& message, | |||
own", int line = 0) | const String& file = "unknown", int line = 0) : | |||
: Exception(message, "CEGUI::RendererException", file, line) {} | Exception(message, "CEGUI::RendererException", file, line) | |||
}; | {} | |||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
This helper macro ensures the correct filename and line number where th | This helper macro ensures the correct filename and line number where th | |||
e renderer | e | |||
exception occurred are passed to the exception itself. | renderer exception occurred are passed to the exception itself. | |||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | There's a bug in Visual Studio 7.1 | |||
/199057/en) | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | o | |||
ide a | incorrect __LINE__ macro expansion if used inside a function and compil | |||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ed | |||
where | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
instead of a constant expressing line number you'll get the | constant expressing line number you'll get the following: | |||
following: (__LINE__Var+constant). The workaround consists in using com | (__LINE__Var+constant). The workaround consists in using compiler opti | |||
piler | on | |||
option "Program Database" (/Zi) instead | "Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | |||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ebug | |||
atabase (/Zi). | Information Format\Program Database (/Zi). Visual Studio 2005 corrects | |||
Visual Studio 2005 corrects the problem. Premake files were | the | |||
modified to contemplate this for VS2002 and VS2003. | problem. Premake files were modified to contemplate this for VS2002 and | |||
*/ | VS2003. | |||
#define RendererException(message) \ | */ | |||
RendererException(message, __FILE__, __LINE__) | #define RendererException(message) \ | |||
RendererException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | //------------------------------------------------------------------------- | |||
/// | ---// | |||
// ALREADY EXISTS EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
/*! | ||||
\brief | ||||
Exception class used when an attempt is made create a named object of a | ||||
particular type when an object of the same type already exists with the | ||||
same | ||||
name. | ||||
*/ | ||||
class CEGUIEXPORT AlreadyExistsException : public Exception | ||||
{ | ||||
public: | ||||
/*! | /*! | |||
\brief | \brief | |||
Exception class used when an attempt is made to use an object name that | Constructor that is responsible for logging the already exists exce | |||
is already in use within the system | ption | |||
*/ | by calling the base class. | |||
class CEGUIEXPORT AlreadyExistsException : public Exception | ||||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the already exists exce | ||||
ption by calling | ||||
the base class. | ||||
\param message | ||||
String object describing the reason for the already exists exceptio | ||||
n being thrown. | ||||
\param filename | ||||
String object containing the name of the file where the already exi | ||||
sts exception occurred. | ||||
\param line | \param message | |||
Integer representing the line number where the already exists excep | String object describing the reason for the already exists exceptio | |||
tion occurred. | n | |||
being thrown. | ||||
\remarks | \param filename | |||
The already exists exception name is automatically passed to the ba | String object containing the name of the file where the already exi | |||
se class as | sts | |||
"CEGUI::AlreadyExistsException". | exception occurred. | |||
*/ | ||||
AlreadyExistsException(const String& message, const String& file = | ||||
"unknown", int line = 0) | ||||
: Exception(message, "CEGUI::AlreadyExistsException", file, lin | ||||
e) {} | ||||
}; | ||||
/*! | \param line | |||
\brief | Integer representing the line number where the already exists excep | |||
This helper macro ensures the correct filename and line number where th | tion | |||
e already exists | occurred. | |||
exception occurred are passed to the exception itself. | ||||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | The already exists exception name is automatically passed to the ba | |||
/199057/en) | se | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | class as "CEGUI::AlreadyExistsException". | |||
ide a | ||||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ||||
where | ||||
instead of a constant expressing line number you'll get the | ||||
following: (__LINE__Var+constant). The workaround consists in using com | ||||
piler | ||||
option "Program Database" (/Zi) instead | ||||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ||||
atabase (/Zi). | ||||
Visual Studio 2005 corrects the problem. Premake files were | ||||
modified to contemplate this for VS2002 and VS2003. | ||||
*/ | */ | |||
#define AlreadyExistsException(message) \ | AlreadyExistsException(const String& message, | |||
AlreadyExistsException(message, __FILE__, __LINE__) | const String& file = "unknown", int line = 0) : | |||
Exception(message, "CEGUI::AlreadyExistsException", file, line) | ||||
{} | ||||
}; | ||||
/////////////////////////////////////////////////////////////////////// | /*! | |||
/// | \brief | |||
// MEMORY EXCEPTION | This helper macro ensures the correct filename and line number where th | |||
/////////////////////////////////////////////////////////////////////// | e | |||
/// | already exists exception occurred are passed to the exception itself. | |||
/*! | \remarks | |||
\brief | There's a bug in Visual Studio 7.1 | |||
Exception class used when a memory handling error is detected | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
*/ | o | |||
class CEGUIEXPORT MemoryException : public Exception | incorrect __LINE__ macro expansion if used inside a function and compil | |||
{ | ed | |||
public: | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
constant expressing line number you'll get the following: | ||||
(__LINE__Var+constant). The workaround consists in using compiler opti | ||||
on | ||||
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | ||||
ebug | ||||
Information Format\Program Database (/Zi). Visual Studio 2005 corrects | ||||
the | ||||
problem. Premake files were modified to contemplate this for VS2002 and | ||||
VS2003. | ||||
*/ | ||||
#define AlreadyExistsException(message) \ | ||||
AlreadyExistsException(message, __FILE__, __LINE__) | ||||
/****************************************************************** | //------------------------------------------------------------------------- | |||
***** | ---// | |||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | //! Exception class used when a memory handling error is detected | |||
\brief | class CEGUIEXPORT MemoryException : public Exception | |||
Constructor that is responsible for logging the memory exception by | { | |||
calling | public: | |||
the base class. | /*! | |||
\brief | ||||
Constructor that is responsible for logging the memory exception by | ||||
calling the base class. | ||||
\param message | \param message | |||
String object describing the reason for the memory exception being | String object describing the reason for the memory exception being | |||
thrown. | thrown. | |||
\param filename | \param filename | |||
String object containing the name of the file where the memory exce | String object containing the name of the file where the memory exce | |||
ption occurred. | ption | |||
occurred. | ||||
\param line | \param line | |||
Integer representing the line number where the memory exception occ | Integer representing the line number where the memory exception | |||
urred. | occurred. | |||
\remarks | \remarks | |||
The memory exception name is automatically passed to the base class as | The memory exception name is automatically passed to the base class as | |||
"CEGUI::MemoryException". | "CEGUI::MemoryException". | |||
*/ | */ | |||
MemoryException(const String& message, const String& file = "unknow | MemoryException(const String& message, | |||
n", int line = 0) | const String& file = "unknown", int line = 0) : | |||
: Exception(message, "CEGUI::MemoryException", file, line) {} | Exception(message, "CEGUI::MemoryException", file, line) | |||
}; | {} | |||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
This helper macro ensures the correct filename and line number where th | This helper macro ensures the correct filename and line number where th | |||
e memory | e | |||
exception occurred are passed to the exception itself. | memory exception occurred are passed to the exception itself. | |||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | There's a bug in Visual Studio 7.1 | |||
/199057/en) | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | o | |||
ide a | incorrect __LINE__ macro expansion if used inside a function and compil | |||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ed | |||
where | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
instead of a constant expressing line number you'll get the | constant expressing line number you'll get the following: | |||
following: (__LINE__Var+constant). The workaround consists in using com | (__LINE__Var+constant). The workaround consists in using compiler opti | |||
piler | on | |||
option "Program Database" (/Zi) instead | "Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | |||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ebug | |||
atabase (/Zi). | Information Format\Program Database (/Zi). Visual Studio 2005 corrects | |||
Visual Studio 2005 corrects the problem. Premake files were | the | |||
modified to contemplate this for VS2002 and VS2003. | problem. Premake files were modified to contemplate this for VS2002 and | |||
*/ | VS2003. | |||
#define MemoryException(message) \ | */ | |||
MemoryException(message, __FILE__, __LINE__) | #define MemoryException(message) \ | |||
MemoryException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | //------------------------------------------------------------------------- | |||
/// | ---// | |||
// NULL OBJECT EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
//! Exception class used when some required object or parameter is null | ||||
class CEGUIEXPORT NullObjectException : public Exception | ||||
{ | ||||
public: | ||||
/*! | /*! | |||
\brief | \brief | |||
Exception class used when some required object or parameter is null | Constructor that is responsible for logging the null object excepti | |||
*/ | on by | |||
class CEGUIEXPORT NullObjectException : public Exception | calling the base class. | |||
{ | ||||
public: | ||||
/****************************************************************** | ||||
***** | ||||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the null object excepti | ||||
on by calling | ||||
the base class. | ||||
\param message | ||||
String object describing the reason for the null object exception b | ||||
eing thrown. | ||||
\param filename | ||||
String object containing the name of the file where the null object | ||||
exception occurred. | ||||
\param line | \param message | |||
Integer representing the line number where the null object exceptio | String object describing the reason for the null object exception b | |||
n occurred. | eing | |||
thrown. | ||||
\remarks | \param filename | |||
The null object exception name is automatically passed to the base | String object containing the name of the file where the null object | |||
class as | exception occurred. | |||
"CEGUI::NullObjectException". | ||||
*/ | ||||
NullObjectException(const String& message, const String& file = "un | ||||
known", int line = 0) | ||||
: Exception(message, "CEGUI::NullObjectException", file, line) | ||||
{} | ||||
}; | ||||
/*! | \param line | |||
\brief | Integer representing the line number where the null object exceptio | |||
This helper macro ensures the correct filename and line number where th | n | |||
e null object | occurred. | |||
exception occurred are passed to the exception itself. | ||||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | The null object exception name is automatically passed to the base | |||
/199057/en) | class | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | as "CEGUI::NullObjectException". | |||
ide a | ||||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ||||
where | ||||
instead of a constant expressing line number you'll get the | ||||
following: (__LINE__Var+constant). The workaround consists in using com | ||||
piler | ||||
option "Program Database" (/Zi) instead | ||||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ||||
atabase (/Zi). | ||||
Visual Studio 2005 corrects the problem. Premake files were | ||||
modified to contemplate this for VS2002 and VS2003. | ||||
*/ | ||||
#define NullObjectException(message) \ | ||||
NullObjectException(message, __FILE__, __LINE__) | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
// OBJECT IN USE EXCEPTION | ||||
/////////////////////////////////////////////////////////////////////// | ||||
/// | ||||
/*! | ||||
\brief | ||||
Exception class used when some attempt to delete, remove, or otherwise | ||||
invalidate some object that is still in use occurs. | ||||
*/ | */ | |||
class CEGUIEXPORT ObjectInUseException : public Exception | NullObjectException(const String& message, | |||
{ | const String& file = "unknown", int line = 0) : | |||
public: | Exception(message, "CEGUI::NullObjectException", file, line) | |||
{} | ||||
}; | ||||
/****************************************************************** | /*! | |||
***** | \brief | |||
* CONSTRUCTORS/DESTRUCTORS | This helper macro ensures the correct filename and line number where th | |||
****************************************************************** | e | |||
****/ | null object exception occurred are passed to the exception itself. | |||
/*! | \remarks | |||
\brief | There's a bug in Visual Studio 7.1 | |||
Constructor that is responsible for logging the object in use excep | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
tion by calling | o | |||
the base class. | incorrect __LINE__ macro expansion if used inside a function and compil | |||
ed | ||||
with "Program Database for Edit & Continue" (/ZI) where instead of a | ||||
constant expressing line number you'll get the following: | ||||
(__LINE__Var+constant). The workaround consists in using compiler opti | ||||
on | ||||
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | ||||
ebug | ||||
Information Format\Program Database (/Zi). Visual Studio 2005 corrects | ||||
the | ||||
problem. Premake files were modified to contemplate this for VS2002 and | ||||
VS2003. | ||||
*/ | ||||
#define NullObjectException(message) \ | ||||
NullObjectException(message, __FILE__, __LINE__) | ||||
\param message | //------------------------------------------------------------------------- | |||
String object describing the reason for the object in use exception | ---// | |||
being thrown. | ||||
\param filename | /*! | |||
String object containing the name of the file where the object in u | \brief | |||
se exception occurred. | Exception class used when some attempt to delete, remove, or otherwise | |||
invalidate some object that is still in use occurs. | ||||
*/ | ||||
class CEGUIEXPORT ObjectInUseException : public Exception | ||||
{ | ||||
public: | ||||
/*! | ||||
\brief | ||||
Constructor that is responsible for logging the object in use excep | ||||
tion | ||||
by calling the base class. | ||||
\param line | \param message | |||
Integer representing the line number where the object in use except | String object describing the reason for the object in use exception | |||
ion occurred. | being thrown. | |||
\remarks | \param filename | |||
The object in use exception name is automatically passed to the bas | String object containing the name of the file where the object in u | |||
e class as | se | |||
"CEGUI::ObjectInUseException". | exception occurred. | |||
*/ | ||||
ObjectInUseException(const String& message, const String& file = "u | ||||
nknown", int line = 0) | ||||
: Exception(message, "CEGUI::ObjectInUseException", file, line) | ||||
{} | ||||
}; | ||||
/*! | \param line | |||
\brief | Integer representing the line number where the object in use except | |||
This helper macro ensures the correct filename and line number where th | ion | |||
e object in use | occurred. | |||
exception occurred are passed to the exception itself. | ||||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | The object in use exception name is automatically passed to the bas | |||
/199057/en) | e | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | class as "CEGUI::ObjectInUseException". | |||
ide a | ||||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ||||
where | ||||
instead of a constant expressing line number you'll get the | ||||
following: (__LINE__Var+constant). The workaround consists in using com | ||||
piler | ||||
option "Program Database" (/Zi) instead | ||||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ||||
atabase (/Zi). | ||||
Visual Studio 2005 corrects the problem. Premake files were | ||||
modified to contemplate this for VS2002 and VS2003. | ||||
*/ | */ | |||
#define ObjectInUseException(message) \ | ObjectInUseException(const String& message, | |||
ObjectInUseException(message, __FILE__, __LINE__) | const String& file = "unknown", int line = 0) : | |||
Exception(message, "CEGUI::ObjectInUseException", file, line) | ||||
{} | ||||
}; | ||||
/////////////////////////////////////////////////////////////////////// | /*! | |||
/// | \brief | |||
// SCRIPT EXCEPTION | This helper macro ensures the correct filename and line number where th | |||
/////////////////////////////////////////////////////////////////////// | e | |||
/// | object in use exception occurred are passed to the exception itself. | |||
/*! | \remarks | |||
\brief | There's a bug in Visual Studio 7.1 | |||
Exception class used when a scripting error occurs | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
*/ | o | |||
class CEGUIEXPORT ScriptException : public Exception | incorrect __LINE__ macro expansion if used inside a function and compil | |||
{ | ed | |||
public: | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
constant expressing line number you'll get the following: | ||||
(__LINE__Var+constant). The workaround consists in using compiler opti | ||||
on | ||||
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | ||||
ebug | ||||
Information Format\Program Database (/Zi). Visual Studio 2005 corrects | ||||
the | ||||
problem. Premake files were modified to contemplate this for VS2002 and | ||||
VS2003. | ||||
*/ | ||||
#define ObjectInUseException(message) \ | ||||
ObjectInUseException(message, __FILE__, __LINE__) | ||||
/****************************************************************** | //------------------------------------------------------------------------- | |||
***** | ---// | |||
* CONSTRUCTORS/DESTRUCTORS | ||||
****************************************************************** | ||||
****/ | ||||
/*! | //! Exception class used for issues in scripting subsystem. | |||
\brief | class CEGUIEXPORT ScriptException : public Exception | |||
Constructor that is responsible for logging the script exception by | { | |||
calling | public: | |||
the base class. | /*! | |||
\brief | ||||
Constructor that is responsible for logging the script exception by | ||||
calling the base class. | ||||
\param message | \param message | |||
String object describing the reason for the script exception being | String object describing the reason for the script exception being | |||
thrown. | thrown. | |||
\param filename | \param filename | |||
String object containing the name of the file where the script exce | String object containing the name of the file where the script exce | |||
ption occurred. | ption | |||
occurred. | ||||
\param line | \param line | |||
Integer representing the line number where the script exception occ | Integer representing the line number where the script exception | |||
urred. | occurred. | |||
\remarks | \remarks | |||
The script exception name is automatically passed to the base class as | The script exception name is automatically passed to the base class as | |||
"CEGUI::ScriptException". | "CEGUI::ScriptException". | |||
*/ | */ | |||
ScriptException(const String& message, const String& file = "unknow | ScriptException(const String& message, | |||
n", int line = 0) | const String& file = "unknown", int line = 0) : | |||
: Exception(message, "CEGUI::ScriptException", file, line) {} | Exception(message, "CEGUI::ScriptException", file, line) | |||
}; | {} | |||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
This helper macro ensures the correct filename and line number where th | This helper macro ensures the correct filename and line number where th | |||
e script | e | |||
exception occurred are passed to the exception itself. | script exception occurred are passed to the exception itself. | |||
\remarks | \remarks | |||
There's a bug in Visual Studio 7.1 (see http://support.microsoft.com/kb | There's a bug in Visual Studio 7.1 | |||
/199057/en) | (see http://support.microsoft.com/kb/199057/en) and lower which leads t | |||
and lower which leads to incorrect __LINE__ macro expansion if used ins | o | |||
ide a | incorrect __LINE__ macro expansion if used inside a function and compil | |||
function and compiled with "Program Database for Edit & Continue" (/ZI) | ed | |||
where | with "Program Database for Edit & Continue" (/ZI) where instead of a | |||
instead of a constant expressing line number you'll get the | constant expressing line number you'll get the following: | |||
following: (__LINE__Var+constant). The workaround consists in using com | (__LINE__Var+constant). The workaround consists in using compiler opti | |||
piler | on | |||
option "Program Database" (/Zi) instead | "Program Database" (/Zi) instead --> Project Properties\C/C++\General\D | |||
--> Project Properties\C/C++\General\Debug Information Format\Program D | ebug | |||
atabase (/Zi). | Information Format\Program Database (/Zi). Visual Studio 2005 corrects | |||
Visual Studio 2005 corrects the problem. Premake files were | the | |||
modified to contemplate this for VS2002 and VS2003. | problem. Premake files were modified to contemplate this for VS2002 and | |||
*/ | VS2003. | |||
#define ScriptException(message) \ | */ | |||
ScriptException(message, __FILE__, __LINE__) | #define ScriptException(message) \ | |||
ScriptException(message, __FILE__, __LINE__) | ||||
//------------------------------------------------------------------------- | ||||
---// | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIExceptions_h_ | #endif // end of guard _CEGUIExceptions_h_ | |||
End of changes. 120 change blocks. | ||||
751 lines changed or deleted | 614 lines changed or added | |||
CEGUIExpatParser.h | CEGUIExpatParser.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIExpatParser_h_ | #ifndef _CEGUIExpatParser_h_ | |||
#define _CEGUIExpatParser_h_ | #define _CEGUIExpatParser_h_ | |||
#include "CEGUIXMLParser.h" | #include "../../CEGUIXMLParser.h" | |||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUIEXPATPARSER_EXPORTS | # ifdef CEGUIEXPATPARSER_EXPORTS | |||
# define CEGUIEXPATPARSER_API __declspec(dllexport) | # define CEGUIEXPATPARSER_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUIEXPATPARSER_API __declspec(dllimport) | # define CEGUIEXPATPARSER_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUIEXPATPARSER_API | # define CEGUIEXPATPARSER_API | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFalComponentBase.h | CEGUIFalComponentBase.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalComponentBase_h_ | #ifndef _CEGUIFalComponentBase_h_ | |||
#define _CEGUIFalComponentBase_h_ | #define _CEGUIFalComponentBase_h_ | |||
#include "falagard/CEGUIFalDimensions.h" | #include "CEGUIFalDimensions.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "../CEGUIColourRect.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Common base class used for renderable components within an ImageryS ection. | Common base class used for renderable components within an ImageryS ection. | |||
*/ | */ | |||
class CEGUIEXPORT FalagardComponentBase | class CEGUIEXPORT FalagardComponentBase | |||
{ | { | |||
skipping to change at line 63 | skipping to change at line 64 | |||
*/ | */ | |||
virtual ~FalagardComponentBase(); | virtual ~FalagardComponentBase(); | |||
/*! | /*! | |||
\brief | \brief | |||
Render this component. More correctly, the component is cached for rendering. | Render this component. More correctly, the component is cached for rendering. | |||
\param srcWindow | \param srcWindow | |||
Window to use as the base for translating the component's Compo nentArea into pixel values. | Window to use as the base for translating the component's Compo nentArea into pixel values. | |||
\param base_z | ||||
The z value to use for rendering the component. Note that this | ||||
is not the final z value to use, but | ||||
some z offset from a currently unknown starting value. | ||||
\param modColours | \param modColours | |||
ColourRect describing colours that are to be modulated with the component's stored colour values | ColourRect describing colours that are to be modulated with the component's stored colour values | |||
to calculate a set of 'final' colour values to be used. May be 0. | to calculate a set of 'final' colour values to be used. May be 0. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, float base_z, const CEGUI::ColourRec t* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) con st; | void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Render this component. More correctly, the component is cached for rendering. | Render this component. More correctly, the component is cached for rendering. | |||
\param srcWindow | \param srcWindow | |||
Window to use as the base for translating the component's Compo nentArea into pixel values. | Window to use as the base for translating the component's Compo nentArea into pixel values. | |||
\param baseRect | \param baseRect | |||
Rect to use as the base for translating the component's Compone ntArea into pixel values. | Rect to use as the base for translating the component's Compone ntArea into pixel values. | |||
\param base_z | ||||
The z value to use for rendering the component. Note that this | ||||
is not the final z value to use, but | ||||
some z offset from a currently unknown starting value. | ||||
\param modColours | \param modColours | |||
ColourRect describing colours that are to be modulated with the component's stored colour values | ColourRect describing colours that are to be modulated with the component's stored colour values | |||
to calculate a set of 'final' colour values to be used. May be 0. | to calculate a set of 'final' colour values to be used. May be 0. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, const Rect& baseRect, float base_z, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clip ToDisplay = false) const; | void render(Window& srcWindow, const Rect& baseRect, const CEGUI::C olourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = fa lse) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the ComponentArea of this ImageryComponent. | Return the ComponentArea of this ImageryComponent. | |||
\return | \return | |||
ComponentArea object describing the ImageryComponent's current target area. | ComponentArea object describing the ImageryComponent's current target area. | |||
*/ | */ | |||
const ComponentArea& getComponentArea() const; | const ComponentArea& getComponentArea() const; | |||
skipping to change at line 203 | skipping to change at line 196 | |||
This will try and get values from multiple places: | This will try and get values from multiple places: | |||
- a property attached to \a wnd | - a property attached to \a wnd | |||
- or the integral d_colours value. | - or the integral d_colours value. | |||
*/ | */ | |||
void initColoursRect(const Window& wnd, const ColourRect* modCols, ColourRect& cr) const; | void initColoursRect(const Window& wnd, const ColourRect* modCols, ColourRect& cr) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Method to do main render caching work. | Method to do main render caching work. | |||
*/ | */ | |||
virtual void render_impl(Window& srcWindow, Rect& destRect, float b ase_z, const CEGUI::ColourRect* modColours, const Rect* clipper, bool clipT oDisplay) const = 0; | virtual void render_impl(Window& srcWindow, Rect& destRect, const C EGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay) cons t = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Writes xml for the colours to a OutStream. Will prefer propert y colours before explicit. | Writes xml for the colours to a OutStream. Will prefer propert y colours before explicit. | |||
\note | \note | |||
This is intended as a helper method for sub-classes when output ting xml to a stream. | This is intended as a helper method for sub-classes when output ting xml to a stream. | |||
\return | \return | |||
- true if xml element was written. | - true if xml element was written. | |||
End of changes. 6 change blocks. | ||||
15 lines changed or deleted | 6 lines changed or added | |||
CEGUIFalDimensions.h | CEGUIFalDimensions.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalDimensions_h_ | #ifndef _CEGUIFalDimensions_h_ | |||
#define _CEGUIFalDimensions_h_ | #define _CEGUIFalDimensions_h_ | |||
#include "falagard/CEGUIFalEnums.h" | #include "CEGUIFalEnums.h" | |||
#include "CEGUIString.h" | #include "../CEGUIString.h" | |||
#include "CEGUIUDim.h" | #include "../CEGUIUDim.h" | |||
#include "CEGUIXMLSerializer.h" | #include "../CEGUIXMLSerializer.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Abstract interface for a generic 'dimension' class. | Abstract interface for a generic 'dimension' class. | |||
*/ | */ | |||
class CEGUIEXPORT BaseDim | class CEGUIEXPORT BaseDim | |||
{ | { | |||
skipping to change at line 439 | skipping to change at line 439 | |||
private: | private: | |||
String d_font; //!< Name of Font. If empty font will be taken from Window. | String d_font; //!< Name of Font. If empty font will be taken from Window. | |||
String d_text; //!< String to measure for extents, if emp ty will use window text. | String d_text; //!< String to measure for extents, if emp ty will use window text. | |||
String d_childSuffix; //!< String to hold the name suffix of the window to use for fetching missing font and/or text. | String d_childSuffix; //!< String to hold the name suffix of the window to use for fetching missing font and/or text. | |||
FontMetricType d_metric; //!< what metric we represent. | FontMetricType d_metric; //!< what metric we represent. | |||
float d_padding; //!< padding value to be added. | float d_padding; //!< padding value to be added. | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Dimension type that represents the value of a Window property. Imp | Dimension type that represents the value of a Window property. | |||
lements BaseDim interface. | Implements BaseDim interface. | |||
*/ | */ | |||
class CEGUIEXPORT PropertyDim : public BaseDim | class CEGUIEXPORT PropertyDim : public BaseDim | |||
{ | { | |||
public: | public: | |||
/*! | /*! | |||
\brief | \brief | |||
Constructor. | Constructor. | |||
\param name | \param name | |||
String holding the name suffix of the window on which the prope | String holding the name suffix of the window on which the prope | |||
rty is to be accessed. | rty | |||
is to be accessed. | ||||
\param property | \param property | |||
String object holding the name of the property this PropertyDim | String object holding the name of the property this PropertyDim | |||
represents the value of. | represents the value of. The property named should represent e | |||
The property named should represent a simple float value. | ither | |||
a UDim value or a simple float value - dependning upon what \a | ||||
type | ||||
is specified as. | ||||
\param type | \param type | |||
DimensionType value indicating what dimension named property re | DimensionType value indicating what dimension named property | |||
presents. | represents. The possible DimensionType values are as follows: | |||
- DT_INVALID the property should represent a simple float value | ||||
. | ||||
- DT_WIDTH the property should represent a UDim value where the | ||||
scale is relative to the targetted Window's width. | ||||
- DT_HEIGHT the property should represent a UDim value where th | ||||
e | ||||
scale is relative to the targetted Window's height. | ||||
- All other values will cause an InvalidRequestException except | ||||
ion | ||||
to be thrown. | ||||
*/ | */ | |||
PropertyDim(const String& name, const String& property, DimensionTy pe type); | PropertyDim(const String& name, const String& property, DimensionTy pe type); | |||
protected: | protected: | |||
// Implementation of the base class interface | // Implementation of the base class interface | |||
float getValue_impl(const Window& wnd) const; | float getValue_impl(const Window& wnd) const; | |||
float getValue_impl(const Window& wnd, const Rect& container) const ; | float getValue_impl(const Window& wnd, const Rect& container) const ; | |||
void writeXMLElementName_impl(XMLSerializer& xml_stream) const; | void writeXMLElementName_impl(XMLSerializer& xml_stream) const; | |||
void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) cons t; | void writeXMLElementAttributes_impl(XMLSerializer& xml_stream) cons t; | |||
BaseDim* clone_impl() const; | BaseDim* clone_impl() const; | |||
End of changes. 5 change blocks. | ||||
13 lines changed or deleted | 27 lines changed or added | |||
CEGUIFalFrameComponent.h | CEGUIFalFrameComponent.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalFrameComponent_h_ | #ifndef _CEGUIFalFrameComponent_h_ | |||
#define _CEGUIFalFrameComponent_h_ | #define _CEGUIFalFrameComponent_h_ | |||
#include "falagard/CEGUIFalComponentBase.h" | #include "CEGUIFalComponentBase.h" | |||
#include "CEGUIXMLSerializer.h" | #include "../CEGUIXMLSerializer.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class that encapsulates information for a frame with background (9 images in total) | Class that encapsulates information for a frame with background (9 images in total) | |||
Corner images are always drawn at their natural size, edges are str etched between the corner | Corner images are always drawn at their natural size, edges are str etched between the corner | |||
pieces for a particular edge, the background image will cover the i nner rectangle formed by | pieces for a particular edge, the background image will cover the i nner rectangle formed by | |||
skipping to change at line 155 | skipping to change at line 155 | |||
\param xml_stream | \param xml_stream | |||
Stream where xml data should be output. | Stream where xml data should be output. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void writeXMLToStream(XMLSerializer& xml_stream) const; | void writeXMLToStream(XMLSerializer& xml_stream) const; | |||
protected: | protected: | |||
// implemets abstract from base | // implemets abstract from base | |||
void render_impl(Window& srcWindow, Rect& destRect, float base_z, c onst CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay ) const; | void render_impl(Window& srcWindow, Rect& destRect, const CEGUI::Co lourRect* modColours, const Rect* clipper, bool clipToDisplay) const; | |||
// renders the background image (basically a clone of render_impl f rom ImageryComponent - maybe we need a helper class?) | // renders the background image (basically a clone of render_impl f rom ImageryComponent - maybe we need a helper class?) | |||
void doBackgroundRender(Window& srcWindow, Rect& destRect, float ba se_z, const ColourRect& colours, const Rect* clipper, bool clipToDisplay) c onst; | void doBackgroundRender(Window& srcWindow, Rect& destRect, const Co lourRect& colours, const Rect* clipper, bool clipToDisplay) const; | |||
// formatting options for background | // formatting options for background | |||
VerticalFormatting d_vertFormatting; //!< Vertical formatting to be applied when rendering the background for the component. | VerticalFormatting d_vertFormatting; //!< Vertical formatting to be applied when rendering the background for the component. | |||
HorizontalFormatting d_horzFormatting; //!< Horizontal formatting to be applied when rendering the background for the component. | HorizontalFormatting d_horzFormatting; //!< Horizontal formatting to be applied when rendering the background for the component. | |||
// images for the frame | // images for the frame | |||
const Image* d_frameImages[FIC_FRAME_IMAGE_COUNT]; //!< Array that holds the assigned images. | const Image* d_frameImages[FIC_FRAME_IMAGE_COUNT]; //!< Array that holds the assigned images. | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIFalImageryComponent.h | CEGUIFalImageryComponent.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalImageryComponent_h_ | #ifndef _CEGUIFalImageryComponent_h_ | |||
#define _CEGUIFalImageryComponent_h_ | #define _CEGUIFalImageryComponent_h_ | |||
#include "falagard/CEGUIFalComponentBase.h" | #include "CEGUIFalComponentBase.h" | |||
#include "CEGUIXMLSerializer.h" | #include "../CEGUIXMLSerializer.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class that encapsulates information for a single image component. | Class that encapsulates information for a single image component. | |||
*/ | */ | |||
class CEGUIEXPORT ImageryComponent : public FalagardComponentBase | class CEGUIEXPORT ImageryComponent : public FalagardComponentBase | |||
{ | { | |||
skipping to change at line 173 | skipping to change at line 173 | |||
\param property | \param property | |||
String object holding the name of a Propery. The property shou ld access a imageset & image specification. | String object holding the name of a Propery. The property shou ld access a imageset & image specification. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setImagePropertySource(const String& property); | void setImagePropertySource(const String& property); | |||
protected: | protected: | |||
// implemets abstract from base | // implemets abstract from base | |||
void render_impl(Window& srcWindow, Rect& destRect, float base_z, c onst CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay ) const; | void render_impl(Window& srcWindow, Rect& destRect, const CEGUI::Co lourRect* modColours, const Rect* clipper, bool clipToDisplay) const; | |||
const Image* d_image; //!< CEGUI::Image to be dra wn by this image component. | const Image* d_image; //!< CEGUI::Image to be dra wn by this image component. | |||
VerticalFormatting d_vertFormatting; //!< Vertical formatting to be applied when rendering the image component. | VerticalFormatting d_vertFormatting; //!< Vertical formatting to be applied when rendering the image component. | |||
HorizontalFormatting d_horzFormatting; //!< Horizontal formatting to be applied when rendering the image component. | HorizontalFormatting d_horzFormatting; //!< Horizontal formatting to be applied when rendering the image component. | |||
String d_imagePropertyName; //!< Name of the property t o access to obtain the image to be used. | String d_imagePropertyName; //!< Name of the property t o access to obtain the image to be used. | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIFalImageryComponent_h_ | #endif // end of guard _CEGUIFalImageryComponent_h_ | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIFalImagerySection.h | CEGUIFalImagerySection.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalImagerySection_h_ | #ifndef _CEGUIFalImagerySection_h_ | |||
#define _CEGUIFalImagerySection_h_ | #define _CEGUIFalImagerySection_h_ | |||
#include "falagard/CEGUIFalImageryComponent.h" | #include "CEGUIFalImageryComponent.h" | |||
#include "falagard/CEGUIFalTextComponent.h" | #include "CEGUIFalTextComponent.h" | |||
#include "falagard/CEGUIFalFrameComponent.h" | #include "CEGUIFalFrameComponent.h" | |||
#include "CEGUIXMLSerializer.h" | #include "../CEGUIXMLSerializer.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
skipping to change at line 73 | skipping to change at line 73 | |||
*/ | */ | |||
ImagerySection(const String& name); | ImagerySection(const String& name); | |||
/*! | /*! | |||
\brief | \brief | |||
Render the ImagerySection. | Render the ImagerySection. | |||
\param srcWindow | \param srcWindow | |||
Window object to be used when calculating pixel values from Bas eDim values. | Window object to be used when calculating pixel values from Bas eDim values. | |||
\param base_z | ||||
base z value to be used for all imagery in the section. | ||||
\param modColours | \param modColours | |||
ColourRect specifying colours to be modulated with the ImageryS ection's master colours. May be 0. | ColourRect specifying colours to be modulated with the ImageryS ection's master colours. May be 0. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, float base_z, const CEGUI::ColourRec t* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) con st; | void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Render the ImagerySection. | Render the ImagerySection. | |||
\param srcWindow | \param srcWindow | |||
Window object to be used when calculating pixel values from Bas eDim values. | Window object to be used when calculating pixel values from Bas eDim values. | |||
\param baseRect | \param baseRect | |||
Rect object to be used when calculating pixel values from BaseD im values. | Rect object to be used when calculating pixel values from BaseD im values. | |||
\param base_z | ||||
base z value to be used for all imagery in the section. | ||||
\param modColours | \param modColours | |||
ColourRect specifying colours to be modulated with the ImageryS ection's master colours. May be 0. | ColourRect specifying colours to be modulated with the ImageryS ection's master colours. May be 0. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, const Rect& baseRect, float base_z, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clip ToDisplay = false) const; | void render(Window& srcWindow, const Rect& baseRect, const CEGUI::C olourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = fa lse) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Add an ImageryComponent to this ImagerySection. | Add an ImageryComponent to this ImagerySection. | |||
\param img | \param img | |||
ImageryComponent to be added to the section (a copy is made) | ImageryComponent to be added to the section (a copy is made) | |||
\return | \return | |||
Nothing | Nothing | |||
End of changes. 5 change blocks. | ||||
12 lines changed or deleted | 6 lines changed or added | |||
CEGUIFalLayerSpecification.h | CEGUIFalLayerSpecification.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalLayerSpecification_h_ | #ifndef _CEGUIFalLayerSpecification_h_ | |||
#define _CEGUIFalLayerSpecification_h_ | #define _CEGUIFalLayerSpecification_h_ | |||
#include "falagard/CEGUIFalSectionSpecification.h" | #include "CEGUIFalSectionSpecification.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
skipping to change at line 66 | skipping to change at line 66 | |||
*/ | */ | |||
LayerSpecification(uint priority); | LayerSpecification(uint priority); | |||
/*! | /*! | |||
\brief | \brief | |||
Render this layer. | Render this layer. | |||
\param srcWindow | \param srcWindow | |||
Window to use when calculating pixel values from BaseDim values . | Window to use when calculating pixel values from BaseDim values . | |||
\param base_z | ||||
base level z value to use for all imagery in the layer. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, float base_z, const ColourRect* modc ols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | void render(Window& srcWindow, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Render this layer. | Render this layer. | |||
\param srcWindow | \param srcWindow | |||
Window to use when calculating pixel values from BaseDim values . | Window to use when calculating pixel values from BaseDim values . | |||
\param baseRect | \param baseRect | |||
Rect to use when calculating pixel values from BaseDim values. | Rect to use when calculating pixel values from BaseDim values. | |||
\param base_z | ||||
base level z value to use for all imagery in the layer. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, const Rect& baseRect, float base_z, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | void render(Window& srcWindow, const Rect& baseRect, const ColourRe ct* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const ; | |||
/*! | /*! | |||
\brief | \brief | |||
Add a section specification to the layer. | Add a section specification to the layer. | |||
A section specification is a reference to a named ImagerySectio n within the WidgetLook. | A section specification is a reference to a named ImagerySectio n within the WidgetLook. | |||
\param section | \param section | |||
SectionSpecification object descibing the section that should b e added to this layer. | SectionSpecification object descibing the section that should b e added to this layer. | |||
End of changes. 5 change blocks. | ||||
10 lines changed or deleted | 4 lines changed or added | |||
CEGUIFalNamedArea.h | CEGUIFalNamedArea.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalNamedArea_h_ | #ifndef _CEGUIFalNamedArea_h_ | |||
#define _CEGUIFalNamedArea_h_ | #define _CEGUIFalNamedArea_h_ | |||
#include "falagard/CEGUIFalDimensions.h" | #include "CEGUIFalDimensions.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
NamedArea defines an area for a component which may later be obtain ed | NamedArea defines an area for a component which may later be obtain ed | |||
and referenced by a name unique to the WidgetLook holding the Named Area. | and referenced by a name unique to the WidgetLook holding the Named Area. | |||
*/ | */ | |||
class CEGUIEXPORT NamedArea | class CEGUIEXPORT NamedArea | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFalPropertyDefinitionBase.h | CEGUIFalPropertyDefinitionBase.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalPropertyDefinitionBase_h_ | #ifndef _CEGUIFalPropertyDefinitionBase_h_ | |||
#define _CEGUIFalPropertyDefinitionBase_h_ | #define _CEGUIFalPropertyDefinitionBase_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
common base class used for types representing a new property to be | common base class used for types representing a new property to be | |||
available on all widgets that use the WidgetLook that the property | available on all widgets that use the WidgetLook that the property | |||
definition is a part of. | definition is a part of. | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFalPropertyInitialiser.h | CEGUIFalPropertyInitialiser.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalPropertyInitialiser_h_ | #ifndef _CEGUIFalPropertyInitialiser_h_ | |||
#define _CEGUIFalPropertyInitialiser_h_ | #define _CEGUIFalPropertyInitialiser_h_ | |||
#include "CEGUIPropertySet.h" | #include "../CEGUIPropertySet.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class that holds information about a property and it's required ini tial value. | Class that holds information about a property and it's required ini tial value. | |||
*/ | */ | |||
class CEGUIEXPORT PropertyInitialiser | class CEGUIEXPORT PropertyInitialiser | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFalPropertyLinkDefinition.h | CEGUIFalPropertyLinkDefinition.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalPropertyLinkDefinition_h_ | #ifndef _CEGUIFalPropertyLinkDefinition_h_ | |||
#define _CEGUIFalPropertyLinkDefinition_h_ | #define _CEGUIFalPropertyLinkDefinition_h_ | |||
#include "falagard/CEGUIFalPropertyDefinitionBase.h" | #include "CEGUIFalPropertyDefinitionBase.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class representing a property that links to another property define d on | Class representing a property that links to another property define d on | |||
an attached child widget. | an attached child widget. | |||
*/ | */ | |||
class CEGUIEXPORT PropertyLinkDefinition : public PropertyDefinitionBas e | class CEGUIEXPORT PropertyLinkDefinition : public PropertyDefinitionBas e | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFalSectionSpecification.h | CEGUIFalSectionSpecification.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalSectionSpecification_h_ | #ifndef _CEGUIFalSectionSpecification_h_ | |||
#define _CEGUIFalSectionSpecification_h_ | #define _CEGUIFalSectionSpecification_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "../CEGUIColourRect.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// forward refs | // forward refs | |||
class WidgetLookFeel; | class WidgetLookFeel; | |||
/*! | /*! | |||
\brief | \brief | |||
Class that represents a simple 'link' to an ImagerySection. | Class that represents a simple 'link' to an ImagerySection. | |||
skipping to change at line 91 | skipping to change at line 92 | |||
*/ | */ | |||
SectionSpecification(const String& owner, const String& sectionName , const String& controlPropertySource, const ColourRect& cols); | SectionSpecification(const String& owner, const String& sectionName , const String& controlPropertySource, const ColourRect& cols); | |||
/*! | /*! | |||
\brief | \brief | |||
Render the section specified by this SectionSpecification. | Render the section specified by this SectionSpecification. | |||
\param srcWindow | \param srcWindow | |||
Window object to be used when calculating pixel values from Bas eDim values. | Window object to be used when calculating pixel values from Bas eDim values. | |||
\param base_z | ||||
base z co-ordinate to use for all imagery in the linked section | ||||
. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, float base_z, const ColourRect* modc ols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | void render(Window& srcWindow, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Render the section specified by this SectionSpecification. | Render the section specified by this SectionSpecification. | |||
\param srcWindow | \param srcWindow | |||
Window object to be used when calculating pixel values from Bas eDim values. | Window object to be used when calculating pixel values from Bas eDim values. | |||
\param baseRect | \param baseRect | |||
Rect object to be used when calculating pixel values from BaseD im values. | Rect object to be used when calculating pixel values from BaseD im values. | |||
\param base_z | ||||
base z co-ordinate to use for all imagery in the linked section | ||||
. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void render(Window& srcWindow, const Rect& baseRect, float base_z, const ColourRect* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const; | void render(Window& srcWindow, const Rect& baseRect, const ColourRe ct* modcols = 0, const Rect* clipper = 0, bool clipToDisplay = false) const ; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the name of the WidgetLookFeel object containing the tar get section. | Return the name of the WidgetLookFeel object containing the tar get section. | |||
\return | \return | |||
String object holding the name of the WidgetLookFeel that conta ins the target ImagerySection. | String object holding the name of the WidgetLookFeel that conta ins the target ImagerySection. | |||
*/ | */ | |||
const String& getOwnerWidgetLookFeel() const; | const String& getOwnerWidgetLookFeel() const; | |||
End of changes. 5 change blocks. | ||||
11 lines changed or deleted | 4 lines changed or added | |||
CEGUIFalStateImagery.h | CEGUIFalStateImagery.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalStateImagery_h_ | #ifndef _CEGUIFalStateImagery_h_ | |||
#define _CEGUIFalStateImagery_h_ | #define _CEGUIFalStateImagery_h_ | |||
#include "falagard/CEGUIFalLayerSpecification.h" | #include "CEGUIFalLayerSpecification.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include <set> | #include <set> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIFalTextComponent.h | CEGUIFalTextComponent.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalTextComponent_h_ | #ifndef _CEGUIFalTextComponent_h_ | |||
#define _CEGUIFalTextComponent_h_ | #define _CEGUIFalTextComponent_h_ | |||
#include "falagard/CEGUIFalComponentBase.h" | #include "CEGUIFalComponentBase.h" | |||
#include "../CEGUIRenderedString.h" | ||||
#include "../CEGUIRefCounted.h" | ||||
#include "../CEGUIFormattedRenderedString.h" | ||||
#if defined(_MSC_VER) | ||||
# pragma warning(push) | ||||
# pragma warning(disable : 4251) | ||||
#endif | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class that encapsulates information for a text component. | Class that encapsulates information for a text component. | |||
*/ | */ | |||
class CEGUIEXPORT TextComponent : public FalagardComponentBase | class CEGUIEXPORT TextComponent : public FalagardComponentBase | |||
{ | { | |||
skipping to change at line 58 | skipping to change at line 66 | |||
/*! | /*! | |||
\brief | \brief | |||
Return the text object that will be rendered by this TextCompon ent. | Return the text object that will be rendered by this TextCompon ent. | |||
\return | \return | |||
String object containing the text that will be rendered. | String object containing the text that will be rendered. | |||
*/ | */ | |||
const String& getText() const; | const String& getText() const; | |||
//! return text string with \e visual ordering of glyphs. | ||||
const String& getTextVisual() const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the text that will be rendered by this TextComponent. | Set the text that will be rendered by this TextComponent. | |||
Note that setting this to the empty string ("") will cause the text from the | Note that setting this to the empty string ("") will cause the text from the | |||
base window passed when rendering to be used instead. | base window passed when rendering to be used instead. | |||
\param text | \param text | |||
String containing text to render, or "" to render text from win dow. | String containing text to render, or "" to render text from win dow. | |||
skipping to change at line 219 | skipping to change at line 230 | |||
\param property | \param property | |||
String object holding the name of a Propery. The property shou ld access a valid font name. | String object holding the name of a Propery. The property shou ld access a valid font name. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setFontPropertySource(const String& property); | void setFontPropertySource(const String& property); | |||
protected: | protected: | |||
// implemets abstract from base | // implemets abstract from base | |||
void render_impl(Window& srcWindow, Rect& destRect, float base_z, c | void render_impl(Window& srcWindow, Rect& destRect, const CEGUI::Co | |||
onst CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay | lourRect* modColours, const Rect* clipper, bool clipToDisplay) const; | |||
) const; | //! helper to set up an appropriate FormattedRenderedString | |||
void setupStringFormatter(const Window& window, | ||||
const RenderedString& rendered_string) co | ||||
nst; | ||||
private: | private: | |||
String d_text; //!< text rendered by this | String d_textLogical; //!< text rendered b | |||
component. | y this component. | |||
//! pointer to bidirection support object | ||||
BiDiVisualMapping* d_bidiVisualMapping; | ||||
//! whether bidi visual mapping has been updated since last text ch | ||||
ange. | ||||
mutable bool d_bidiDataValid; | ||||
//! RenderedString used when not using the one from the target Wind | ||||
ow. | ||||
mutable RenderedString d_renderedString; | ||||
//! FormattedRenderedString object that applies formatting to the s | ||||
tring | ||||
mutable RefCounted<FormattedRenderedString> d_formattedRenderedStri | ||||
ng; | ||||
//! Tracks last used horizontal formatting (in order to detect chan | ||||
ges) | ||||
mutable HorizontalTextFormatting d_lastHorzFormatting; | ||||
String d_font; //!< name of font to use. | String d_font; //!< name of font to use. | |||
VerticalTextFormatting d_vertFormatting; //!< Vertical formattin g to be applied when rendering the component. | VerticalTextFormatting d_vertFormatting; //!< Vertical formattin g to be applied when rendering the component. | |||
HorizontalTextFormatting d_horzFormatting; //!< Horizontal formatt ing to be applied when rendering the component. | HorizontalTextFormatting d_horzFormatting; //!< Horizontal formatt ing to be applied when rendering the component. | |||
String d_textPropertyName; //!< Name of the property t o access to obtain the text string to render. | String d_textPropertyName; //!< Name of the property t o access to obtain the text string to render. | |||
String d_fontPropertyName; //!< Name of the property t o access to obtain the font to use for rendering. | String d_fontPropertyName; //!< Name of the property t o access to obtain the font to use for rendering. | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | ||||
# pragma warning(pop) | ||||
#endif | ||||
#endif // end of guard _CEGUIFalTextComponent_h_ | #endif // end of guard _CEGUIFalTextComponent_h_ | |||
End of changes. 5 change blocks. | ||||
7 lines changed or deleted | 40 lines changed or added | |||
CEGUIFalWidgetComponent.h | CEGUIFalWidgetComponent.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalWidgetComponent_h_ | #ifndef _CEGUIFalWidgetComponent_h_ | |||
#define _CEGUIFalWidgetComponent_h_ | #define _CEGUIFalWidgetComponent_h_ | |||
#include "falagard/CEGUIFalDimensions.h" | #include "CEGUIFalDimensions.h" | |||
#include "falagard/CEGUIFalPropertyInitialiser.h" | #include "CEGUIFalPropertyInitialiser.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIFalWidgetLookFeel.h | CEGUIFalWidgetLookFeel.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalWidgetLookFeel_h_ | #ifndef _CEGUIFalWidgetLookFeel_h_ | |||
#define _CEGUIFalWidgetLookFeel_h_ | #define _CEGUIFalWidgetLookFeel_h_ | |||
#include "falagard/CEGUIFalStateImagery.h" | #include "CEGUIFalStateImagery.h" | |||
#include "falagard/CEGUIFalWidgetComponent.h" | #include "CEGUIFalWidgetComponent.h" | |||
#include "falagard/CEGUIFalImagerySection.h" | #include "CEGUIFalImagerySection.h" | |||
#include "falagard/CEGUIFalPropertyInitialiser.h" | #include "CEGUIFalPropertyInitialiser.h" | |||
#include "falagard/CEGUIFalPropertyDefinition.h" | #include "CEGUIFalPropertyDefinition.h" | |||
#include "falagard/CEGUIFalPropertyLinkDefinition.h" | #include "CEGUIFalPropertyLinkDefinition.h" | |||
#include "falagard/CEGUIFalNamedArea.h" | #include "CEGUIFalNamedArea.h" | |||
#include <map> | #include <map> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added | |||
CEGUIFalWidgetLookManager.h | CEGUIFalWidgetLookManager.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalWidgetLookManager_h_ | #ifndef _CEGUIFalWidgetLookManager_h_ | |||
#define _CEGUIFalWidgetLookManager_h_ | #define _CEGUIFalWidgetLookManager_h_ | |||
#include "CEGUISingleton.h" | #include "../CEGUISingleton.h" | |||
#include "CEGUIString.h" | #include "../CEGUIString.h" | |||
#include "CEGUIExceptions.h" | #include "../CEGUIExceptions.h" | |||
#include "falagard/CEGUIFalWidgetLookFeel.h" | #include "CEGUIFalWidgetLookFeel.h" | |||
#include <map> | #include <map> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIFalXMLEnumHelper.h | CEGUIFalXMLEnumHelper.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFalXMLEnumHelper_h_ | #ifndef _CEGUIFalXMLEnumHelper_h_ | |||
#define _CEGUIFalXMLEnumHelper_h_ | #define _CEGUIFalXMLEnumHelper_h_ | |||
#include "CEGUIString.h" | #include "../CEGUIString.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "falagard/CEGUIFalEnums.h" | #include "CEGUIFalEnums.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Utility helper class primarily intended for use by the falagard xml parser. | Utility helper class primarily intended for use by the falagard xml parser. | |||
*/ | */ | |||
class CEGUIEXPORT FalagardXMLHelper | class CEGUIEXPORT FalagardXMLHelper | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIFont.h | CEGUIFont.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIFont.h | filename: CEGUIFont.h | |||
created: 21/2/2004 | created: 21/2/2004 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines interface for the Font class | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 36 | skipping to change at line 34 | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFont_h_ | #ifndef _CEGUIFont_h_ | |||
#define _CEGUIFont_h_ | #define _CEGUIFont_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIPropertySet.h" | #include "CEGUIPropertySet.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUIRect.h" | ||||
#include "CEGUIVector.h" | ||||
#include "CEGUIColourRect.h" | ||||
#include "CEGUIXMLSerializer.h" | #include "CEGUIXMLSerializer.h" | |||
#include "CEGUIImage.h" | #include "CEGUIFontGlyph.h" | |||
#include <map> | #include <map> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Forward declarations for font properties | ||||
namespace FontProperties | ||||
{ | ||||
class NativeRes; | ||||
class Name; | ||||
class FileName; | ||||
class ResourceGroup; | ||||
class AutoScaled; | ||||
} | ||||
/*! | ||||
\brief | ||||
Enumerated type that contains valid formatting types that can be specif | ||||
ied when rendering text into a Rect area (the formatting Rect). | ||||
*/ | ||||
enum TextFormatting | ||||
{ | ||||
/// All text is printed on a single line. The left-most character is a | ||||
ligned with the left edge of the formatting Rect. | ||||
LeftAligned, | ||||
/// All text is printed on a single line. The right-most character is | ||||
aligned with the right edge of the formatting Rect. | ||||
RightAligned, | ||||
/// All text is printed on a single line. The text is centred horizont | ||||
ally in the formatting Rect. | ||||
Centred, | ||||
/// All text is printed on a single line. The left-most and right-most | ||||
characters are aligned with the edges of the formatting Rect. | ||||
Justified, | ||||
/// Text is broken into multiple lines no wider than the formatting Rec | ||||
t. The left-most character of each line is aligned with the left edge of t | ||||
he formatting Rect. | ||||
WordWrapLeftAligned, | ||||
/// Text is broken into multiple lines no wider than the formatting Rec | ||||
t. The right-most character of each line is aligned with the right edge of | ||||
the formatting Rect. | ||||
WordWrapRightAligned, | ||||
/// Text is broken into multiple lines no wider than the formatting Rec | ||||
t. Each line is centred horizontally in the formatting Rect. | ||||
WordWrapCentred, | ||||
/// Text is broken into multiple lines no wider than the formatting Rec | ||||
t. The left-most and right-most characters of each line are aligned with t | ||||
he edges of the formatting Rect. | ||||
WordWrapJustified | ||||
}; | ||||
/*! | ||||
\brief | ||||
internal class representing a single font glyph. | ||||
For TrueType fonts initially all FontGlyph's are empty | ||||
(getImage() will return NULL), but they are filled by demand. | ||||
*/ | ||||
class FontGlyph | ||||
{ | ||||
private: | ||||
/// The image which will be rendered. | ||||
const Image* d_image; | ||||
/// Amount to advance the pen after rendering this glyph | ||||
float d_advance; | ||||
public: | ||||
/*! | ||||
\brief | ||||
construct an empty uninitialized FontGlyph | ||||
*/ | ||||
FontGlyph () | ||||
{ } | ||||
/*! | ||||
\brief | ||||
FontGlyph constructor. | ||||
*/ | ||||
FontGlyph (float advance) : d_image (0), d_advance (advance) | ||||
{ } | ||||
/*! | ||||
\brief | ||||
A better :-) FontGlyph constructor. | ||||
*/ | ||||
FontGlyph (float advance, const Image *image) : d_image (image), d_adva | ||||
nce (advance) | ||||
{ } | ||||
/*! | ||||
\brief | ||||
Return the CEGUI::Image object rendered for this glyph. | ||||
*/ | ||||
const Image* getImage () const | ||||
{ return d_image; } | ||||
/*! | ||||
\brief | ||||
Return the parent CEGUI::Imageset object for this glyph. | ||||
*/ | ||||
const Imageset* getImageset () const | ||||
{ return d_image->getImageset (); } | ||||
/*! | ||||
\brief | ||||
Return the scaled pixel size of the glyph. | ||||
*/ | ||||
Size getSize (float x_scale, float y_scale) const | ||||
{ return Size (getWidth (x_scale), getHeight (y_scale)); } | ||||
/*! | ||||
\brief | ||||
Return the scaled widht of the glyph. | ||||
*/ | ||||
float getWidth (float x_scale) const | ||||
{ return d_image->getWidth () * x_scale; } | ||||
/*! | ||||
\brief | ||||
Return the scaled height of the glyph. | ||||
*/ | ||||
float getHeight (float y_scale) const | ||||
{ return d_image->getHeight () * y_scale; } | ||||
/*! | ||||
\brief | ||||
Return the rendered advance value for this glyph. | ||||
The rendered advance value is the total number of pixels from the | ||||
current pen position that will be occupied by this glyph when rende | ||||
red. | ||||
*/ | ||||
float getRenderedAdvance (float x_scale) const | ||||
{ return (d_image->getWidth () + d_image->getOffsetX ()) * x_scale; } | ||||
/*! | ||||
\brief | ||||
Return the horizontal advance value for the glyph. | ||||
The returned value is the number of pixels the pen should move | ||||
horizontally to position itself ready to render the next glyph. Th | ||||
is | ||||
is not always the same as the glyph image width or rendererd advanc | ||||
e, | ||||
since it allows for horizontal overhangs. | ||||
*/ | ||||
float getAdvance (float x_scale = 1.0) const | ||||
{ return d_advance * x_scale; } | ||||
/*! | ||||
\brief | ||||
Set the horizontal advance value for the glyph. | ||||
*/ | ||||
void setAdvance (float advance) | ||||
{ d_advance = advance; } | ||||
/*! | ||||
\brief | ||||
Set the CEGUI::Image object rendered for this glyph. | ||||
*/ | ||||
void setImage (const Image* image) | ||||
{ d_image = image; } | ||||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
Class that encapsulates text rendering functionality for a typeface | Class that encapsulates a typeface. | |||
A Font object is created for each unique typeface required. | A Font object is created for each unique typeface required. | |||
The Font class provides methods for loading typefaces from various sour ces, | The Font class provides methods for loading typefaces from various sour ces, | |||
and then for outputting text via the Renderer object. | and then for outputting text via the Renderer object. | |||
This class is not specific to any font renderer, it just provides the | This class is not specific to any font renderer, it just provides the | |||
basic interfaces needed to manage fonts. | basic interfaces needed to manage fonts. | |||
*/ | */ | |||
class CEGUIEXPORT Font : public PropertySet | class CEGUIEXPORT Font : public PropertySet | |||
{ | { | |||
protected: | ||||
/********************************************************************** | ||||
*** | ||||
Friends so that only FontManager can create and destroy font object | ||||
s | ||||
*********************************************************************** | ||||
**/ | ||||
friend class FontManager; | ||||
friend class Font_xmlHandler; | ||||
friend class FontProperties::NativeRes; | ||||
friend class FontProperties::Name; | ||||
friend class FontProperties::FileName; | ||||
friend class FontProperties::ResourceGroup; | ||||
friend class FontProperties::AutoScaled; | ||||
/********************************************************************** | ||||
*** | ||||
Implementation Data | ||||
*********************************************************************** | ||||
**/ | ||||
typedef std::map<utf32, FontGlyph> CodepointMap; | ||||
/// Contains mappings from code points to Image objects | ||||
CodepointMap d_cp_map; | ||||
/// Name of this font. | ||||
String d_name; | ||||
/// Holds the name of the file used to create this font (either font fi | ||||
le or imagset) | ||||
String d_fileName; | ||||
/// Holds the name of the font file's resource group | ||||
String d_resourceGroup; | ||||
/// hold default resource group for font loading. | ||||
static String d_defaultResourceGroup; | ||||
/// maximal font ascender (pixels above the baseline) | ||||
float d_ascender; | ||||
/// maximal font descender (negative pixels below the baseline) | ||||
float d_descender; | ||||
/// (ascender - descender) + linegap | ||||
float d_height; | ||||
/// true when auto-scaling is enabled. | ||||
bool d_autoScale; | ||||
/// current horizontal scaling factor. | ||||
float d_horzScaling; | ||||
/// current vertical scaling factor. | ||||
float d_vertScaling; | ||||
/// native horizontal resolution for this Imageset. | ||||
float d_nativeHorzRes; | ||||
/// native vertical resolution for this Imageset. | ||||
float d_nativeVertRes; | ||||
/// Maximal codepoint for font glyphs | ||||
utf32 d_maxCodepoint; | ||||
/*! | ||||
\brief | ||||
This bitmap holds information about loaded 'pages' of glyphs. | ||||
A glyph page is a set of 256 codepoints, starting at 256-multiples. | ||||
For example, the 1st glyph page is 0-255, fourth is 1024-1279 etc. | ||||
When a specific glyph is required for painting, the corresponding | ||||
bit is checked to see if the respective page has been rasterized. | ||||
If not, the rasterize() method is invoked, which prepares the | ||||
glyphs from the respective glyph page for being painted. | ||||
This array is big enough to hold at least max_codepoint bits. | ||||
If this member is NULL, all glyphs are considered pre-rasterized. | ||||
*/ | ||||
uint *d_glyphPageLoaded; | ||||
/********************************************************************** | ||||
*** | ||||
Construction & Destruction | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
Constructs a new semi-complete Font object. It is the | ||||
responsability of the user to set up all remaining font | ||||
parameters after constructing the Font object, and finally | ||||
calling the load() method which will make font available for use. | ||||
All font parameters that are not initialized are set to sensible | ||||
default values. | ||||
\param name | ||||
The unique name that will be used to identify this Font. | ||||
\param fontname | ||||
The filename of the font file, which contains the font data. | ||||
This can be a TrueType, PostScript, bitmap font etc file. | ||||
\param resourceGroup | ||||
Resource group identifier to be passed to the resource provider | ||||
to load the font definition file. | ||||
*/ | ||||
Font (const String& name, const String& fontname, | ||||
const String& resourceGroup = ""); | ||||
/*! | ||||
\brief | ||||
Constructs a new Font object and instantly loads it. | ||||
The font is ready for use right after creation, there is no | ||||
need to load() it. All data required by this font is loaded | ||||
from the provided XMLAttributes object. | ||||
\param attributes | ||||
The XML attributes attached to this Font. | ||||
\exception FileIOException | ||||
thrown if there was some problem accessing or parsing the file | ||||
\a filename | ||||
\exception InvalidRequestException | ||||
thrown if an invalid filename was provided. | ||||
\exception AlreadyExistsException | ||||
thrown if a Font Imageset clashes with one already defined in the | ||||
system. | ||||
\exception GenericException | ||||
thrown if something goes wrong while accessing a true-type font | ||||
referenced in file \a filename. | ||||
\exception RendererException | ||||
thrown if the Renderer can't support a texture large enough to | ||||
hold the requested glyph imagery. | ||||
\exception MemoryException | ||||
thrown if allocation of imagery construction buffer fails. | ||||
*/ | ||||
Font (const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Destroys a Font object | ||||
*/ | ||||
virtual ~Font (); | ||||
/*! | ||||
\brief | ||||
Define a glyph mapping (handle a <Mapping /> XML element) | ||||
*/ | ||||
virtual void defineMapping (const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Update the font as required according to the current parameters | ||||
*/ | ||||
virtual void updateFont () = 0; | ||||
/*! | ||||
\brief | ||||
draws wrapped text. returns number of lines output. | ||||
*/ | ||||
size_t drawWrappedText (const String& text, const Rect& draw_area, floa | ||||
t z, const Rect& clip_rect, TextFormatting fmt, const ColourRect& colours, | ||||
float x_scale = 1.0f, float y_scale = 1.0f); | ||||
/*! | ||||
\brief | ||||
helper function for renderWrappedText to get next word of a string | ||||
*/ | ||||
size_t getNextWord (const String& in_string, size_t start_idx, String& | ||||
out_string) const; | ||||
/*! | ||||
\brief | ||||
Draw a line of text. No formatting is applied. | ||||
*/ | ||||
void drawTextLine (const String& text, const Vector3& position, const R | ||||
ect& clip_rect, const ColourRect& colours, float x_scale = 1.0f, float y_sc | ||||
ale = 1.0f); | ||||
/*! | ||||
\brief | ||||
Draw a justified line of text. | ||||
*/ | ||||
void drawTextLineJustified (const String& text, const Rect& draw_area, | ||||
const Vector3& position, const Rect& clip_rect, const ColourRect& colours, | ||||
float x_scale = 1.0f, float y_scale = 1.0f); | ||||
/*! | ||||
\brief | ||||
returns extent of widest line of wrapped text. | ||||
*/ | ||||
float getWrappedTextExtent (const String& text, float wrapWidth, float | ||||
x_scale = 1.0f); | ||||
/*! | ||||
\brief | ||||
Return a pointer to the glyphDat struct for the given codepoint, | ||||
or 0 if the codepoint does not have a glyph defined. | ||||
\param codepoint | ||||
utf32 codepoint to return the glyphDat structure for. | ||||
\return | ||||
Pointer to the glyphDat struct for \a codepoint, or 0 if no glyph | ||||
is defined for \a codepoint. | ||||
*/ | ||||
const FontGlyph* getGlyphData (utf32 codepoint); | ||||
/*! | ||||
\brief | ||||
Set the maximal glyph index. This reserves the respective | ||||
number of bits in the d_glyphPageLoaded array. | ||||
*/ | ||||
void setMaxCodepoint (utf32 codepoint); | ||||
/*! | ||||
\brief | ||||
This function prepares a certain range of glyphs to be ready for | ||||
displaying. This means that after returning from this function | ||||
glyphs from d_cp_map[start_codepoint] to d_cp_map[end_codepoint] | ||||
should have their d_image member set. If there is an error | ||||
during rasterization of some glyph, it's okay to leave the | ||||
d_image field set to NULL, in which case such glyphs will | ||||
be skipped from display. | ||||
\param start_codepoint | ||||
The lowest codepoint that should be rasterized | ||||
\param end_codepoint | ||||
The highest codepoint that should be rasterized | ||||
*/ | ||||
virtual void rasterize (utf32 start_codepoint, utf32 end_codepoint); | ||||
/*! | ||||
\brief | ||||
Writes an xml representation of this Font to \a out_stream. | ||||
\param xml_stream | ||||
Stream where xml data should be output. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void writeXMLToStream (XMLSerializer& xml_stream) const; | ||||
/*! | ||||
\brief | ||||
Same as writeXMLToStream() but called from inside writeXMLToStream( | ||||
) | ||||
so that derived classes may add their own attributes to stream. | ||||
\param xml_stream | ||||
Stream where xml data should be output. | ||||
*/ | ||||
virtual void writeXMLToStream_impl (XMLSerializer& xml_stream) const = | ||||
0; | ||||
/*! | ||||
\brief | ||||
Register all properties of this class. | ||||
*/ | ||||
void addFontProperties (); | ||||
public: | public: | |||
/// Colour value used whenever a colour is not specified. | //! Colour value used whenever a colour is not specified. | |||
static const argb_t DefaultColour; | static const argb_t DefaultColour; | |||
/*! | //! Destructor. | |||
\brief | virtual ~Font(); | |||
Complete font loading. If you create the font from an XML file, | ||||
this method is invoked automatically after reading all the required | //! Return the string holding the font name. | |||
data from the XMLAttributes object. If you create the font manually | const String& getName() const; | |||
, | ||||
it is your responsability to call this function as soon as you | //! Return the type of the font. | |||
set up all the appropiate fields of the Font object. | const String& getTypeName() const; | |||
*/ | ||||
virtual void load () = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether this Font can draw the specified code-point | Return whether this Font can draw the specified code-point | |||
\param cp | \param cp | |||
utf32 code point that is the subject of the query. | utf32 code point that is the subject of the query. | |||
\return | \return | |||
true if the font contains a mapping for code point \a cp, | true if the font contains a mapping for code point \a cp, | |||
false if it does not contain a mapping for \a cp. | false if it does not contain a mapping for \a cp. | |||
*/ | */ | |||
bool isCodepointAvailable (utf32 cp) const | bool isCodepointAvailable(utf32 cp) const | |||
{ return (d_cp_map.find(cp) != d_cp_map.end()); } | { return (d_cp_map.find(cp) != d_cp_map.end()); } | |||
/********************************************************************** | ||||
*** | ||||
Text drawing methods | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | /*! | |||
\brief | \brief | |||
Draw text into a specified area of the display. | Draw text into a specified area of the display. | |||
\param text | \param buffer | |||
String object containing the text to be drawn. | GeometryBuffer object where the geometry for the text be queued. | |||
\param draw_area | ||||
Rect object describing the area of the display where the text is to | ||||
be rendered. The text is not clipped to this Rect, but is formatted | ||||
using this Rect depending upon the option specified in \a fmt. | ||||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param clip_rect | ||||
Rect object describing the clipping area for the drawing. No drawi | ||||
ng will occur outside this Rect. | ||||
\param fmt | ||||
One of the TextFormatting values specifying the text formatting req | ||||
uired. | ||||
\param colours | ||||
ColourRect object describing the colours to be applied when drawing | ||||
the text. NB: The colours specified in here are applied to each glyph, | ||||
rather than the text as a whole. | ||||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | ||||
The number of lines output. NB: This does not consider clipping, s | ||||
o if all text was clipped, this would still return >=1. | ||||
*/ | ||||
size_t drawText (const String& text, const Rect& draw_area, float z, co | ||||
nst Rect& clip_rect, TextFormatting fmt, const ColourRect& colours, float x | ||||
_scale = 1.0f, float y_scale = 1.0f); | ||||
/*! | ||||
\brief | ||||
Draw text into a specified area of the display using default colour | ||||
s. | ||||
\param text | ||||
String object containing the text to be drawn. | ||||
\param draw_area | ||||
Rect object describing the area of the display where the text is to | ||||
be rendered. The text is not clipped to this Rect, but is formatted | ||||
using this Rect depending upon the option specified in \a fmt. | ||||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param clip_rect | ||||
Rect object describing the clipping area for the drawing. No drawi | ||||
ng will occur outside this Rect. | ||||
\param fmt | ||||
One of the TextFormatting values specifying the text formatting req | ||||
uired. | ||||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | ||||
The number of lines output. NB: This does not consider clipping, s | ||||
o if all text was clipped, this would still return >=1. | ||||
*/ | ||||
size_t drawText (const String& text, const Rect& draw_area, float z, co | ||||
nst Rect& clip_rect, TextFormatting fmt, float x_scale = 1.0f, float y_scal | ||||
e = 1.0f) | ||||
{ return drawText (text, draw_area, z, clip_rect, fmt, ColourRect (Defa | ||||
ultColour, DefaultColour, DefaultColour, DefaultColour), x_scale, y_scale); | ||||
} | ||||
/*! | ||||
\brief | ||||
Draw text into a specified area of the display with default colours | ||||
and default formatting (LeftAligned). | ||||
\param text | \param text | |||
String object containing the text to be drawn. | String object containing the text to be drawn. | |||
\param draw_area | \param position | |||
Rect object describing the area of the display where the text is to | Reference to a Vector2 object describing the location at which the | |||
be rendered. The text is not clipped to this Rect, but is formatted | text | |||
using this Rect depending upon the option specified in \a fmt. | is to be drawn. | |||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param clip_rect | \param clip_rect | |||
Rect object describing the clipping area for the drawing. No drawi | Rect object describing the clipping area for the drawing. | |||
ng will occur outside this Rect. | No drawing will occur outside this Rect. | |||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void drawText (const String& text, const Rect& draw_area, float z, cons | ||||
t Rect& clip_rect, float x_scale = 1.0f, float y_scale = 1.0f) | ||||
{ drawText (text, draw_area, z, clip_rect, LeftAligned, ColourRect (Def | ||||
aultColour, DefaultColour, DefaultColour, DefaultColour), x_scale, y_scale) | ||||
; } | ||||
/*! | ||||
\brief | ||||
Draw text into a specified area of the display. | ||||
\param text | ||||
String object containing the text to be drawn. | ||||
\param draw_area | ||||
Rect object describing the area of the display where the text is to | ||||
be rendered. The text is formatted using this Rect depending | ||||
upon the option specified in \a fmt. Additionally, the drawn text | ||||
is clipped to be within this Rect (applies to non-word wrapped formatting | ||||
where the text may otherwise have fallen outside this Rect). | ||||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param fmt | ||||
One of the TextFormatting values specifying the text formatting req | ||||
uired. | ||||
\param colours | \param colours | |||
ColourRect object describing the colours to be applied when drawing | ColourRect object describing the colours to be applied when drawing | |||
the text. NB: The colours specified in here are applied to each glyph, | the | |||
text. NB: The colours specified in here are applied to each glyph, | ||||
rather than the text as a whole. | rather than the text as a whole. | |||
\param x_scale | \param space_extra | |||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | Number of additional pixels of spacing to be added to space charact | |||
considered to be 'normal'. | ers. | |||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | ||||
The number of lines output. NB: This does not consider clipping, s | ||||
o if all text was clipped, this would still return >=1. | ||||
*/ | ||||
size_t drawText (const String& text, const Rect& draw_area, float z, Te | ||||
xtFormatting fmt, const ColourRect& colours, float x_scale = 1.0f, float y_ | ||||
scale = 1.0f) | ||||
{ return drawText (text, draw_area, z, draw_area, fmt, colours, x_scale | ||||
, y_scale); } | ||||
/*! | ||||
\brief | ||||
Draw text into a specified area of the display with default colours | ||||
. | ||||
\param text | ||||
String object containing the text to be drawn. | ||||
\param draw_area | ||||
Rect object describing the area of the display where the text is to | ||||
be rendered. The text is formatted using this Rect depending | ||||
upon the option specified in \a fmt. Additionally, the drawn text | ||||
is clipped to be within this Rect (applies to non-word wrapped formatting | ||||
where the text may otherwise have fallen outside this Rect). | ||||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param fmt | ||||
One of the TextFormatting values specifying the text formatting req | ||||
uired. | ||||
\param x_scale | \param x_scale | |||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | Scaling factor to be applied to each glyph's x axis, where 1.0f is | |||
considered to be 'normal'. | considered to be 'normal'. | |||
\param y_scale | \param y_scale | |||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | Scaling factor to be applied to each glyph's y axis, where 1.0f is | |||
considered to be 'normal'. | considered to be 'normal'. | |||
\return | \return | |||
The number of lines output. NB: This does not consider clipping, s o if all text was clipped, this would still return >=1. | Nothing. | |||
*/ | */ | |||
size_t drawText (const String& text, const Rect& draw_area, float z, Te | void drawText(GeometryBuffer& buffer, const String& text, | |||
xtFormatting fmt, float x_scale = 1.0f, float y_scale = 1.0f) | const Vector2& position, const Rect* clip_rect, | |||
{ return drawText (text, draw_area, z, draw_area, fmt, ColourRect (Defa | const ColourRect& colours, const float space_extra = 0.0f | |||
ultColour, DefaultColour, DefaultColour, DefaultColour), x_scale, y_scale); | , | |||
} | const float x_scale = 1.0f, const float y_scale = 1.0f); | |||
/*! | /*! | |||
\brief | \brief | |||
Draw text into a specified area of the display with default colours | Set the native resolution for this Font | |||
and default formatting (LeftAligned). | ||||
\param text | ||||
String object containing the text to be drawn. | ||||
\param draw_area | ||||
Rect object describing the area of the display where the text is to | ||||
be rendered. The text is formatted using this Rect depending | ||||
upon the option specified in \a fmt. Additionally, the drawn text | ||||
is clipped to be within this Rect (applies to non-word wrapped formatting | ||||
where the text may otherwise have fallen outside this Rect). | ||||
\param z | ||||
flat value specifying the z co-ordinate for the drawn text. | ||||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | \param size | |||
Nothing. | Size object describing the new native screen resolution for this Fo | |||
nt. | ||||
*/ | */ | |||
void drawText (const String& text, const Rect& draw_area, float z, floa | void setNativeResolution(const Size& size); | |||
t x_scale = 1.0f, float y_scale = 1.0f) | ||||
{ drawText (text, draw_area, z, draw_area, LeftAligned, ColourRect (Def | ||||
aultColour, DefaultColour, DefaultColour, DefaultColour), x_scale, y_scale) | ||||
; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Draw text at the specified location. | Return the native display size for this Font. This is only relevan | |||
t if | ||||
\param text | the Font is being auto-scaled. | |||
String object containing the text to be drawn. | ||||
\param position | ||||
Vector3 object describing the location for the text. NB: The posit | ||||
ion specified here corresponds to the text baseline and not the | ||||
top of any glyph. The baseline spacing required can be retrieved b | ||||
y calling getBaseline(). | ||||
\param clip_rect | ||||
Rect object describing the clipping area for the drawing. No drawi | ||||
ng will occur outside this Rect. | ||||
\param colours | ||||
ColourRect object describing the colours to be applied when drawing | ||||
the text. NB: The colours specified in here are applied to each glyph, | ||||
rather than the text as a whole. | ||||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | \return | |||
Nothing. | Size object describing the native display size for this Font. | |||
*/ | */ | |||
void drawText (const String& text, const Vector3& position, const Rect& | Size getNativeResolution() const; | |||
clip_rect, const ColourRect& colours, float x_scale = 1.0f, float y_scale | ||||
= 1.0f) | ||||
{ drawText (text, Rect (position.d_x, position.d_y, position.d_x, posit | ||||
ion.d_y), position.d_z, clip_rect, LeftAligned, colours, x_scale, y_scale); | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
Draw text at the specified location with default colours. | Enable or disable auto-scaling for this Font. | |||
\param text | ||||
String object containing the text to be drawn. | ||||
\param position | ||||
Vector3 object describing the location for the text. NB: The posit | ||||
ion specified here corresponds to the text baseline and not the | ||||
top of any glyph. The baseline spacing required can be retrieved b | ||||
y calling getBaseline(). | ||||
\param clip_rect | ||||
Rect object describing the clipping area for the drawing. No drawi | ||||
ng will occur outside this Rect. | ||||
\param x_scale | ||||
Scaling factor to be applied to each glyph's x axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\param y_scale | ||||
Scaling factor to be applied to each glyph's y axis, where 1.0f is | ||||
considered to be 'normal'. | ||||
\return | \param auto_scaled | |||
Nothing. | - true to enable auto-scaling. | |||
- false to disable auto-scaling. | ||||
*/ | */ | |||
void drawText (const String& text, const Vector3& position, const Rect& | void setAutoScaled(const bool auto_scaled); | |||
clip_rect, float x_scale = 1.0f, float y_scale = 1.0f) | ||||
{ drawText (text, Rect (position.d_x, position.d_y, position.d_x, posit | ||||
ion.d_y), position.d_z, clip_rect, LeftAligned, ColourRect(DefaultColour, D | ||||
efaultColour, DefaultColour, DefaultColour), x_scale, y_scale); } | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the native resolution for this Font | Return whether this Font is auto-scaled. | |||
\param size | ||||
Size object describing the new native screen resolution for this Fo | ||||
nt. | ||||
\return | \return | |||
Nothing | - true if Font is auto-scaled. | |||
- false if Font is not auto-scaled. | ||||
*/ | */ | |||
virtual void setNativeResolution (const Size& size); | bool isAutoScaled() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Notify the Font of the current (usually new) display resolution. | Notify the Font that the display size may have changed. | |||
\param size | \param size | |||
Size object describing the display resolution | Size object describing the display resolution | |||
\return | ||||
Nothing | ||||
*/ | */ | |||
virtual void notifyScreenResolution (const Size& size); | virtual void notifyDisplaySizeChanged(const Size& size); | |||
/********************************************************************** | ||||
*** | ||||
Informational methods | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the pixel line spacing value for. | Return the pixel line spacing value for. | |||
\param y_scale | \param y_scale | |||
Scaling factor to be applied to the line spacing, where 1.0f | Scaling factor to be applied to the line spacing, where 1.0f | |||
is considered to be 'normal'. | is considered to be 'normal'. | |||
\return | \return | |||
Number of pixels between vertical base lines, i.e. The minimum | Number of pixels between vertical base lines, i.e. The minimum | |||
pixel space between two lines of text. | pixel space between two lines of text. | |||
*/ | */ | |||
float getLineSpacing (float y_scale = 1.0f) const | float getLineSpacing(float y_scale = 1.0f) const | |||
{ return d_height * y_scale; } | { return d_height * y_scale; } | |||
/*! | /*! | |||
\brief | \brief | |||
return the exact pixel height of the font. | return the exact pixel height of the font. | |||
\param y_scale | \param y_scale | |||
Scaling factor to be applied to the height, where 1.0f | Scaling factor to be applied to the height, where 1.0f | |||
is considered to be 'normal'. | is considered to be 'normal'. | |||
\return | \return | |||
float value describing the pixel height of the font without | float value describing the pixel height of the font without | |||
any additional padding. | any additional padding. | |||
*/ | */ | |||
float getFontHeight (float y_scale = 1.0f) const | float getFontHeight(float y_scale = 1.0f) const | |||
{ return (d_ascender - d_descender) * y_scale; } | { return (d_ascender - d_descender) * y_scale; } | |||
/*! | /*! | |||
\brief | \brief | |||
Return the number of pixels from the top of the highest glyph | Return the number of pixels from the top of the highest glyph | |||
to the baseline | to the baseline | |||
\param y_scale | \param y_scale | |||
Scaling factor to be applied to the baseline distance, where 1.0f | Scaling factor to be applied to the baseline distance, where 1.0f | |||
is considered to be 'normal'. | is considered to be 'normal'. | |||
\return | \return | |||
pixel spacing from top of front glyphs to baseline | pixel spacing from top of front glyphs to baseline | |||
*/ | */ | |||
float getBaseline (float y_scale = 1.0f) const | float getBaseline(float y_scale = 1.0f) const | |||
{ return d_ascender * y_scale; } | { return d_ascender * y_scale; } | |||
/*! | /*! | |||
\brief | \brief | |||
Return the pixel width of the specified text if rendered with | Return the pixel width of the specified text if rendered with | |||
this Font. | this Font. | |||
\param text | \param text | |||
String object containing the text to return the rendered pixel | String object containing the text to return the rendered pixel | |||
width for. | width for. | |||
\param x_scale | \param x_scale | |||
Scaling factor to be applied to each glyph's x axis when | Scaling factor to be applied to each glyph's x axis when | |||
measuring the extent, where 1.0f is considered to be 'normal'. | measuring the extent, where 1.0f is considered to be 'normal'. | |||
\return | \return | |||
Number of pixels that \a text will occupy when rendered with | Number of pixels that \a text will occupy when rendered with | |||
this Font. | this Font. | |||
*/ | */ | |||
float getTextExtent (const String& text, float x_scale = 1.0f); | float getTextExtent(const String& text, float x_scale = 1.0f) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the index of the closest text character in String \a text | Return the index of the closest text character in String \a text | |||
that corresponds to pixel location \a pixel if the text were render ed. | that corresponds to pixel location \a pixel if the text were render ed. | |||
\param text | \param text | |||
String object containing the text. | String object containing the text. | |||
\param pixel | \param pixel | |||
skipping to change at line 829 | skipping to change at line 264 | |||
Scaling factor to be applied to each glyph's x axis when measuring | Scaling factor to be applied to each glyph's x axis when measuring | |||
the text extent, where 1.0f is considered to be 'normal'. | the text extent, where 1.0f is considered to be 'normal'. | |||
\return | \return | |||
Returns a character index into String \a text for the character tha t | Returns a character index into String \a text for the character tha t | |||
would be rendered closest to horizontal pixel offset \a pixel if th e | would be rendered closest to horizontal pixel offset \a pixel if th e | |||
text were to be rendered via this Font. Range of the return is fro m | text were to be rendered via this Font. Range of the return is fro m | |||
0 to text.length(), so may actually return an index past the end of | 0 to text.length(), so may actually return an index past the end of | |||
the string, which indicates \a pixel was beyond the last character. | the string, which indicates \a pixel was beyond the last character. | |||
*/ | */ | |||
size_t getCharAtPixel (const String& text, float pixel, float x_scale = | size_t getCharAtPixel(const String& text, float pixel, | |||
1.0f) | float x_scale = 1.0f) const | |||
{ return getCharAtPixel(text, 0, pixel, x_scale); } | { return getCharAtPixel(text, 0, pixel, x_scale); } | |||
/*! | /*! | |||
\brief | \brief | |||
Return the index of the closest text character in String \a text, | Return the index of the closest text character in String \a text, | |||
starting at character index \a start_char, that corresponds | starting at character index \a start_char, that corresponds | |||
to pixel location \a pixel if the text were to be rendered. | to pixel location \a pixel if the text were to be rendered. | |||
\param text | \param text | |||
String object containing the text. | String object containing the text. | |||
skipping to change at line 860 | skipping to change at line 296 | |||
Scaling factor to be applied to each glyph's x axis when measuring | Scaling factor to be applied to each glyph's x axis when measuring | |||
the text extent, where 1.0f is considered to be 'normal'. | the text extent, where 1.0f is considered to be 'normal'. | |||
\return | \return | |||
Returns a character index into String \a text for the character tha t | Returns a character index into String \a text for the character tha t | |||
would be rendered closest to horizontal pixel offset \a pixel if th e | would be rendered closest to horizontal pixel offset \a pixel if th e | |||
text were to be rendered via this Font. Range of the return is fro m | text were to be rendered via this Font. Range of the return is fro m | |||
0 to text.length(), so may actually return an index past the end of | 0 to text.length(), so may actually return an index past the end of | |||
the string, which indicates \a pixel was beyond the last character. | the string, which indicates \a pixel was beyond the last character. | |||
*/ | */ | |||
size_t getCharAtPixel (const String& text, size_t start_char, float pix | size_t getCharAtPixel(const String& text, size_t start_char, float pixe | |||
el, float x_scale = 1.0f); | l, | |||
float x_scale = 1.0f) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the number of lines the given text would be formatted to. | Sets the default resource group to be used when loading font data | |||
Since text formatting can result in multiple lines of text being | ||||
output, it can be useful to know how many lines would be output | ||||
without actually rendering the text. | ||||
\param text | ||||
String object containing the text to be measured. | ||||
\param format_area | \param resourceGroup | |||
Rect object describing the area to be used when formatting the text | String describing the default resource group identifier to be used. | |||
depending upon the option specified in \a fmt. | ||||
\param fmt | \return | |||
One of the TextFormatting values specifying the text formatting | Nothing. | |||
required. | */ | |||
static void setDefaultResourceGroup(const String& resourceGroup) | ||||
{ d_defaultResourceGroup = resourceGroup; } | ||||
\param x_scale | /*! | |||
Scaling factor to be applied to each glyph's x axis, where 1.0f | \brief | |||
is considered to be 'normal'. | Returns the default resource group currently set for Fonts. | |||
\return | \return | |||
The number of lines produced from the specified formatting | String describing the default resource group identifier that will b | |||
e | ||||
used when loading font data. | ||||
*/ | */ | |||
size_t getFormattedLineCount (const String& text, const Rect& format_ar | static const String& getDefaultResourceGroup() | |||
ea, TextFormatting fmt, float x_scale = 1.0f); | { return d_defaultResourceGroup; } | |||
/*! | /*! | |||
\brief | \brief | |||
Return the horizontal pixel extent given text would be formatted to | Writes an xml representation of this Font to \a out_stream. | |||
. | ||||
The value return by this method is basically the extent of the wide | ||||
st | ||||
line within the formatted text. | ||||
\param text | \param xml_stream | |||
String object containing the text to be measured. | Stream where xml data should be output. | |||
\param format_area | \return | |||
Rect object describing the area to be used when formatting the text | Nothing. | |||
depending upon the option specified in \a fmt. | */ | |||
void writeXMLToStream(XMLSerializer& xml_stream) const; | ||||
\param fmt | /*! | |||
One of the TextFormatting values specifying the text formatting | \brief | |||
required. | Return a pointer to the glyphDat struct for the given codepoint, | |||
or 0 if the codepoint does not have a glyph defined. | ||||
\param x_scale | \param codepoint | |||
Scaling factor to be applied to each glyph's x axis, where 1.0f | utf32 codepoint to return the glyphDat structure for. | |||
is considered to be 'normal'. | ||||
\return | \return | |||
The widest pixel extent of the lines produced from the specified | Pointer to the glyphDat struct for \a codepoint, or 0 if no glyph | |||
formatting. | is defined for \a codepoint. | |||
*/ | */ | |||
float getFormattedTextExtent (const String& text, const Rect& format_ar | const FontGlyph* getGlyphData(utf32 codepoint) const; | |||
ea, TextFormatting fmt, float x_scale = 1.0f); | ||||
protected: | ||||
//! Constructor. | ||||
Font(const String& name, const String& type_name, const String& filenam | ||||
e, | ||||
const String& resource_group, const bool auto_scaled, | ||||
const float native_horz_res, const float native_vert_res); | ||||
/*! | /*! | |||
\brief | \brief | |||
Sets the default resource group to be used when loading font data | This function prepares a certain range of glyphs to be ready for | |||
displaying. This means that after returning from this function | ||||
glyphs from d_cp_map[start_codepoint] to d_cp_map[end_codepoint] | ||||
should have their d_image member set. If there is an error | ||||
during rasterisation of some glyph, it's okay to leave the | ||||
d_image field set to NULL, in which case such glyphs will | ||||
be skipped from display. | ||||
\param start_codepoint | ||||
The lowest codepoint that should be rasterised | ||||
\param end_codepoint | ||||
The highest codepoint that should be rasterised | ||||
*/ | ||||
virtual void rasterise(utf32 start_codepoint, utf32 end_codepoint) cons | ||||
t; | ||||
\param resourceGroup | //! Update the font as needed, according to the current parameters. | |||
String describing the default resource group identifier to be used. | virtual void updateFont() = 0; | |||
\return | //! implementaion version of writeXMLToStream. | |||
Nothing. | virtual void writeXMLToStream_impl(XMLSerializer& xml_stream) const = 0 | |||
; | ||||
//! Register all properties of this class. | ||||
void addFontProperties(); | ||||
/*! | ||||
\brief | ||||
Set the maximal glyph index. This reserves the respective | ||||
number of bits in the d_glyphPageLoaded array. | ||||
*/ | */ | |||
static void setDefaultResourceGroup (const String& resourceGroup) | void setMaxCodepoint(utf32 codepoint); | |||
{ d_defaultResourceGroup = resourceGroup; } | ||||
//! Name of this font. | ||||
String d_name; | ||||
//! Type name string for this font (not used internally) | ||||
String d_type; | ||||
//! Name of the file used to create this font (font file or imagset) | ||||
String d_filename; | ||||
//! Name of the font file's resource group. | ||||
String d_resourceGroup; | ||||
//! Holds default resource group for font loading. | ||||
static String d_defaultResourceGroup; | ||||
//! maximal font ascender (pixels above the baseline) | ||||
float d_ascender; | ||||
//! maximal font descender (negative pixels below the baseline) | ||||
float d_descender; | ||||
//! (ascender - descender) + linegap | ||||
float d_height; | ||||
//! true when auto-scaling is enabled. | ||||
bool d_autoScale; | ||||
//! native horizontal resolution for this Imageset. | ||||
float d_nativeHorzRes; | ||||
//! native vertical resolution for this Imageset. | ||||
float d_nativeVertRes; | ||||
//! current horizontal scaling factor. | ||||
float d_horzScaling; | ||||
//! current vertical scaling factor. | ||||
float d_vertScaling; | ||||
//! Maximal codepoint for font glyphs | ||||
utf32 d_maxCodepoint; | ||||
/*! | /*! | |||
\brief | \brief | |||
Returns the default resource group currently set for Fonts. | This bitmap holds information about loaded 'pages' of glyphs. | |||
A glyph page is a set of 256 codepoints, starting at 256-multiples. | ||||
For example, the 1st glyph page is 0-255, fourth is 1024-1279 etc. | ||||
When a specific glyph is required for painting, the corresponding | ||||
bit is checked to see if the respective page has been rasterised. | ||||
If not, the rasterise() method is invoked, which prepares the | ||||
glyphs from the respective glyph page for being painted. | ||||
\return | This array is big enough to hold at least max_codepoint bits. | |||
String describing the default resource group identifier that will b | If this member is NULL, all glyphs are considered pre-rasterised. | |||
e | ||||
used when loading font data. | ||||
*/ | */ | |||
static const String& getDefaultResourceGroup () | uint* d_glyphPageLoaded; | |||
{ return d_defaultResourceGroup; } | ||||
//! Definition of CodepointMap type. | ||||
typedef std::map<utf32, FontGlyph> CodepointMap; | ||||
//! Contains mappings from code points to Image objects | ||||
CodepointMap d_cp_map; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIFont_h_ | #endif // end of guard _CEGUIFont_h_ | |||
End of changes. 62 change blocks. | ||||
794 lines changed or deleted | 182 lines changed or added | |||
CEGUIFontManager.h | CEGUIFontManager.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIFontManager.h | filename: CEGUIFontManager.h | |||
created: 21/2/2004 | created: Sun Jul 19 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines interface for the FontManager class | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFontManager_h_ | #ifndef _CEGUIFontManager_h_ | |||
#define _CEGUIFontManager_h_ | #define _CEGUIFontManager_h_ | |||
#include "CEGUIBase.h" | ||||
#include "CEGUIString.h" | ||||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
#include "CEGUINamedXMLResourceManager.h" | ||||
#include "CEGUIFont.h" | ||||
#include "CEGUIFont_xmlHandler.h" | ||||
#include "CEGUIIteratorBase.h" | #include "CEGUIIteratorBase.h" | |||
#include <map> | ||||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
class FreeTypeFont; | ||||
class PixmapFont; | ||||
/*! | /*! | |||
\brief | \brief | |||
Class providing a shared library of Font objects to the system. | Class providing a shared library of Font objects to the system. | |||
The FontManager is used to create, access, and destroy Font objects. | The FontManager is used to create, access, and destroy Font objects. T | |||
The idea is that the | he | |||
FontManager will function as a central repository for Font objects u | idea is that the FontManager will function as a central repository for | |||
sed within the GUI system, | Font | |||
and that those Font objects can be accessed, via a unique name, by a | objects used within the GUI system, and that those Font objects can be | |||
ny interested party within | accessed, via a unique name, by any interested party within the system. | |||
the system. | ||||
*/ | */ | |||
class CEGUIEXPORT FontManager : public Singleton<FontManager> | class CEGUIEXPORT FontManager : | |||
public Singleton<FontManager>, | ||||
public NamedXMLResourceManager<Font, Font_xmlHandler> | ||||
{ | { | |||
public: | public: | |||
/*! | //! Constructor. | |||
\brief | FontManager(); | |||
Constructor for FontManager objects | ||||
*/ | ||||
FontManager(void); | ||||
/*! | ||||
\brief | ||||
Destructor for FontManager objects | ||||
*/ | ||||
~FontManager(void); | ||||
/*! | ||||
\brief | ||||
Creates a new font from a font definition file, and returns | ||||
a pointer to the new Font object. | ||||
\param filename | ||||
String object containing the filename of a 'font definition | ||||
file' what will be used to create the new font | ||||
\param resourceGroup | //! Destructor. | |||
Resource group identifier to pass to the resource provider when loa | ~FontManager(); | |||
ding the font definition file. | ||||
\return | /*! | |||
Pointer the the newly created Font object | \brief | |||
Creates a FreeType type font. | ||||
\exception FileIOException thrown if th | \param font_name | |||
ere was some problem accessing or parsing the file \a filename | The name that the font will use within the CEGUI system. | |||
\exception InvalidRequestException thrown if an invalid | ||||
filename was provided. | ||||
\exception AlreadyExistsException thrown if a Font alr | ||||
eady exists with the name specified, or if a font Imageset clashes with one | ||||
already defined in the system. | ||||
\exception GenericException thrown if so | ||||
mething goes wrong while accessing a true-type font referenced in file \a f | ||||
ilename. | ||||
\exception RendererException thrown if th | ||||
e Renderer can't support a texture large enough to hold the requested glyph | ||||
imagery. | ||||
\exception MemoryException thrown if al | ||||
location of imagery construction buffer fails. | ||||
*/ | ||||
Font *createFont(const String& filename, const String& resourceGroup = | ||||
""); | ||||
/*! | \param point_size | |||
\brief | Specifies the point size that the font is to be rendered at. | |||
Creates a new Font based on a true-type font, and returns a | ||||
pointer to the new Font object. | ||||
\param type | \param anti_aliased | |||
String object containing the type of the font to be created | Specifies whether the font should be rendered using anti aliasing. | |||
(same as | ||||
in the "Type" attribute of the font XML). | ||||
\param name | \param font_filename | |||
String object containing a unique name for the new font. | The filename of an font file that will be used as the source for | |||
glyph images for this font. | ||||
\param fontname | \param resource_group | |||
String object containing the name and path of the true-type | The resource group identifier to use when loading the font file | |||
font to access. | specified by \a font_filename. | |||
\param resourceGroup | \param auto_scaled | |||
Resource group identifier to be passed to the resource provider whe | Specifies whether the font imagery should be automatically scaled t | |||
n loading the font definition file. | o | |||
maintain the same physical size (which is calculated by using the | ||||
native resolution setting). | ||||
\return | \param native_horz_res | |||
Pointer to the newly created Font object. | The horizontal native resolution value. This is only significant w | |||
hen | ||||
auto scaling is enabled. | ||||
\exception AlreadyExistsException thrown if a Font alr | \param native_vert_res | |||
eady exists with the name specified, or if a font Imageset clashes with one | The vertical native resolution value. This is only significant whe | |||
already defined in the system. | n | |||
\exception GenericException thrown if so | auto scaling is enabled. | |||
mething goes wrong while accessing a true-type font referenced in file \a f | ||||
ontname. | ||||
\exception RendererException thrown if th | ||||
e Renderer can't support a texture large enough to hold the requested glyph | ||||
imagery. | ||||
\exception MemoryException thrown if al | ||||
location of imagery construction buffer fails. | ||||
*/ | ||||
Font *createFont (const String &type, const String& name, const String& | ||||
fontname, | ||||
const String& resourceGroup = ""); | ||||
/*! | \param action | |||
\brief | One of the XMLResourceExistsAction enumerated values indicating wha | |||
Create a new font object given its type and the XML attributes. | t | |||
action should be taken when a Font with the specified name | ||||
already exists. | ||||
\return | \return | |||
The new font object or NULL. | Reference to the newly create Font object. | |||
*/ | */ | |||
Font *createFont (const String &type, const XMLAttributes& attributes); | Font& createFreeTypeFont(const String& font_name, const float point_siz | |||
e, | ||||
/*! | const bool anti_aliased, | |||
\brief | const String& font_filename, | |||
Destroy's the font with the given name | const String& resource_group = "", | |||
const bool auto_scaled = false, | ||||
\param name | const float native_horz_res = 640.0f, | |||
String object containing the name of the font to be destroye | const float native_vert_res = 480.0f, | |||
d. If the specified font does not exist, nothing happens. | XMLResourceExistsAction action = XREA_RETURN); | |||
\return | ||||
Nothing | ||||
*/ | ||||
void destroyFont(const String& name); | ||||
/*! | ||||
\brief | ||||
Destroys the given Font object | ||||
\param font | ||||
Pointer to the Font to be destroyed. If no such Font exists | ||||
, nothing happens. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void destroyFont(Font* font); | ||||
/*! | ||||
\brief | ||||
Destroys all Font objects registered in the system | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Creates a Pixmap type font. | |||
void destroyAllFonts(void); | ||||
/*! | \param font_name | |||
\brief | The name that the font will use within the CEGUI system. | |||
Checks the existence of a given font. | ||||
\param name | \param imageset_filename | |||
String object holding the name of the Font object to look fo | The filename of an imageset to load that will be used as the source | |||
r. | for | |||
glyph images for this font. If \a resource_group is the special va | ||||
lue | ||||
of "*", this parameter may instead refer to the name of an already | ||||
loaded Imagset. | ||||
\return | \param resource_group | |||
true if a Font object named \a name exists in the system, fa | The resource group identifier to use when loading the imageset file | |||
lse if no such font exists. | specified by \a imageset_filename. If this group is set to the spe | |||
*/ | cial | |||
bool isFontPresent(const String& name) const; | value of "*", then \a imageset_filename instead will refer to the n | |||
ame | ||||
of an existing Imageset. | ||||
/*! | \param auto_scaled | |||
\brief | Specifies whether the font imagery should be automatically scaled t | |||
Returns a pointer to the font object with the specified name | o | |||
maintain the same physical size (which is calculated by using the | ||||
native resolution setting). | ||||
\param name | \param native_horz_res | |||
String object containing the name of the Font object to be r | The horizontal native resolution value. This is only significant w | |||
eturned | hen | |||
auto scaling is enabled. | ||||
\return | \param native_vert_res | |||
Pointer to the requested Font object | The vertical native resolution value. This is only significant whe | |||
n | ||||
auto scaling is enabled. | ||||
\exception UnknownObjectException Thrown if no font with the g | \param action | |||
iven name exists. | One of the XMLResourceExistsAction enumerated values indicating wha | |||
*/ | t | |||
Font* getFont(const String& name) const; | action should be taken when a Font with the specified name | |||
already exists. | ||||
/*! | \return | |||
\brief | Reference to the newly create Font object. | |||
Notify the FontManager of the current (usually new) display | */ | |||
resolution. | Font& createPixmapFont(const String& font_name, | |||
const String& imageset_filename, | ||||
const String& resource_group = "", | ||||
const bool auto_scaled = false, | ||||
const float native_horz_res = 640.0f, | ||||
const float native_vert_res = 480.0f, | ||||
XMLResourceExistsAction action = XREA_RETURN); | ||||
\param size | /*! | |||
Size object describing the display resolution | \brief | |||
Notify the FontManager that display size may have changed. | ||||
\return | \param size | |||
Nothing | Size object describing the display resolution | |||
*/ | */ | |||
void notifyScreenResolution(const Size& size); | void notifyDisplaySizeChanged(const Size& size); | |||
/*! | /*! | |||
\brief | \brief | |||
Writes a full XML font file for the specified Font to the given Out | Writes a full XML font file for the specified Font to the given | |||
Stream. | OutStream. | |||
\param name | \param name | |||
String holding the name of the Font to be written to the stream. | String holding the name of the Font to be written to the stream. | |||
\param out_stream | \param out_stream | |||
OutStream (std::ostream based) object where data is to be sent. | OutStream (std::ostream based) object where data is to be sent. | |||
\return | ||||
Nothing. | ||||
*/ | */ | |||
void writeFontToStream(const String& name, OutStream& out_stream) const ; | void writeFontToStream(const String& name, OutStream& out_stream) const ; | |||
private: | //! ConstBaseIterator type definition. | |||
/********************************************************************** | typedef ConstBaseIterator<ObjectRegistry> FontIterator; | |||
*** | ||||
Implementation Data | ||||
*********************************************************************** | ||||
**/ | ||||
typedef std::map<String, Font*, String::FastLessCompare> FontRegistry; | ||||
FontRegistry d_fonts; | ||||
public: | ||||
/********************************************************************** | ||||
*** | ||||
Iterator stuff | ||||
*********************************************************************** | ||||
**/ | ||||
typedef ConstBaseIterator<FontRegistry> FontIterator; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a FontManager::FontIterator object to iterate over the avail | Return a FontManager::FontIterator object to iterate over the avail | |||
able Font objects. | able | |||
Font objects. | ||||
*/ | */ | |||
FontIterator getIterator (void) const; | FontIterator getIterator() const; | |||
// ensure we see overloads from template base class | ||||
using NamedXMLResourceManager<Font, Font_xmlHandler>::create; | ||||
protected: | ||||
// override from base | ||||
void doPostObjectAdditionAction(Font& object); | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIFontManager_h_ | #endif // end of guard _CEGUIFontManager_h_ | |||
End of changes. 40 change blocks. | ||||
193 lines changed or deleted | 139 lines changed or added | |||
CEGUIFont_xmlHandler.h | CEGUIFont_xmlHandler.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIFont_xmlHandler.h | filename: CEGUIFont_xmlHandler.h | |||
created: 21/2/2004 | created: Sun Jul 19 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Handle the basic XML layout for .font files | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 38 | skipping to change at line 36 | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFont_xmlHandler_h_ | #ifndef _CEGUIFont_xmlHandler_h_ | |||
#define _CEGUIFont_xmlHandler_h_ | #define _CEGUIFont_xmlHandler_h_ | |||
#include "CEGUIXMLHandler.h" | #include "CEGUIXMLHandler.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
//! Handler class used to parse the Font XML files to create Font objects. | ||||
class Font; | class CEGUIEXPORT Font_xmlHandler : public XMLHandler | |||
/*! | ||||
\brief | ||||
Handler class used to parse the Font XML files using SAX2 | ||||
*/ | ||||
class Font_xmlHandler : public XMLHandler | ||||
{ | { | |||
public: | public: | |||
/********************************************************************** | //! Filename of the XML schema used for validating Font files. | |||
*** | static const String FontSchemaName; | |||
Implementation Data | //! Tag name for Font elements. | |||
*********************************************************************** | static const String FontElement; | |||
**/ | //! Tag name for Mapping elements. | |||
Font *d_font; //!< Font object that we are helping to build | static const String MappingElement; | |||
//! Attribute name that stores the specific font type. | ||||
static const String FontTypeAttribute; | ||||
//! Attribute name that stores the font name. | ||||
static const String FontNameAttribute; | ||||
//! Attribute name that stores the filename of the font source (font / | ||||
imageset) | ||||
static const String FontFilenameAttribute; | ||||
//! Attribute name that stores the resource group of the font source. | ||||
static const String FontResourceGroupAttribute; | ||||
//! Attribute name that stores the auto-scaled setting. | ||||
static const String FontAutoScaledAttribute; | ||||
//! Attribute name that stores the horizontal native resolution. | ||||
static const String FontNativeHorzResAttribute; | ||||
//! Attribute name that stores the vertical native resolution. | ||||
static const String FontNativeVertResAttribute; | ||||
//! Attribute name that stores the font point size. | ||||
static const String FontSizeAttribute; | ||||
//! Attribute name that stores the font anti-aliasing setting. | ||||
static const String FontAntiAliasedAttribute; | ||||
//! Attribute name that stores the codepoint value for a mapping | ||||
static const String MappingCodepointAttribute; | ||||
//! Attribute name that stores the image name for a mapping | ||||
static const String MappingImageAttribute; | ||||
//! Attribute name that stores the horizontal advance value for a mappi | ||||
ng. | ||||
static const String MappingHorzAdvanceAttribute; | ||||
//! Type name of FreeType fonts. | ||||
static const String FontTypeFreeType; | ||||
//! Type name of Pixmap fonts. | ||||
static const String FontTypePixmap; | ||||
/********************************************************************** | //! Constructor. | |||
*** | Font_xmlHandler(const String& filename, const String& resource_group); | |||
Construction & Destruction | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
Constructor for Font::xmlHandler objects | ||||
\param font | //! Destructor. | |||
Pointer to the Font object creating this xmlHandler object | ~Font_xmlHandler(); | |||
*/ | ||||
Font_xmlHandler() : d_font (0) {} | ||||
/*! | //! Return string holding the name of the created Font. | |||
\brief | const String& getObjectName() const; | |||
Destructor for Font::xmlHandler objects | ||||
*/ | ||||
virtual ~Font_xmlHandler(void) {} | ||||
/********************************************************************** | //! Return reference to the created Font object. | |||
*** | Font& getObject() const; | |||
SAX2 Handler overrides | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
document processing (only care about elements, schema validates format) | ||||
*/ | ||||
virtual void elementStart(const String& element, const XMLAttributes& a | ||||
ttributes); | ||||
virtual void elementEnd(const String& element); | ||||
private: | // XMLHandler overrides | |||
/********************************************************************** | void elementStart(const String& element, const XMLAttributes& attribute | |||
*** | s); | |||
Implementation Constants | void elementEnd(const String& element); | |||
*********************************************************************** | ||||
**/ | ||||
/*! | private: | |||
\brief | //! handles the opening Font XML element. | |||
Method that handles the opening Font XML element. | ||||
*/ | ||||
void elementFontStart(const XMLAttributes& attributes); | void elementFontStart(const XMLAttributes& attributes); | |||
//! handles the closing Font XML element. | ||||
/*! | ||||
\brief | ||||
Method that handles the closing Font XML element. | ||||
*/ | ||||
void elementFontEnd(); | void elementFontEnd(); | |||
//! handles the opening Mapping XML element. | ||||
void elementMappingStart(const XMLAttributes& attributes); | ||||
//! creates a FreeTypeFont | ||||
void createFreeTypeFont(const XMLAttributes& attributes); | ||||
//! creates a PixmapFont | ||||
void createPixmapFont(const XMLAttributes& attributes); | ||||
//! Font object that we are constructing. | ||||
Font* d_font; | ||||
//! inidcates whether client read the created object | ||||
mutable bool d_objectRead; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif | #endif | |||
End of changes. 12 change blocks. | ||||
64 lines changed or deleted | 68 lines changed or added | |||
CEGUIForwardRefs.h | CEGUIForwardRefs.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIForwardRefs.h | filename: CEGUIForwardRefs.h | |||
created: 21/2/2004 | created: 21/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Forward declares all core system classes | purpose: Forward declares all core system classes | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 36 | skipping to change at line 36 | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIForwardRefs_h_ | #ifndef _CEGUIForwardRefs_h_ | |||
#define _CEGUIForwardRefs_h_ | #define _CEGUIForwardRefs_h_ | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/************************************************************************* | /************************************************************************* | |||
Forward reference declarations of all core GUI system classes | Forward declare majority of core classes | |||
*************************************************************************/ | *************************************************************************/ | |||
class String; | class BasicRenderedStringParser; | |||
class Vector3; | class BiDiVisualMapping; | |||
class Size; | class CentredRenderedString; | |||
class Exception; | ||||
class Rect; | ||||
class ColourRect; | ||||
class colour; | class colour; | |||
class Texture; | class ColourRect; | |||
class Renderer; | class CoordConverter; | |||
class DefaultLogger; | ||||
class DefaultRenderedStringParser; | ||||
class DefaultResourceProvider; | ||||
class DynamicModule; | ||||
class Event; | ||||
class EventArgs; | ||||
class EventSet; | ||||
class Exception; | ||||
class FactoryModule; | ||||
class Font; | ||||
class FontGlyph; | ||||
class FontManager; | ||||
class FormattedRenderedString; | ||||
class GeometryBuffer; | ||||
class GlobalEventSet; | ||||
class Image; | class Image; | |||
class ImageCodec; | ||||
class ImagerySection; | ||||
class Imageset; | class Imageset; | |||
class ImagesetManager; | class ImagesetManager; | |||
class JustifiedRenderedString; | ||||
class LeftAlignedRenderedString; | ||||
class Logger; | ||||
class MouseCursor; | class MouseCursor; | |||
class Font; | ||||
class FontManager; | ||||
class EventArgs; | ||||
class Event; | ||||
class EventSet; | ||||
class Property; | class Property; | |||
class PropertyHelper; | ||||
class PropertyReceiver; | ||||
class PropertySet; | class PropertySet; | |||
class Window; | class RawDataContainer; | |||
class WindowFactory; | class Rect; | |||
class WindowManager; | class RegexMatcher; | |||
class RenderedString; | ||||
class RenderedStringComponent; | ||||
class RenderedStringImageComponent; | ||||
class RenderedStringParser; | ||||
class RenderedStringTextComponent; | ||||
class RenderedStringWidgetComponent; | ||||
class Renderer; | ||||
class RenderEffect; | ||||
struct RenderingContext; | ||||
class RenderingRoot; | ||||
class RenderingSurface; | ||||
class RenderingWindow; | ||||
class RenderQueue; | ||||
class RenderSystem; | ||||
class RenderTarget; | ||||
class ResourceEventSet; | ||||
class ResourceProvider; | ||||
class RightAlignedRenderedString; | ||||
class Scheme; | class Scheme; | |||
class SchemeManager; | class SchemeManager; | |||
class ScriptWindowHelper; | class ScriptFunctor; | |||
class System; | ||||
class FactoryModule; | ||||
class ScriptModule; | class ScriptModule; | |||
class ResourceProvider; | class Size; | |||
class DefaultResourceProvider; | class String; | |||
class DynamicModule; | class System; | |||
class PropertyReceiver; | class Texture; | |||
class GlobalEventSet; | class TextureTarget; | |||
class TextUtils; | ||||
class Vector2; | ||||
class Vector3; | ||||
struct Vertex; | ||||
class WidgetLookFeel; | ||||
class Window; | ||||
class WindowFactory; | ||||
class WindowFactoryManager; | ||||
class WindowManager; | ||||
class WindowRenderer; | ||||
class WindowRendererModule; | ||||
class WRFactoryRegisterer; | ||||
class XMLAttributes; | class XMLAttributes; | |||
class XMLHandler; | class XMLHandler; | |||
class XMLParser; | class XMLParser; | |||
class WindowRenderer; | ||||
class WindowRendererManager; | ||||
/************************************************************************* | /************************************************************************* | |||
Forward reference declarations for GUI element base classes | Forward declare window / widget classes. | |||
*************************************************************************/ | *************************************************************************/ | |||
class ButtonBase; | class ButtonBase; | |||
class RadioButton; | ||||
class Checkbox; | class Checkbox; | |||
class PushButton; | class ClippedContainer; | |||
class Titlebar; | ||||
class FrameWindow; | ||||
class Editbox; | ||||
class Listbox; | ||||
class Combobox; | class Combobox; | |||
class ListHeaderSegment; | ||||
class ListHeader; | ||||
class MultiColumnList; | ||||
class ProgressBar; | ||||
class Thumb; | ||||
class Scrollbar; | ||||
class Slider; | ||||
class ListboxItem; | ||||
class ListboxTextItem; | ||||
class ComboDropList; | class ComboDropList; | |||
class MultiLineEditbox; | ||||
class Spinner; | ||||
class GUISheet; | ||||
class DragContainer; | class DragContainer; | |||
class ScrollablePane; | class Editbox; | |||
class ScrolledContainer; | class FrameWindow; | |||
class Tooltip; | class GUISheet; | |||
class ItemEntry; | class ItemEntry; | |||
class MenuItem; | ||||
class ItemListBase; | class ItemListBase; | |||
class MenuBase; | class ItemListbox; | |||
class Listbox; | ||||
class ListboxItem; | ||||
class ListboxTextItem; | ||||
class ListHeader; | ||||
class ListHeaderSegment; | ||||
class Menubar; | class Menubar; | |||
class MenuBase; | ||||
class MenuItem; | ||||
class MultiColumnList; | ||||
class MultiLineEditbox; | ||||
class PopupMenu; | class PopupMenu; | |||
class ProgressBar; | ||||
class PushButton; | ||||
class RadioButton; | ||||
class ScrollablePane; | ||||
class Scrollbar; | ||||
class ScrolledContainer; | ||||
class ScrolledItemListBase; | class ScrolledItemListBase; | |||
class ItemListbox; | class Slider; | |||
class Spinner; | ||||
class TabButton; | class TabButton; | |||
class TabControl; | class TabControl; | |||
class Thumb; | ||||
class Titlebar; | ||||
class Tooltip; | ||||
class Tree; | class Tree; | |||
class TreeItem; | ||||
/************************************************************************* | ||||
Forward declare EventArg based classes. | ||||
*************************************************************************/ | ||||
class ActivationEventArgs; | ||||
class DisplayEventArgs; | ||||
class DragDropEventArgs; | ||||
class HeaderSequenceEventArgs; | ||||
class KeyEventArgs; | ||||
class MouseCursorEventArgs; | ||||
class MouseEventArgs; | ||||
class RenderQueueEventArgs; | ||||
class ResourceEventArgs; | ||||
class TreeEventArgs; | ||||
class UpdateEventArgs; | ||||
class WindowEventArgs; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIForwardRefs_h_ | #endif // end of guard _CEGUIForwardRefs_h_ | |||
End of changes. 26 change blocks. | ||||
54 lines changed or deleted | 111 lines changed or added | |||
CEGUIFrameWindow.h | CEGUIFrameWindow.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFrameWindow_h_ | #ifndef _CEGUIFrameWindow_h_ | |||
#define _CEGUIFrameWindow_h_ | #define _CEGUIFrameWindow_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIFrameWindowProperties.h" | #include "CEGUIFrameWindowProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
skipping to change at line 435 | skipping to change at line 435 | |||
String holding the name of the Image to be used. | String holding the name of the Image to be used. | |||
\return | \return | |||
Nothing. | Nothing. | |||
\exception UnknownObjectException thrown if either \a imageset or \a im age refer to non-existant entities. | \exception UnknownObjectException thrown if either \a imageset or \a im age refer to non-existant entities. | |||
*/ | */ | |||
void setNESWSizingCursorImage(const String& imageset, const String& ima ge); | void setNESWSizingCursorImage(const String& imageset, const String& ima ge); | |||
// overridden from Window class | // overridden from Window class | |||
bool isHit(const Point& position) const { return Window::isHit( | bool isHit(const Point& position, const bool /*allow_disabled*/) const | |||
position) && !d_rolledup; } | { return Window::isHit(position) && !d_rolledup; } | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the Titlebar component widget for this FrameWin dow. | Return a pointer to the Titlebar component widget for this FrameWin dow. | |||
\return | \return | |||
Pointer to a Titlebar object. | Pointer to a Titlebar object. | |||
\exception UnknownObjectException | \exception UnknownObjectException | |||
Thrown if the Titlebar component does not exist. | Thrown if the Titlebar component does not exist. | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
CEGUIFrameWindowProperties.h | CEGUIFrameWindowProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFrameWindowProperties_h_ | #ifndef _CEGUIFrameWindowProperties_h_ | |||
#define _CEGUIFrameWindowProperties_h_ | #define _CEGUIFrameWindowProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of FrameWindowProperties namespace section | // Start of FrameWindowProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the FrameWindow class | Namespace containing all classes that make up the properties interfa ce for the FrameWindow class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFreeImageImageCodec.h | CEGUIFreeImageImageCodec.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIFreeImageImageCodec_h_ | #ifndef _CEGUIFreeImageImageCodec_h_ | |||
#define _CEGUIFreeImageImageCodec_h_ | #define _CEGUIFreeImageImageCodec_h_ | |||
#include "CEGUIImageCodec.h" | #include "../../CEGUIImageCodec.h" | |||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUIFREEIMAGEIMAGECODEC_EXPORTS | # ifdef CEGUIFREEIMAGEIMAGECODEC_EXPORTS | |||
# define CEGUIFREEIMAGEIMAGECODEC_API __declspec(dllexport) | # define CEGUIFREEIMAGEIMAGECODEC_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUIFREEIMAGEIMAGECODEC_API __declspec(dllimport) | # define CEGUIFREEIMAGEIMAGECODEC_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUIFREEIMAGEIMAGECODEC_API | # define CEGUIFREEIMAGEIMAGECODEC_API | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIFreeTypeFont.h | CEGUIFreeTypeFont.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
#include "CEGUIFont.h" | #include "CEGUIFont.h" | |||
#include "CEGUIImage.h" | #include "CEGUIImage.h" | |||
#include "CEGUIDataContainer.h" | #include "CEGUIDataContainer.h" | |||
#include <ft2build.h> | #include <ft2build.h> | |||
#include FT_FREETYPE_H | #include FT_FREETYPE_H | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Forward declarations for font properties | ||||
namespace FontProperties | ||||
{ | ||||
class FreeTypePointSize; | ||||
class FreeTypeAntialiased; | ||||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
Implementation of the Font class interface using the FreeType library. | Implementation of the Font class interface using the FreeType library. | |||
This implementation tries to provide maximal support for any kind of | This implementation tries to provide maximal support for any kind of | |||
fonts supported by FreeType. It has been tested on outline font formats | fonts supported by FreeType. It has been tested on outline font formats | |||
like TTF and PS as well as on bitmap font formats like PCF and FON. | like TTF and PS as well as on bitmap font formats like PCF and FON. | |||
Glyphs are rendered dynamically on demand, so a large font with lots | Glyphs are rendered dynamically on demand, so a large font with lots | |||
of glyphs won't slow application startup time. | of glyphs won't slow application startup time. | |||
*/ | */ | |||
class FreeTypeFont : public Font | class FreeTypeFont : public Font | |||
{ | { | |||
protected: | public: | |||
friend class FontManager; | /*! | |||
friend class FontProperties::FreeTypePointSize; | \brief | |||
friend class FontProperties::FreeTypeAntialiased; | Constructor for FreeTypeFont based fonts. | |||
typedef std::vector<Imageset*> ImagesetVector; | \param font_name | |||
/// Imagesets that holds the glyphs for this font. | The name that the font will use within the CEGUI system. | |||
ImagesetVector d_glyphImages; | ||||
/// Point size of font. | \param point_size | |||
float d_ptSize; | Specifies the point size that the font is to be rendered at. | |||
/// True if the font should be rendered as anti-alaised by freeType. | ||||
bool d_antiAliased; | ||||
/// FreeType-specific font handle | \param anti_aliased | |||
FT_Face d_fontFace; | Specifies whether the font should be rendered using anti aliasing. | |||
/// Font file data | ||||
RawDataContainer d_fontData; | \param font_filename | |||
The filename of an font file that will be used as the source for | ||||
glyph images for this font. | ||||
\param resource_group | ||||
The resource group identifier to use when loading the font file | ||||
specified by \a font_filename. | ||||
\param auto_scaled | ||||
Specifies whether the font imagery should be automatically scaled t | ||||
o | ||||
maintain the same physical size (which is calculated by using the | ||||
native resolution setting). | ||||
\param native_horz_res | ||||
The horizontal native resolution value. This is only significant w | ||||
hen | ||||
auto scaling is enabled. | ||||
\param native_vert_res | ||||
The vertical native resolution value. This is only significant whe | ||||
n | ||||
auto scaling is enabled. | ||||
*/ | ||||
FreeTypeFont(const String& font_name, const float point_size, | ||||
const bool anti_aliased, const String& font_filename, | ||||
const String& resource_group = "", | ||||
const bool auto_scaled = false, | ||||
const float native_horz_res = 640.0f, | ||||
const float native_vert_res = 480.0f); | ||||
//! Destructor. | ||||
~FreeTypeFont(); | ||||
//! return the point size of the freetype font. | ||||
float getPointSize() const; | ||||
//! return whether the freetype font is rendered anti-aliased. | ||||
bool isAntiAliased() const; | ||||
//! return the point size of the freetype font. | ||||
void setPointSize(const float point_size); | ||||
//! return whether the freetype font is rendered anti-aliased. | ||||
void setAntiAliased(const bool anti_alaised); | ||||
protected: | ||||
/*! | /*! | |||
\brief | \brief | |||
Copy the current glyph data into \a buffer, which has a width of | Copy the current glyph data into \a buffer, which has a width of | |||
\a buf_width pixels (not bytes). | \a buf_width pixels (not bytes). | |||
\param buffer | \param buffer | |||
Memory buffer large enough to receive the imagery for the currently | Memory buffer large enough to receive the imagery for the currently | |||
loaded glyph. | loaded glyph. | |||
\param buf_width | \param buf_width | |||
Width of \a buffer in pixels (where each pixel is a argb_t). | Width of \a buffer in pixels (where each pixel is a argb_t). | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void drawGlyphToBuffer (argb_t* buffer, uint buf_width); | void drawGlyphToBuffer(argb_t* buffer, uint buf_width) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the required texture size required to store imagery for the | Return the required texture size required to store imagery for the | |||
glyphs from s to e | glyphs from s to e | |||
\param s | \param s | |||
The first glyph in set | The first glyph in set | |||
\param e | \param e | |||
The last glyph in set | The last glyph in set | |||
*/ | */ | |||
uint getTextureSize (CodepointMap::const_iterator s, | uint getTextureSize(CodepointMap::const_iterator s, | |||
CodepointMap::const_iterator e); | CodepointMap::const_iterator e) const; | |||
/// \copydoc Font::Font | ||||
FreeTypeFont (const String& name, const String& filename, | ||||
const String& resourceGroup); | ||||
/// \copydoc Font::Font | ||||
FreeTypeFont (const XMLAttributes& attributes); | ||||
/// \copydoc Font::~Font | ||||
virtual ~FreeTypeFont (); | ||||
/// \copydoc Font::updateFont | ||||
virtual void updateFont (); | ||||
/// \copydoc Font::writeXMLToStream_impl | ||||
virtual void writeXMLToStream_impl (XMLSerializer& xml_stream) const; | ||||
/*! | ||||
\brief | ||||
Register all properties of this class. | ||||
*/ | ||||
void addFreeTypeFontProperties (); | ||||
/*! | //! Register all properties of this class. | |||
\brief | void addFreeTypeFontProperties(); | |||
Free all allocated font data. | //! Free all allocated font data. | |||
*/ | void free(); | |||
void free (); | ||||
public: | // overrides of functions in Font base class. | |||
/// \copydoc Font::load | void rasterise(utf32 start_codepoint, utf32 end_codepoint) const; | |||
virtual void load (); | void updateFont(); | |||
void writeXMLToStream_impl (XMLSerializer& xml_stream) const; | ||||
/// \copydoc Font::rasterize | //! Point size of font. | |||
virtual void rasterize (utf32 start_codepoint, utf32 end_codepoint); | float d_ptSize; | |||
//! True if the font should be rendered as anti-alaised by freeType. | ||||
bool d_antiAliased; | ||||
//! FreeType-specific font handle | ||||
FT_Face d_fontFace; | ||||
//! Font file data | ||||
RawDataContainer d_fontData; | ||||
//! Type definition for ImagesetVector. | ||||
typedef std::vector<Imageset*> ImagesetVector; | ||||
//! Imagesets that holds the glyphs for this font. | ||||
mutable ImagesetVector d_glyphImages; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIFreeTypeFont_h_ | #endif // end of guard _CEGUIFreeTypeFont_h_ | |||
End of changes. 11 change blocks. | ||||
58 lines changed or deleted | 80 lines changed or added | |||
CEGUIGUILayout_xmlHandler.h | CEGUIGUILayout_xmlHandler.h | |||
---|---|---|---|---|
skipping to change at line 177 | skipping to change at line 177 | |||
\brief | \brief | |||
Method that handles the closing AutoWindow XML element. | Method that handles the closing AutoWindow XML element. | |||
*/ | */ | |||
void elementAutoWindowEnd(); | void elementAutoWindowEnd(); | |||
/*! | /*! | |||
\brief | \brief | |||
Method that handles the closing of a property XML element. | Method that handles the closing of a property XML element. | |||
*/ | */ | |||
void elementPropertyEnd(); | void elementPropertyEnd(); | |||
/******************************************************************* | ||||
****** | void operator=(const GUILayout_xmlHandler&) {} | |||
/********************************************************************** | ||||
*** | ||||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef std::pair<Window*,bool> WindowStackEntry; //!< Pair used as dat atype for the window stack. second is false if the window is an autowindow. | typedef std::pair<Window*,bool> WindowStackEntry; //!< Pair used as dat atype for the window stack. second is false if the window is an autowindow. | |||
typedef std::vector<WindowStackEntry> WindowStack; | typedef std::vector<WindowStackEntry> WindowStack; | |||
Window* d_root; //!< Will point to first win dow created. | Window* d_root; //!< Will point to first win dow created. | |||
WindowStack d_stack; //!< Stack used to keep trac k of what we're doing to which window. | WindowStack d_stack; //!< Stack used to keep trac k of what we're doing to which window. | |||
String d_layoutParent; //!< Name of the parent window to at tach the loaded layout to. | String d_layoutParent; //!< Name of the parent window to at tach the loaded layout to. | |||
const String& d_namingPrefix; //!< Prefix that is to prepe nd all names of created windows. | const String& d_namingPrefix; //!< Prefix that is to prepe nd all names of created windows. | |||
PropertyCallback* d_propertyCallback; //!< Callback for every property loaded | PropertyCallback* d_propertyCallback; //!< Callback for every property loaded | |||
void* d_userData; //!< User data for the property callback | void* d_userData; //!< User data for the property callback | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added | |||
CEGUIGUISheet.h | CEGUIGUISheet.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIGUISheet_h_ | #ifndef _CEGUIGUISheet_h_ | |||
#define _CEGUIGUISheet_h_ | #define _CEGUIGUISheet_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIWindowFactory.h" | #include "../CEGUIWindowFactory.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Window class intended to be used as a simple, generic Window. | Window class intended to be used as a simple, generic Window. | |||
This class does no rendering and so appears totally transparent. This window defaults | This class does no rendering and so appears totally transparent. This window defaults | |||
to position 0.0f, 0.0f with a size of 1.0f x 1.0f. | to position 0.0f, 0.0f with a size of 1.0f x 1.0f. | |||
skipping to change at line 90 | skipping to change at line 90 | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name. false if not. | true if this window was inherited from \a class_name. false if not. | |||
*/ | */ | |||
virtual bool testClassName_impl(const String& class_name) const | virtual bool testClassName_impl(const String& class_name) const | |||
{ | { | |||
if (class_name=="DefaultWindow" || class_name=="GUISheet") return true; | if (class_name=="DefaultWindow" || class_name=="GUISheet") return true; | |||
return Window::testClassName_impl(class_name); | return Window::testClassName_impl(class_name); | |||
} | } | |||
//! helper to update mouse input handled state | ||||
void updateMouseEventHandled(MouseEventArgs& e) const; | ||||
// override the mouse event handlers | ||||
void onMouseMove(MouseEventArgs& e); | ||||
void onMouseWheel(MouseEventArgs& e); | ||||
void onMouseButtonDown(MouseEventArgs& e); | ||||
void onMouseButtonUp(MouseEventArgs& e); | ||||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
typedef for DefaultWindow, which is the new name for GUISheet. | typedef for DefaultWindow, which is the new name for GUISheet. | |||
*/ | */ | |||
typedef GUISheet DefaultWindow; | typedef GUISheet DefaultWindow; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 11 lines changed or added | |||
CEGUIGroupBox.h | CEGUIGroupBox.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public | You should have received a copy of the GNU Lesser General Public | |||
License along with this library; if not, write to the Free Software | License along with this library; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
*************************************************************************/ | *************************************************************************/ | |||
#ifndef _CEGUIGroupBox_h_ | #ifndef _CEGUIGroupBox_h_ | |||
#define _CEGUIGroupBox_h_ | #define _CEGUIGroupBox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindowFactory.h" | #include "../CEGUIWindowFactory.h" | |||
#include "elements/CEGUIClippedContainer.h" | #include "CEGUIClippedContainer.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIImage.h | CEGUIImage.h | |||
---|---|---|---|---|
skipping to change at line 149 | skipping to change at line 149 | |||
/*! | /*! | |||
\brief | \brief | |||
Return Rect describing the source texture area used by this Image. | Return Rect describing the source texture area used by this Image. | |||
\return | \return | |||
Rect object that describes, in pixels, the area upon the source tex ture | Rect object that describes, in pixels, the area upon the source tex ture | |||
which is used when rendering this Image. | which is used when rendering this Image. | |||
*/ | */ | |||
const Rect& getSourceTextureArea(void) const; | const Rect& getSourceTextureArea(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Queue the image to be drawn. | Queue the image to be drawn. | |||
\note | \note | |||
The final position of the Image will be adjusted by the offs | The final position of the Image will be adjusted by the offset valu | |||
et values defined for this Image object. If absolute positioning is | es | |||
essential then these values should be taken into account pri | defined for this Image object. If absolute positioning is essentia | |||
or to calling the draw() methods. However, by doing this you take | l | |||
away the ability of the Imageset designer to adjust the alig | then these values should be taken into account prior to calling the | |||
nment and positioning of Images, therefore your component is far | draw() methods. However, by doing this you take away the ability o | |||
less useful since it requires code changes to modify image p | f the | |||
ositioning that could have been handled from a data file. | Imageset designer to adjust the alignment and positioning of Images | |||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param position | \param buffer | |||
Vector3 object containing the location where the Image is to | GeometryBuffer object where the geometry for the image will be queu | |||
be drawn | ed. | |||
\param size | \param position | |||
Size object describing the size that the Image is to be draw | Vector2 object containing the location where the Image is to be dra | |||
n at. | wn | |||
\param clip_rect | \param size | |||
Rect object that defines an on-screen area that the Image wi | Size object describing the size that the Image is to be drawn at. | |||
ll be clipped to when drawing. | ||||
\param top_left_colour | \param clip_rect | |||
Colour (as 0xAARRGGBB value) to be applied to the top-left c | Rect object that defines an on-screen area that the Image will be | |||
orner of the Image. | clipped to when drawing. | |||
\param top_right_colour | \param top_left_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the top-right | Colour to be applied to the top-left corner of the Image. | |||
corner of the Image. | ||||
\param bottom_left_colour | \param top_right_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-lef | Colour to be applied to the top-right corner of the Image. | |||
t corner of the Image. | ||||
\param bottom_right_colour | \param bottom_left_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-rig | Colour to be applied to the bottom-left corner of the Image. | |||
ht corner of the Image. | ||||
\param quad_split_mode | \param bottom_right_colour | |||
One of the QuadSplitMode values specifying the way quads are | Colour to be applied to the bottom-right corner of the Image. | |||
split into triangles | ||||
\return | \param quad_split_mode | |||
Nothing | One of the QuadSplitMode values specifying the way the quad geometr | |||
*/ | y for | |||
void draw(const Vector3& position, const Size& size, const Rect& | the image is to be split into triangles. | |||
clip_rect, const colour& top_left_colour = 0xFFFFFFFF, const colour& top_ri | ||||
ght_colour = 0xFFFFFFFF, const colour& bottom_left_colour = 0xFFFFFFFF, con | ||||
st colour& bottom_right_colour = 0xFFFFFFFF, QuadSplitMode quad_split_mode | ||||
= TopLeftToBottomRight) const | ||||
{ | ||||
draw(Rect(position.d_x, position.d_y, position.d_x + size.d_ | ||||
width, position.d_y + size.d_height), position.d_z, clip_rect, | ||||
ColourRect(top_left_colour, top_right_colour, bottom | ||||
_left_colour, bottom_right_colour), quad_split_mode); | ||||
} | ||||
/*! | \return | |||
\brief | Nothing | |||
Queue the image to be drawn. | */ | |||
void draw(GeometryBuffer& buffer, const Vector2& position, const Size& | ||||
size, | ||||
const Rect* clip_rect, | ||||
const colour& top_left_colour = 0xFFFFFFFF, | ||||
const colour& top_right_colour = 0xFFFFFFFF, | ||||
const colour& bottom_left_colour = 0xFFFFFFFF, | ||||
const colour& bottom_right_colour = 0xFFFFFFFF, | ||||
QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | ||||
{ | ||||
draw(buffer, Rect(position.d_x, position.d_y, | ||||
position.d_x + size.d_width, | ||||
position.d_y + size.d_height), | ||||
clip_rect, | ||||
ColourRect(top_left_colour, top_right_colour, bottom_left_colo | ||||
ur, | ||||
bottom_right_colour), | ||||
quad_split_mode); | ||||
} | ||||
\note | /*! | |||
The final position of the Image will be adjusted by the offs | \brief | |||
et values defined for this Image object. If absolute positioning is | Queue the image to be drawn. | |||
essential then these values should be taken into account pri | ||||
or to calling the draw() methods. However, by doing this you take | ||||
away the ability of the Imageset designer to adjust the alig | ||||
nment and positioning of Images, therefore your component is far | ||||
less useful since it requires code changes to modify image p | ||||
ositioning that could have been handled from a data file. | ||||
\param dest_rect | \note | |||
Rect object defining the area on-screen where the Image is t | The final position of the Image will be adjusted by the offset valu | |||
o be drawn. The Image will be scaled to fit the area as required. | es | |||
defined for this Image object. If absolute positioning is essentia | ||||
l | ||||
then these values should be taken into account prior to calling the | ||||
draw() methods. However, by doing this you take away the ability o | ||||
f the | ||||
Imageset designer to adjust the alignment and positioning of Images | ||||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param z | \param buffer | |||
Z-order position for the image. Positions increase "into th | GeometryBuffer object where the geometry for the image will be queu | |||
e screen", so 0.0f is at the top of the z-order. | ed. | |||
\param clip_rect | \param dest_rect | |||
Rect object that defines an on-screen area that the Image wi | Rect object defining the area on-screen where the Image is to be dr | |||
ll be clipped to when drawing. | awn. | |||
The Image will be scaled to fill the area as required. | ||||
\param top_left_colour | \param clip_rect | |||
Colour (as 0xAARRGGBB value) to be applied to the top-left c | Rect object that defines an on-screen area that the Image will be | |||
orner of the Image. | clipped to when drawing. | |||
\param top_right_colour | \param top_left_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the top-right | Colour to be applied to the top-left corner of the Image. | |||
corner of the Image. | ||||
\param bottom_left_colour | \param top_right_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-lef | Colour to be applied to the top-right corner of the Image. | |||
t corner of the Image. | ||||
\param bottom_right_colour | \param bottom_left_colour | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-rig | Colour to be applied to the bottom-left corner of the Image. | |||
ht corner of the Image. | ||||
\param quad_split_mode | \param bottom_right_colour | |||
One of the QuadSplitMode values specifying the way quads are | Colour to be applied to the bottom-right corner of the Image. | |||
split into triangles | ||||
\return | \param quad_split_mode | |||
Nothing | One of the QuadSplitMode values specifying the way the quad geometr | |||
*/ | y for | |||
void draw(const Rect& dest_rect, float z, const Rect& clip_rect, | the image is to be split into triangles. | |||
const colour& top_left_colour = 0xFFFFFFFF, const colour& top_right_colour | ||||
= 0xFFFFFFFF, const colour& bottom_left_colour = 0xFFFFFFFF, const colour& | ||||
bottom_right_colour = 0xFFFFFFFF, QuadSplitMode quad_split_mode = TopLeftTo | ||||
BottomRight) const | ||||
{ | ||||
draw(dest_rect, z, clip_rect, ColourRect(top_left_colour, to | ||||
p_right_colour, bottom_left_colour, bottom_right_colour), quad_split_mode); | ||||
} | ||||
/*! | \return | |||
\brief | Nothing | |||
Queue the image to be drawn. | */ | |||
void draw(GeometryBuffer& buffer, const Rect& dest_rect, | ||||
const Rect* clip_rect, | ||||
const colour& top_left_colour = 0xFFFFFFFF, | ||||
const colour& top_right_colour = 0xFFFFFFFF, | ||||
const colour& bottom_left_colour = 0xFFFFFFFF, | ||||
const colour& bottom_right_colour = 0xFFFFFFFF, | ||||
QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | ||||
{ | ||||
draw(buffer, dest_rect, clip_rect, | ||||
ColourRect(top_left_colour, top_right_colour, | ||||
bottom_left_colour, bottom_right_colour), | ||||
quad_split_mode); | ||||
} | ||||
\note | /*! | |||
The final position of the Image will be adjusted by the offs | \brief | |||
et values defined for this Image object. If absolute positioning is | Queue the image to be drawn. | |||
essential then these values should be taken into account pri | ||||
or to calling the draw() methods. However, by doing this you take | ||||
away the ability of the Imageset designer to adjust the alig | ||||
nment and positioning of Images, therefore your component is far | ||||
less useful since it requires code changes to modify image p | ||||
ositioning that could have been handled from a data file. | ||||
\param position | \note | |||
Vector3 object containing the location where the Image is to | The final position of the Image will be adjusted by the offset valu | |||
be drawn | es | |||
defined for this Image object. If absolute positioning is essentia | ||||
l | ||||
then these values should be taken into account prior to calling the | ||||
draw() methods. However, by doing this you take away the ability o | ||||
f the | ||||
Imageset designer to adjust the alignment and positioning of Images | ||||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param size | \param buffer | |||
Size object describing the size that the Image is to be draw | GeometryBuffer object where the geometry for the image will be queu | |||
n at. | ed. | |||
\param clip_rect | \param position | |||
Rect object that defines an on-screen area that the Image wi | Vector2 object containing the location where the Image is to be dra | |||
ll be clipped to when drawing. | wn. | |||
\param colours | \param size | |||
ColourRect object that describes the colour values to use fo | Size object describing the size that the Image is to be drawn at. | |||
r each corner of the Image. | ||||
\param quad_split_mode | \param clip_rect | |||
One of the QuadSplitMode values specifying the way quads are | Rect object that defines an on-screen area that the Image will be | |||
split into triangles | clipped to when drawing. | |||
\return | \param colours | |||
Nothing | ColourRect object that describes the colour values to use for each | |||
*/ | corner of the Image. | |||
void draw(const Vector3& position, const Size& size, const Rect& | ||||
clip_rect, const ColourRect& colours, QuadSplitMode quad_split_mode = TopLe | ||||
ftToBottomRight) const | ||||
{ | ||||
draw(Rect(position.d_x, position.d_y, position.d_x + size.d_ | ||||
width, position.d_y + size.d_height), position.d_z, clip_rect, colours, qua | ||||
d_split_mode); | ||||
} | ||||
/*! | \param quad_split_mode | |||
\brief | One of the QuadSplitMode values specifying the way the quad geometr | |||
Queue the image to be drawn. | y for | |||
the image is to be split into triangles. | ||||
\note | \return | |||
The final position of the Image will be adjusted by the offs | Nothing | |||
et values defined for this Image object. If absolute positioning is | */ | |||
essential then these values should be taken into account pri | void draw(GeometryBuffer& buffer, const Vector2& position, const Size& | |||
or to calling the draw() methods. However, by doing this you take | size, | |||
away the ability of the Imageset designer to adjust the alig | const Rect* clip_rect, const ColourRect& colours, | |||
nment and positioning of Images, therefore your component is far | QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | |||
less useful since it requires code changes to modify image p | { | |||
ositioning that could have been handled from a data file. | draw(buffer, Rect(position.d_x, position.d_y, | |||
position.d_x + size.d_width, | ||||
position.d_y + size.d_height), | ||||
clip_rect, colours, quad_split_mode); | ||||
} | ||||
\param position | /*! | |||
Vector3 object containing the location where the Image is to | \brief | |||
be drawn | Queue the image to be drawn. | |||
\note | \note | |||
The image will be drawn at it's internally defined size. | The final position of the Image will be adjusted by the offset valu | |||
es | ||||
defined for this Image object. If absolute positioning is essentia | ||||
l | ||||
then these values should be taken into account prior to calling the | ||||
draw() methods. However, by doing this you take away the ability o | ||||
f the | ||||
Imageset designer to adjust the alignment and positioning of Images | ||||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param clip_rect | \param buffer | |||
Rect object that defines an on-screen area that the Image wi | GeometryBuffer object where the geometry for the image will be queu | |||
ll be clipped to when drawing. | ed. | |||
\param colours | \param position | |||
ColourRect object that describes the colour values to use fo | Vector2 object containing the location where the Image is to be dra | |||
r each corner of the Image. | wn | |||
\param quad_split_mode | \note | |||
One of the QuadSplitMode values specifying the way quads are | The image will be drawn at it's internally defined size. | |||
split into triangles | ||||
\return | \param clip_rect | |||
Nothing | Rect object that defines an on-screen area that the Image will be | |||
*/ | clipped to when drawing. | |||
void draw(const Vector3& position, const Rect& clip_rect, const C | ||||
olourRect& colours, QuadSplitMode quad_split_mode = TopLeftToBottomRight) c | ||||
onst | ||||
{ | ||||
draw(Rect(position.d_x, position.d_y, position.d_x + getWidt | ||||
h(), position.d_y + getHeight()), position.d_z, clip_rect, colours, quad_sp | ||||
lit_mode); | ||||
} | ||||
/*! | \param colours | |||
\brief | ColourRect object that describes the colour values to use for each | |||
Queue the image to be drawn. | corner of the Image. | |||
\note | \param quad_split_mode | |||
The final position of the Image will be adjusted by the offs | One of the QuadSplitMode values specifying the way the quad geometr | |||
et values defined for this Image object. If absolute positioning is | y for | |||
essential then these values should be taken into account pri | the image is to be split into triangles. | |||
or to calling the draw() methods. However, by doing this you take | ||||
away the ability of the Imageset designer to adjust the alig | ||||
nment and positioning of Images, therefore your component is far | ||||
less useful since it requires code changes to modify image p | ||||
ositioning that could have been handled from a data file. | ||||
\param position | \return | |||
Vector3 object containing the location where the Image is to | Nothing | |||
be drawn | */ | |||
void draw(GeometryBuffer& buffer, const Vector2& position, | ||||
const Rect* clip_rect, const ColourRect& colours, | ||||
QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | ||||
{ | ||||
draw(buffer, Rect(position.d_x, position.d_y, | ||||
position.d_x + getWidth(), | ||||
position.d_y + getHeight()), | ||||
clip_rect, colours, quad_split_mode); | ||||
} | ||||
\param clip_rect | /*! | |||
Rect object that defines an on-screen area that the Image wi | \brief | |||
ll be clipped to when drawing. | Queue the image to be drawn. | |||
\param top_left_colour | \note | |||
Colour (as 0xAARRGGBB value) to be applied to the top-left c | The final position of the Image will be adjusted by the offset valu | |||
orner of the Image. | es | |||
defined for this Image object. If absolute positioning is essentia | ||||
l | ||||
then these values should be taken into account prior to calling the | ||||
draw() methods. However, by doing this you take away the ability o | ||||
f the | ||||
Imageset designer to adjust the alignment and positioning of Images | ||||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param top_right_colour | \param buffer | |||
Colour (as 0xAARRGGBB value) to be applied to the top-right | GeometryBuffer object where the geometry for the image will be queu | |||
corner of the Image. | ed. | |||
\param bottom_left_colour | \param position | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-lef | Vector2 object containing the location where the Image is to be dra | |||
t corner of the Image. | wn | |||
\param bottom_right_colour | \param clip_rect | |||
Colour (as 0xAARRGGBB value) to be applied to the bottom-rig | Rect object that defines an on-screen area that the Image will be | |||
ht corner of the Image. | clipped to when drawing. | |||
\param quad_split_mode | \param top_left_colour | |||
One of the QuadSplitMode values specifying the way quads are | Colour to be applied to the top-left corner of the Image. | |||
split into triangles | ||||
\return | \param top_right_colour | |||
Nothing | Colour to be applied to the top-right corner of the Image. | |||
*/ | ||||
void draw(const Vector3& position, const Rect& clip_rect, const c | ||||
olour& top_left_colour = 0xFFFFFFFF, const colour& top_right_colour = 0xFFF | ||||
FFFFF, const colour& bottom_left_colour = 0xFFFFFFFF, const colour& bottom_ | ||||
right_colour = 0xFFFFFFFF, QuadSplitMode quad_split_mode = TopLeftToBottomR | ||||
ight) const | ||||
{ | ||||
draw(Rect(position.d_x, position.d_y, position.d_x + getWidt | ||||
h(), position.d_y + getHeight()), position.d_z, clip_rect, ColourRect(top_l | ||||
eft_colour, top_right_colour, bottom_left_colour, bottom_right_colour), qua | ||||
d_split_mode); | ||||
} | ||||
/*! | \param bottom_left_colour | |||
\brief | Colour to be applied to the bottom-left corner of the Image. | |||
Queue the image to be drawn. | ||||
\note | \param bottom_right_colour | |||
The final position of the Image will be adjusted by the offs | Colour to be applied to the bottom-right corner of the Image. | |||
et values defined for this Image object. If absolute positioning is | ||||
essential then these values should be taken into account pri | ||||
or to calling the draw() methods. However, by doing this you take | ||||
away the ability of the Imageset designer to adjust the alig | ||||
nment and positioning of Images, therefore your component is far | ||||
less useful since it requires code changes to modify image p | ||||
ositioning that could have been handled from a data file. | ||||
\param dest_rect | \param quad_split_mode | |||
Rect object defining the area on-screen where the Image is t | One of the QuadSplitMode values specifying the way the quad geometr | |||
o be drawn. The Image will be scaled to fit the area as required. | y for | |||
the image is to be split into triangles. | ||||
\param z | \return | |||
Z-order position for the image. Positions increase "into th | Nothing | |||
e screen", so 0.0f is at the top of the z-order. | */ | |||
void draw(GeometryBuffer& buffer, const Vector2& position, | ||||
const Rect* clip_rect, | ||||
const colour& top_left_colour = 0xFFFFFFFF, | ||||
const colour& top_right_colour = 0xFFFFFFFF, | ||||
const colour& bottom_left_colour = 0xFFFFFFFF, | ||||
const colour& bottom_right_colour = 0xFFFFFFFF, | ||||
QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | ||||
{ | ||||
draw(buffer, Rect(position.d_x, position.d_y, | ||||
position.d_x + getWidth(), | ||||
position.d_y + getHeight()), | ||||
clip_rect, | ||||
ColourRect(top_left_colour, top_right_colour, | ||||
bottom_left_colour, bottom_right_colour), | ||||
quad_split_mode); | ||||
} | ||||
\param clip_rect | /*! | |||
Rect object that defines an on-screen area that the Image wi | \brief | |||
ll be clipped to when drawing. | Queue the image to be drawn. | |||
\param colours | \note | |||
ColourRect object that describes the colour values to use fo | The final position of the Image will be adjusted by the offset valu | |||
r each corner of the Image. | es | |||
defined for this Image object. If absolute positioning is essentia | ||||
l | ||||
then these values should be taken into account prior to calling the | ||||
draw() methods. However, by doing this you take away the ability o | ||||
f the | ||||
Imageset designer to adjust the alignment and positioning of Images | ||||
, | ||||
therefore your component is far less useful since it requires code | ||||
changes to modify image positioning that could have been handled fr | ||||
om a | ||||
data file. | ||||
\param quad_split_mode | \param buffer | |||
One of the QuadSplitMode values specifying the way quads are | GeometryBuffer object where the geometry for the image will be queu | |||
split into triangles | ed. | |||
\return | \param dest_rect | |||
Nothing | Rect object defining the area on-screen where the Image is to be dr | |||
*/ | awn. | |||
void draw(const Rect& dest_rect, float z, const Rect& clip_rect,c | The Image will be scaled to fill the area as required. | |||
onst ColourRect& colours, QuadSplitMode quad_split_mode = TopLeftToBottomRi | ||||
ght) const; | \param clip_rect | |||
Rect object that defines an on-screen area that the Image will be | ||||
clipped to when drawing. | ||||
\param colours | ||||
ColourRect object that describes the colour values to use for each | ||||
corner of the Image. | ||||
\param quad_split_mode | ||||
One of the QuadSplitMode values specifying the way the quad geometr | ||||
y for | ||||
the image is to be split into triangles. | ||||
\return | ||||
Nothing | ||||
*/ | ||||
void draw(GeometryBuffer& buffer, const Rect& dest_rect, | ||||
const Rect* clip_rect, const ColourRect& colours, | ||||
QuadSplitMode quad_split_mode = TopLeftToBottomRight) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Writes an xml representation of this Image object to \a out_stream. | Writes an xml representation of this Image object to \a out_stream. | |||
\param xml_stream | \param xml_stream | |||
Stream where xml data should be output. | Stream where xml data should be output. | |||
\return | \return | |||
Nothing. | Nothing. | |||
End of changes. 56 change blocks. | ||||
253 lines changed or deleted | 312 lines changed or added | |||
CEGUIImageset.h | CEGUIImageset.h | |||
---|---|---|---|---|
skipping to change at line 63 | skipping to change at line 63 | |||
/*! | /*! | |||
\brief | \brief | |||
Offers functions to define, access, and draw, a set of image compone nts on a single graphical surface or Texture. | Offers functions to define, access, and draw, a set of image compone nts on a single graphical surface or Texture. | |||
Imageset objects are a means by which a single graphical image (file , Texture, etc), can be split into a number | Imageset objects are a means by which a single graphical image (file , Texture, etc), can be split into a number | |||
of 'components' which can later be accessed via name. The component s of an Imageset can queried for | of 'components' which can later be accessed via name. The component s of an Imageset can queried for | |||
various details, and sent to the Renderer object for drawing. | various details, and sent to the Renderer object for drawing. | |||
*/ | */ | |||
class CEGUIEXPORT Imageset | class CEGUIEXPORT Imageset | |||
{ | { | |||
friend class Imageset_xmlHandler; | ||||
private: | ||||
typedef std::map<String, Image, String::FastLessCompare> Imag eRegistry; | typedef std::map<String, Image, String::FastLessCompare> Imag eRegistry; | |||
/******************************************************************* | public: | |||
****** | ||||
Friends to allow access to constructors and destructors | ||||
******************************************************************** | ||||
*****/ | ||||
friend Imageset* ImagesetManager::createImageset(const String | ||||
& name, Texture* texture); | ||||
friend Imageset* ImagesetManager::createImageset(const String | ||||
& filename, const String& resourceGroup); | ||||
friend Imageset* ImagesetManager::createImagesetFromImageFile | ||||
(const String& name, const String& filename, const String& resourceGroup); | ||||
friend void ImagesetManager::destroyImageset(con | ||||
st String& name); | ||||
/******************************************************************* | ||||
****** | ||||
Construction and Destruction (private, only ImagesetManager | ||||
can | ||||
create and destroy Imageset objects). | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | /*! | |||
\brief | \brief | |||
Construct a new Imageset object. Object will initially have no Images defined | Construct a new Imageset object. Object will initially have no Images defined | |||
\param texture | \param texture | |||
Texture object that holds the imagery for the Imageset being created. | Texture object that holds the imagery for the Imageset being created. | |||
*/ | */ | |||
Imageset(const String& name, Texture* texture); | Imageset(const String& name, Texture& texture); | |||
/*! | /*! | |||
\brief | \brief | |||
Construct a new Imageset object using data contained in the | ||||
specified file. | ||||
\param filename | ||||
String object that holds the name of the Imageset data file | ||||
that is to be processed. | ||||
\param resourceGroup | ||||
Resource group identifier to be passed to the resource manager. NB | ||||
: This affects the | ||||
imageset xml file only, the texture loaded may have its own group s | ||||
pecified in the XML file. | ||||
\exception FileIOException thrown if something goes wro | ||||
ng while processing the file \a filename. | ||||
*/ | ||||
Imageset(const String& filename, const String& resourceGroup); | ||||
/*! | ||||
\brief | ||||
Construct a new Imageset using the specified image file and imagese t name. The created | Construct a new Imageset using the specified image file and imagese t name. The created | |||
imageset will, by default, have a single Image defined named "full_ image" which represents | imageset will, by default, have a single Image defined named "full_ image" which represents | |||
the entire area of the loaded image file. | the entire area of the loaded image file. | |||
\note | \note | |||
Under certain renderers it may be required that the source image di mensions be some | Under certain renderers it may be required that the source image di mensions be some | |||
power of 2, if this condition is not met then stretching and other undesired side-effects | power of 2, if this condition is not met then stretching and other undesired side-effects | |||
may be experienced. To be safe from such effects it is generally r ecommended that all | may be experienced. To be safe from such effects it is generally r ecommended that all | |||
images that you load have dimensions that are some power of 2. | images that you load have dimensions that are some power of 2. | |||
skipping to change at line 130 | skipping to change at line 102 | |||
of some format that is supported by the Renderer that is in use. | of some format that is supported by the Renderer that is in use. | |||
\param resourceGroup | \param resourceGroup | |||
Resource group identifier to be passed to the resource manager, whi ch may specify a group | Resource group identifier to be passed to the resource manager, whi ch may specify a group | |||
from which the image file is to be loaded. | from which the image file is to be loaded. | |||
\exception FileIOException thrown if something goes wrong while loading the image. | \exception FileIOException thrown if something goes wrong while loading the image. | |||
*/ | */ | |||
Imageset(const String& name, const String& filename, const String& reso urceGroup); | Imageset(const String& name, const String& filename, const String& reso urceGroup); | |||
public: // For luabind support | ||||
/*! | /*! | |||
\brief | \brief | |||
Destroys Imageset objects | Destroys Imageset objects | |||
*/ | */ | |||
~Imageset(void); | ~Imageset(void); | |||
public: | ||||
typedef ConstBaseIterator<ImageRegistry> ImageIterator; //!< Iterator type for this collection | typedef ConstBaseIterator<ImageRegistry> ImageIterator; //!< Iterator type for this collection | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Public interface | Public interface | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
return Texture object for this Imageset | return Texture object for this Imageset | |||
\return | \return | |||
skipping to change at line 346 | skipping to change at line 316 | |||
\param render_offset | \param render_offset | |||
Point object describing the offsets, in pixels, that are to be applied to the Image when it is drawn. | Point object describing the offsets, in pixels, that are to be applied to the Image when it is drawn. | |||
\return | \return | |||
Nothing | Nothing | |||
\exception AlreadyExistsException thrown if an Image named \a name is already defined for this Imageset | \exception AlreadyExistsException thrown if an Image named \a name is already defined for this Imageset | |||
*/ | */ | |||
void defineImage(const String& name, const Rect& image_rect, cons t Point& render_offset); | void defineImage(const String& name, const Rect& image_rect, cons t Point& render_offset); | |||
/*! | /*! | |||
\brief | \brief | |||
Queues an area of the associated Texture the be drawn on the | Queues an area of the associated Texture the be drawn on the screen | |||
screen. Low-level routine to be used carefully! | . | |||
Low-level routine to be used carefully! | ||||
\param source_rect | \param buffer | |||
Rect object describing the area of the image file / texture | GeometryBuffer object where the geometry for the area to be drawn w | |||
that is to be queued for drawing | ill | |||
be queued. | ||||
\param dest_rect | \param source_rect | |||
Rect describing the area of the screen that will be filled w | Rect object describing the area of the image file / texture that is | |||
ith the imagery from \a source_rect. | to | |||
be queued for drawing | ||||
\param z | \param dest_rect | |||
float value specifying 'z' order. 0 is topmost with increas | Rect describing the area of the screen that will be filled with the | |||
ing values moving back into the screen. | imagery from \a source_rect. | |||
\param clip_rect | \param clip_rect | |||
Rect object describing a 'clipping rectangle' that will be a | Rect object describing a 'clipping rectangle' that will be applied | |||
pplied when drawing the requested imagery | when | |||
drawing the requested imagery | ||||
\param colours | \param colours | |||
ColourRect object holding the ARGB colours to be applied to | ColourRect object holding the ARGB colours to be applied to the fou | |||
the four corners of the rendered imagery. | r | |||
corners of the rendered imagery. | ||||
\param quad_split_mode | \param quad_split_mode | |||
One of the QuadSplitMode values specifying the way quads are | One of the QuadSplitMode values specifying the way the quad geometr | |||
split into triangles | y for | |||
the image is to be split into triangles. | ||||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void draw(const Rect& source_rect, const Rect& dest_rect, float z | void draw(GeometryBuffer& buffer, const Rect& source_rect, | |||
, const Rect& clip_rect,const ColourRect& colours, QuadSplitMode quad_split | const Rect& dest_rect, const Rect* clip_rect, | |||
_mode) const; | const ColourRect& colours, QuadSplitMode quad_split_mode) con | |||
st; | ||||
/*! | /*! | |||
\brief | \brief | |||
Queues an area of the associated Texture the be drawn on the | Queues an area of the associated Texture the be drawn on the screen | |||
screen. Low-level routine to be used carefully! | . | |||
Low-level routine to be used carefully! | ||||
\param source_rect | \param buffer | |||
Rect object describing the area of the image file / texture | GeometryBuffer object where the geometry for the area to be drawn w | |||
that is to be queued for drawing | ill | |||
be queued. | ||||
\param dest_rect | \param source_rect | |||
Rect describing the area of the screen that will be filled w | Rect object describing the area of the image file / texture that is | |||
ith the imagery from \a source_rect. | to | |||
be queued for drawing. | ||||
\param z | \param dest_rect | |||
float value specifying 'z' order. 0 is topmost with increas | Rect describing the area of the screen that will be filled with the | |||
ing values moving back into the screen. | imagery from \a source_rect. | |||
\param clip_rect | \param clip_rect | |||
Rect object describing a 'clipping rectangle' that will be a | Rect object describing a 'clipping rectangle' that will be applied | |||
pplied when drawing the requested imagery | when | |||
drawing the requested imagery. | ||||
\param top_left_colour | \param top_left_colour | |||
colour to be applied to the top left corner of the rendered | colour to be applied to the top left corner of the rendered imagery | |||
imagery. | . | |||
\param top_right_colour | \param top_right_colour | |||
colour to be applied to the top right corner of the rendered | colour to be applied to the top right corner of the rendered imager | |||
imagery. | y. | |||
\param bottom_left_colour | \param bottom_left_colour | |||
colour to be applied to the bottom left corner of the render | colour to be applied to the bottom left corner of the rendered imag | |||
ed imagery. | ery. | |||
\param bottom_right_colour | \param bottom_right_colour | |||
colour to be applied to the bottom right corner of the rende | colour to be applied to the bottom right corner of the rendered ima | |||
red imagery. | gery. | |||
\param quad_split_mode | \param quad_split_mode | |||
One of the QuadSplitMode values specifying the way quads are | One of the QuadSplitMode values specifying the way the quad geometr | |||
split into triangles | y for | |||
the image is to be split into triangles. | ||||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void draw(const Rect& source_rect, const Rect& dest_rect, float z | void draw(GeometryBuffer& buffer, const Rect& source_rect, | |||
, const Rect& clip_rect, const colour& top_left_colour = 0xFFFFFFFF, const | const Rect& dest_rect, const Rect* clip_rect, | |||
colour& top_right_colour = 0xFFFFFFFF, const colour& bottom_left_colour = | const colour& top_left_colour = 0xFFFFFFFF, | |||
0xFFFFFFFF, const colour& bottom_right_colour = 0xFFFFFFFF, QuadSplitMode q | const colour& top_right_colour = 0xFFFFFFFF, | |||
uad_split_mode = TopLeftToBottomRight) const | const colour& bottom_left_colour = 0xFFFFFFFF, | |||
{ | const colour& bottom_right_colour = 0xFFFFFFFF, | |||
draw(source_rect, dest_rect, z, clip_rect, ColourRect(top_le | QuadSplitMode quad_split_mode = TopLeftToBottomRight) const | |||
ft_colour, top_right_colour, bottom_left_colour, bottom_right_colour), quad | { | |||
_split_mode); | draw(buffer, source_rect, dest_rect, clip_rect, | |||
} | ColourRect(top_left_colour, top_right_colour, | |||
bottom_left_colour, bottom_right_colour), | ||||
quad_split_mode); | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether this Imageset is auto-scaled. | Return whether this Imageset is auto-scaled. | |||
\return | \return | |||
true if Imageset is auto-scaled, false if not. | true if Imageset is auto-scaled, false if not. | |||
*/ | */ | |||
bool isAutoScaled(void) const {return d_autoScale; } | bool isAutoScaled(void) const {return d_autoScale; } | |||
skipping to change at line 454 | skipping to change at line 448 | |||
Set the native resolution for this Imageset | Set the native resolution for this Imageset | |||
\param size | \param size | |||
Size object describing the new native screen resolution for this Imageset. | Size object describing the new native screen resolution for this Imageset. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setNativeResolution(const Size& size); | void setNativeResolution(const Size& size); | |||
/*! | /*! | |||
\brief | \brief | |||
Notify the Imageset of the current (usually new) display res | Notify the Imageset that the display size may have changed. | |||
olution. | ||||
\param size | ||||
Size object describing the display resolution | ||||
\return | \param size | |||
Nothing | Size object describing the display resolution | |||
*/ | */ | |||
void notifyScreenResolution(const Size& size); | void notifyDisplaySizeChanged(const Size& size); | |||
/*! | /*! | |||
\brief | \brief | |||
Return an Imageset::ImageIterator object that can be used to iterate over the Image objects in the Imageset. | Return an Imageset::ImageIterator object that can be used to iterate over the Image objects in the Imageset. | |||
*/ | */ | |||
ImageIterator getIterator(void) const; | ImageIterator getIterator(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Writes an xml representation of this Imageset to \a out_stream. | Writes an xml representation of this Imageset to \a out_stream. | |||
skipping to change at line 513 | skipping to change at line 504 | |||
\return | \return | |||
String describing the default resource group identifier that will b e | String describing the default resource group identifier that will b e | |||
used when loading Imageset data. | used when loading Imageset data. | |||
*/ | */ | |||
static const String& getDefaultResourceGroup() | static const String& getDefaultResourceGroup() | |||
{ return d_defaultResourceGroup; } | { return d_defaultResourceGroup; } | |||
protected: | protected: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Constants | ||||
******************************************************************** | ||||
*****/ | ||||
static const char ImagesetSchemaName[]; //!< | ||||
Filename of the XML schema used for validating Imageset files. | ||||
/******************************************************************* | ||||
****** | ||||
Implementation Functions | Implementation Functions | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Initialise the Imageset with information taken from the spec | ||||
ified file. | ||||
\param filename | ||||
String object that holds the name of the Imageset data file | ||||
that is to be processed. | ||||
\param resourceGroup | ||||
Resource group identifier to be passed to the resource manager. NB | ||||
: This affects the | ||||
imageset xml file only, the texture loaded may have its own group s | ||||
pecified in the XML file. | ||||
\return | ||||
Nothing | ||||
\exception FileIOException thrown if something goes wro | ||||
ng while processing the file \a filename. | ||||
*/ | ||||
void load(const String& filename, const String& resourceGroup); | ||||
/*! | ||||
\brief | ||||
Unloads all loaded data and leaves the Imageset in a clean ( but un-usable) state. This should be called for cleanup purposes only. | Unloads all loaded data and leaves the Imageset in a clean ( but un-usable) state. This should be called for cleanup purposes only. | |||
*/ | */ | |||
void unload(void); | void unload(void); | |||
/*! | /*! | |||
\brief | \brief | |||
set the Texture object to be used by this Imageset. Changin g textures on an Imageset that is in use is not a good idea! | set the Texture object to be used by this Imageset. Changin g textures on an Imageset that is in use is not a good idea! | |||
\param texture | \param texture | |||
Texture object to be used by the Imageset. The old texture is NOT disposed of, that is the clients responsibility. | Texture object to be used by the Imageset. The old texture is NOT disposed of, that is the clients responsibility. | |||
End of changes. 29 change blocks. | ||||
160 lines changed or deleted | 96 lines changed or added | |||
CEGUIImagesetManager.h | CEGUIImagesetManager.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIImagesetManager.h | filename: CEGUIImagesetManager.h | |||
created: 21/2/2004 | created: Sat Jul 18 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines interface for ImagesetManager object | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 34 | skipping to change at line 32 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIImagesetManager_h_ | #ifndef _CEGUIImagesetManager_h_ | |||
#define _CEGUIImagesetManager_h_ | #define _CEGUIImagesetManager_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | ||||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
#include "CEGUINamedXMLResourceManager.h" | ||||
#include "CEGUIImageset.h" | ||||
#include "CEGUIImageset_xmlHandler.h" | ||||
#include "CEGUIIteratorBase.h" | #include "CEGUIIteratorBase.h" | |||
#include <map> | ||||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class providing a shared library of Imageset objects to the system. | Class providing a shared library of Imageset objects to the system. | |||
The ImagesetManager is used to create, access, and destroy Imageset | The ImagesetManager is used to create, access, and destroy Imageset obj | |||
objects. The idea is that | ects. | |||
the ImagesetManager will function as a central repository for imager | The idea is that the ImagesetManager will function as a central reposit | |||
y used within the GUI system, | ory | |||
and that such imagery can be accessed, via a unique name, by any int | for imagery used within the GUI system, and that such imagery can be | |||
erested party within the system. | accessed, via a unique name, by any interested party within the system. | |||
*/ | */ | |||
class CEGUIEXPORT ImagesetManager : public Singleton<ImagesetManager> | class CEGUIEXPORT ImagesetManager : | |||
public Singleton<ImagesetManager>, | ||||
public NamedXMLResourceManager<Imageset, Imageset_xmlHandler> | ||||
{ | { | |||
public: | public: | |||
/*! | //! Constructor for ImagesetManager objects | |||
\brief | ImagesetManager(); | |||
Constructor for ImagesetManager objects | ||||
*/ | ||||
ImagesetManager(void); | ||||
/*! | ||||
\brief | ||||
Destructor for ImagesetManager objects | ||||
*/ | ||||
~ImagesetManager(void); | ||||
/*! | ||||
\brief | ||||
Create a Imageset object with the given name and Texture | ||||
The created Imageset will be of limited use, and will requir | ||||
e one or more images to be defined for the set. | ||||
\param name | ||||
String object containing the unique name for the Imageset be | ||||
ing created. | ||||
\param texture | //! Destructor for ImagesetManager objects | |||
Texture object to be associated with the Imageset | ~ImagesetManager(); | |||
\return | /*! | |||
Pointer to the newly created Imageset object | \brief | |||
Create a Imageset object with the given name and Texture | ||||
\exception AlreadyExistsException Thrown if an Imageset named | The created Imageset will be of limited use, and will require one o | |||
\a name is already present in the system. | r | |||
*/ | more images to be defined for the set. | |||
Imageset* createImageset(const String& name, Texture* texture) | ||||
; | ||||
/*! | \param name | |||
\brief | String object containing the unique name for the Imageset being cre | |||
Create an Imageset object from the specified file | ated. | |||
\param filename | \param texture | |||
String object holding the name of the Imageset definition fi | Texture object to be associated with the Imageset | |||
le which should be used to create the Imageset | ||||
\param resourceGroup | \param action | |||
Resource group identifier to be passed to the resource manager. NB | One of the XMLResourceExistsAction enumerated values indicating wha | |||
: This affects the | t | |||
imageset xml file only, the texture loaded may have its own group s | action should be taken when an Imageset with the specified name | |||
pecified in the XML file. | already exists. | |||
\return | \return | |||
Pointer to the newly created Imageset object | Reference to the newly created Imageset object | |||
\exception AlreadyExistsException Thrown if an Imageset named | \exception AlreadyExistsException | |||
\a name is already present in the system. | thrown if an Imageset named \a name is already present in the syste | |||
\exception FileIOException Thrown if something | m. | |||
goes wrong while processing the file \a filename. | */ | |||
*/ | Imageset& create(const String& name, Texture& texture, | |||
Imageset* createImageset(const String& filename, const String& | XMLResourceExistsAction action = XREA_RETURN); | |||
resourceGroup = ""); | ||||
/*! | /*! | |||
\brief | \brief | |||
Create an Imageset object from the specified image file. The Image | Create an Imageset object from the specified image file. The Image | |||
set will initially have a single | set | |||
image defined named "full_image" which is an image that represents | will initially have a single image defined named "full_image" which | |||
the entire area of the loaded image. | is | |||
an image that represents the entire area of the loaded image. | ||||
\param name | \param name | |||
String object containing the unique name for the Imageset being cre ated. | String object containing the unique name for the Imageset being cre ated. | |||
\param filename | \param filename | |||
String object holding the name of the image file to be loaded. | String object holding the name of the image file to be loaded. | |||
\param resourceGroup | \param resourceGroup | |||
Resource group identifier to be passed to the resource manager when | Resource group identifier to be passed to the resource manager when | |||
loading the image file. | loading the image file. | |||
\return | ||||
Pointer to the newly created Imageset object | ||||
\exception AlreadyExistsException Thrown if an Imageset named \a name | ||||
is already present in the system. | ||||
\exception FileIOException Thrown if something goes wro | ||||
ng while reading the image file \a filename. | ||||
*/ | ||||
Imageset* createImagesetFromImageFile(const String& name, const String& | ||||
filename, const String& resourceGroup = ""); | ||||
/*! | ||||
\brief | ||||
Destroys the Imageset with the specified name | ||||
\param name | ||||
String object containing the name of the Imageset to be dest | ||||
royed. If no such Imageset exists, nothing happens. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void destroyImageset(const String& name); | ||||
/*! | ||||
\brief | ||||
Destroys the given Imageset object | ||||
\param imageset | ||||
Pointer to the Imageset to be destroyed. If no such Imagese | ||||
t exists, nothing happens. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void destroyImageset(Imageset* imageset); | ||||
/*! | ||||
\brief | ||||
Destroys all Imageset objects registered in the system | ||||
\return | ||||
Nothing | ||||
*/ | ||||
void destroyAllImagesets(void); | ||||
/*! | ||||
\brief | ||||
Returns a pointer to the Imageset object with the specified | ||||
name | ||||
\param name | ||||
String object containing the name of the Imageset to return | ||||
a pointer to | ||||
\return | ||||
Pointer to the requested Imageset object | ||||
\exception UnknownObjectException Thrown if no Imageset named | ||||
\a name is present in within the system | ||||
*/ | ||||
Imageset* getImageset(const String& name) const; | ||||
/*! | \param action | |||
\brief | One of the XMLResourceExistsAction enumerated values indicating wha | |||
Check for the existence of a named Imageset | t | |||
action should be taken when an Imageset with the specified name | ||||
already exists. | ||||
\param name | \return | |||
String object containing the name of the Imageset to look fo | Reference to the newly created Imageset object | |||
r | ||||
\return | \exception AlreadyExistsException | |||
true if an Imageset named \a name is presently loaded in the | thrown if an Imageset named \a name is already present in the syste | |||
system, else false. | m. | |||
*/ | ||||
bool isImagesetPresent(const String& name) const | ||||
{return d_imagesets.find(name) != d_imagesets.end();} | ||||
/*! | \exception FileIOException | |||
\brief | thrown if something goes wrong while reading the image file \a file | |||
Notify the ImagesetManager of the current (usually new) disp | name. | |||
lay resolution. | */ | |||
Imageset& createFromImageFile(const String& name, const String& filenam | ||||
e, | ||||
const String& resourceGroup = "", | ||||
XMLResourceExistsAction action = XREA_RETUR | ||||
N); | ||||
\param size | /*! | |||
Size object describing the display resolution | \brief | |||
Notify the ImagesetManager that the display size may have changed. | ||||
\return | \param size | |||
Nothing | Size object describing the display resolution | |||
*/ | */ | |||
void notifyScreenResolution(const Size& size); | void notifyDisplaySizeChanged(const Size& size); | |||
/*! | /*! | |||
\brief | \brief | |||
Writes a full XML imageset for the specified Imageset to the given | Writes a full XML imageset for the specified Imageset to the given | |||
OutStream. | OutStream. | |||
\param imageset | \param imageset | |||
String holding the name of the Imageset to be written to the stream . | String holding the name of the Imageset to be written to the stream . | |||
\param out_stream | \param out_stream | |||
OutStream (std::ostream based) object where data is to be sent. | OutStream (std::ostream based) object where data is to be sent. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void writeImagesetToStream(const String& imageset, OutStream& out_strea | void writeImagesetToStream(const String& imageset, | |||
m) const; | OutStream& out_stream) const; | |||
private: | //! ImagesetIterator type definition. | |||
/******************************************************************* | typedef ConstBaseIterator<ObjectRegistry> ImagesetIterator; | |||
****** | ||||
Implementation Data | ||||
******************************************************************** | ||||
*****/ | ||||
typedef std::map<String, Imageset*, String::FastLessCompare> | ||||
ImagesetRegistry; | ||||
ImagesetRegistry d_imagesets; | ||||
public: | /*! | |||
/******************************************************************* | \brief | |||
****** | Return a ImagesetManager::ImagesetIterator object to iterate over t | |||
Iterator stuff | he | |||
******************************************************************** | available Imageset objects. | |||
*****/ | */ | |||
typedef ConstBaseIterator<ImagesetRegistry> ImagesetIterator; | ImagesetIterator getIterator() const; | |||
/*! | // ensure we see overloads from template base class | |||
\brief | using NamedXMLResourceManager<Imageset, Imageset_xmlHandler>::create; | |||
Return a ImagesetManager::ImagesetIterator object to iterate | ||||
over the available Imageset objects. | ||||
*/ | ||||
ImagesetIterator getIterator(void) const; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIImageSetManager_h_ | #endif // end of guard _CEGUIImageSetManager_h_ | |||
End of changes. 33 change blocks. | ||||
188 lines changed or deleted | 97 lines changed or added | |||
CEGUIImageset_xmlHandler.h | CEGUIImageset_xmlHandler.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIImageset_xmlHandler.h | filename: CEGUIImageset_xmlHandler.h | |||
created: 21/2/2004 | created: Sat Jul 18 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines the interface for the Imageset class | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIImageset_xmlHandler_h_ | #ifndef _CEGUIImageset_xmlHandler_h_ | |||
#define _CEGUIImageset_xmlHandler_h_ | #define _CEGUIImageset_xmlHandler_h_ | |||
#include "CEGUIImageset.h" | ||||
#include "CEGUIXMLHandler.h" | #include "CEGUIXMLHandler.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
//! Class used to parse the Imageset XML files to create Imageset objects | ||||
/************************************************************************* | class CEGUIEXPORT Imageset_xmlHandler : public XMLHandler | |||
Implementation Classes | ||||
*************************************************************************/ | ||||
/*! | ||||
\brief | ||||
Handler class used to parse the Imageset XML files using SAX2 | ||||
*/ | ||||
class Imageset_xmlHandler : public XMLHandler | ||||
{ | { | |||
public: | public: | |||
/******************************************************************* | //! Constructor. | |||
****** | Imageset_xmlHandler(const String& filename, const String& resource_grou | |||
Construction & Destruction | p); | |||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Constructor for Imageset::xmlHandler objects | ||||
\param imageset | //! Destructor. | |||
Pointer to the Imageset object creating this xmlHandler object | ~Imageset_xmlHandler(); | |||
*/ | ||||
Imageset_xmlHandler(Imageset* imageset) : d_imageset(imageset) {} | ||||
/*! | //! Return string holding the name of the created Imageset. | |||
\brief | const String& getObjectName() const; | |||
Destructor for Imageset::xmlHandler objects | ||||
*/ | ||||
virtual ~Imageset_xmlHandler(void) {} | ||||
/******************************************************************* | //! Return reference to the created Imageset object. | |||
****** | Imageset& getObject() const; | |||
SAX2 Handler overrides | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
document processing (only care about elements, schema validates form | ||||
at) | ||||
*/ | ||||
virtual void elementStart(const String& element, const XMLAttributes& a | ||||
ttributes); | ||||
virtual void elementEnd(const String& element); | ||||
/******************************************************************* | // XMLHandler overrides | |||
****** | void elementStart(const String& element, const XMLAttributes& attribute | |||
Functions used by our implementation | s); | |||
******************************************************************** | void elementEnd(const String& element); | |||
*****/ | ||||
Imageset* getImageset(void) const {ret | ||||
urn d_imageset;} | ||||
private: | private: | |||
/******************************************************************* | //! Method that handles the opening Imageset XML element. | |||
****** | ||||
Implementation Constants | ||||
******************************************************************** | ||||
*****/ | ||||
static const String ImagesetElement; //!< | ||||
Tag name for Imageset elements. | ||||
static const String ImageElement; | ||||
//!< Tag name for Image elements. | ||||
static const String ImagesetNameAttribute; //!< Attribu | ||||
te name that stores the name of the Imageset | ||||
static const String ImagesetImageFileAttribute; //!< Attribute name | ||||
that stores the filename for the image file. | ||||
static const String ImagesetResourceGroupAttribute; //!< Attribute na | ||||
me that stores the resource group identifier used when loading image file. | ||||
static const String ImagesetNativeHorzResAttribute; //!< Optiona | ||||
l attribute that stores 'native' horizontal resolution for the Imageset. | ||||
static const String ImagesetNativeVertResAttribute; //!< Optiona | ||||
l attribute that stores 'native' vertical resolution for the Imageset. | ||||
static const String ImagesetAutoScaledAttribute; //!< Optiona | ||||
l attribute that specifies whether the Imageset should be auto-scaled. | ||||
static const String ImageNameAttribute; //!< Attribu | ||||
te name that stores the name of the new Image. | ||||
static const String ImageXPosAttribute; //!< Attribu | ||||
te name that stores the x position of the new Image. | ||||
static const String ImageYPosAttribute; //!< Attribu | ||||
te name that stores the y position of the new Image. | ||||
static const String ImageWidthAttribute; //!< | ||||
Attribute name that stores the width of the new Image. | ||||
static const String ImageHeightAttribute; //!< | ||||
Attribute name that stores the height of the new Image. | ||||
static const String ImageXOffsetAttribute; //!< Attribu | ||||
te name that stores the x rendering offset of the new Image. | ||||
static const String ImageYOffsetAttribute; //!< Attribu | ||||
te name that stores the y rendering offset of the new Image. | ||||
/*! | ||||
\brief | ||||
Method that handles the opening Imageset XML element. | ||||
*/ | ||||
void elementImagesetStart(const XMLAttributes& attributes); | void elementImagesetStart(const XMLAttributes& attributes); | |||
//! Method that handles the Image XML element. | ||||
/*! | ||||
\brief | ||||
Method that handles the Image XML element. | ||||
*/ | ||||
void elementImageStart(const XMLAttributes& attributes); | void elementImageStart(const XMLAttributes& attributes); | |||
//! Method that handles the closing Imageset XML element. | ||||
/*! | ||||
\brief | ||||
Method that handles the closing Imageset XML element. | ||||
*/ | ||||
void elementImagesetEnd(); | void elementImagesetEnd(); | |||
/******************************************************************* | //! Filename of the XML schema used for validating Imageset files. | |||
****** | static const String ImagesetSchemaName; | |||
Implementation Data | //! Tag name for Imageset elements. | |||
******************************************************************** | static const String ImagesetElement; | |||
*****/ | //! Tag name for Image elements. | |||
Imageset* d_imageset; //!< Holds a pointer | static const String ImageElement; | |||
to the Imageset that created the handler object | //! Attribute name that stores the name of the Imageset | |||
static const String ImagesetNameAttribute; | ||||
//! Attribute name that stores the filename for the image file. | ||||
static const String ImagesetImageFileAttribute; | ||||
//! Attribute name that stores resource group used when loading image f | ||||
ile. | ||||
static const String ImagesetResourceGroupAttribute; | ||||
//! Attribute that stores 'native' horizontal resolution for the Images | ||||
et. | ||||
static const String ImagesetNativeHorzResAttribute; | ||||
//! Attribute that stores 'native' vertical resolution for the Imageset | ||||
. | ||||
static const String ImagesetNativeVertResAttribute; | ||||
//! Attribute that specifies whether the Imageset should be auto-scaled | ||||
. | ||||
static const String ImagesetAutoScaledAttribute; | ||||
//! Attribute name that stores the name of the new Image. | ||||
static const String ImageNameAttribute; | ||||
//! Attribute name that stores the x position of the new Image. | ||||
static const String ImageXPosAttribute; | ||||
//! Attribute name that stores the y position of the new Image. | ||||
static const String ImageYPosAttribute; | ||||
//! Attribute name that stores the width of the new Image. | ||||
static const String ImageWidthAttribute; | ||||
//! Attribute name that stores the height of the new Image. | ||||
static const String ImageHeightAttribute; | ||||
//! Attribute name that stores the x rendering offset of the new Image. | ||||
static const String ImageXOffsetAttribute; | ||||
//!< Attribute name that stores the y rendering offset of the new Image | ||||
. | ||||
static const String ImageYOffsetAttribute; | ||||
//! Pointer to the Imageset created. | ||||
Imageset* d_imageset; | ||||
//! inidcates whether client read the created object | ||||
mutable bool d_objectRead; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIImageset_xmlHandler_h_ | #endif // end of guard _CEGUIImageset_xmlHandler_h_ | |||
End of changes. 14 change blocks. | ||||
110 lines changed or deleted | 64 lines changed or added | |||
CEGUIInputEvent.h | CEGUIInputEvent.h | |||
---|---|---|---|---|
skipping to change at line 245 | skipping to change at line 245 | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
EventArgs based class that is used for objects passed to handlers tr iggered for events | EventArgs based class that is used for objects passed to handlers tr iggered for events | |||
concerning some Window object. | concerning some Window object. | |||
*/ | */ | |||
class CEGUIEXPORT WindowEventArgs : public EventArgs | class CEGUIEXPORT WindowEventArgs : public EventArgs | |||
{ | { | |||
public: | public: | |||
WindowEventArgs(Window* wnd) : window(wnd) { | WindowEventArgs(Window* wnd) : window(wnd) {} | |||
this->d_hasWindow = true; | ||||
} | ||||
Window* window; //!< pointer to a Window object of relevance to the event. | Window* window; //!< pointer to a Window object of relevance to the event. | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
WindowEventArgs class that is primarily used by lua scripts | WindowEventArgs class that is primarily used by lua scripts | |||
*/ | */ | |||
class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs | class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs | |||
{ | { | |||
skipping to change at line 337 | skipping to change at line 335 | |||
\brief | \brief | |||
EventArgs based class used for certain drag/drop notifications | EventArgs based class used for certain drag/drop notifications | |||
*/ | */ | |||
class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs | class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs | |||
{ | { | |||
public: | public: | |||
DragDropEventArgs(Window* wnd) : WindowEventArgs(wnd) {} | DragDropEventArgs(Window* wnd) : WindowEventArgs(wnd) {} | |||
DragContainer* dragDropItem; //<! pointer to the DragContainer wind ow being dragged / dropped. | DragContainer* dragDropItem; //<! pointer to the DragContainer wind ow being dragged / dropped. | |||
}; | }; | |||
/*! | ||||
\brief | ||||
EventArgs based class that is used for notifications regarding the main | ||||
display. | ||||
*/ | ||||
class CEGUIEXPORT DisplayEventArgs : public EventArgs | ||||
{ | ||||
public: | ||||
DisplayEventArgs(const Size& sz) : size(sz) {} | ||||
//! current / new size of the display. | ||||
Size size; | ||||
}; | ||||
//! EventArgs based class that is used for notifications regarding resource | ||||
s. | ||||
class CEGUIEXPORT ResourceEventArgs : public EventArgs | ||||
{ | ||||
public: | ||||
ResourceEventArgs(const String& type, const String& name) : | ||||
resourceType(type), | ||||
resourceName(name) | ||||
{} | ||||
//! String identifying the resource type this notification is about. | ||||
String resourceType; | ||||
//! String identifying the name of the resource this notification is ab | ||||
out. | ||||
String resourceName; | ||||
}; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIInputEvent_h_ | #endif // end of guard _CEGUIInputEvent_h_ | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 32 lines changed or added | |||
CEGUIItemEntry.h | CEGUIItemEntry.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemEntry_h_ | #ifndef _CEGUIItemEntry_h_ | |||
#define _CEGUIItemEntry_h_ | #define _CEGUIItemEntry_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIItemEntryProperties.h" | #include "CEGUIItemEntryProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIItemEntryProperties.h | CEGUIItemEntryProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemEntryProperties_h_ | #ifndef _CEGUIItemEntryProperties_h_ | |||
#define _CEGUIItemEntryProperties_h_ | #define _CEGUIItemEntryProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemEntryProperties namespace section | // Start of ItemEntryProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interface for the ItemEntry class | Namespace containing all classes that make up the properties interface for the ItemEntry class | |||
*/ | */ | |||
namespace ItemEntryProperties | namespace ItemEntryProperties | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIItemListBase.h | CEGUIItemListBase.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemListBase_h_ | #ifndef _CEGUIItemListBase_h_ | |||
#define _CEGUIItemListBase_h_ | #define _CEGUIItemListBase_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIItemListBaseProperties.h" | #include "CEGUIItemListBaseProperties.h" | |||
#include "elements/CEGUIItemEntry.h" | #include "CEGUIItemEntry.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
skipping to change at line 355 | skipping to change at line 355 | |||
A pointer to the content pane window, or 'this' if children are add ed | A pointer to the content pane window, or 'this' if children are add ed | |||
directly to this window. | directly to this window. | |||
*/ | */ | |||
Window* getContentPane(void) const {return d_pane;} | Window* getContentPane(void) const {return d_pane;} | |||
/*! | /*! | |||
\brief | \brief | |||
Notify this ItemListBase that the given item was just clicked. | Notify this ItemListBase that the given item was just clicked. | |||
Internal function - NOT to be used from client code. | Internal function - NOT to be used from client code. | |||
*/ | */ | |||
virtual void notifyItemClicked(ItemEntry* li) {} | virtual void notifyItemClicked(ItemEntry*) {} | |||
/*! | /*! | |||
\brief | \brief | |||
Notify this ItemListBase that the given item just changed selection state. | Notify this ItemListBase that the given item just changed selection state. | |||
Internal function - NOT to be used from client code. | Internal function - NOT to be used from client code. | |||
*/ | */ | |||
virtual void notifyItemSelectState(ItemEntry* li, bool state) {} | virtual void notifyItemSelectState(ItemEntry*, bool) {} | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether the list should be sorted (by text). | Set whether the list should be sorted (by text). | |||
*/ | */ | |||
void setSortEnabled(bool setting); | void setSortEnabled(bool setting); | |||
/*! | /*! | |||
\brief | \brief | |||
Set mode to be used when sorting the list. | Set mode to be used when sorting the list. | |||
skipping to change at line 527 | skipping to change at line 527 | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the sorting mode is changed. | Handler called internally when the sorting mode is changed. | |||
*/ | */ | |||
virtual void onSortModeChanged(WindowEventArgs& e); | virtual void onSortModeChanged(WindowEventArgs& e); | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Overridden Event handlers | Overridden Event handlers | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
virtual void onParentSized(WindowEventArgs& e); | ||||
//virtual void onChildRemoved(WindowEventArgs& e); | //virtual void onChildRemoved(WindowEventArgs& e); | |||
//virtual void onDestructionStarted(WindowEventArgs& e); | //virtual void onDestructionStarted(WindowEventArgs& e); | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef std::vector<ItemEntry*> ItemEntryList; | typedef std::vector<ItemEntry*> ItemEntryList; | |||
ItemEntryList d_listItems; //!< list of items in the li st. | ItemEntryList d_listItems; //!< list of items in the li st. | |||
//!< True if this ItemListBase widget should automatically resize to fi t its content. False if not. | //!< True if this ItemListBase widget should automatically resize to fi t its content. False if not. | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added | |||
CEGUIItemListBaseProperties.h | CEGUIItemListBaseProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemListBaseProperties_h_ | #ifndef _CEGUIItemListBaseProperties_h_ | |||
#define _CEGUIItemListBaseProperties_h_ | #define _CEGUIItemListBaseProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemListBaseProperties namespace section | // Start of ItemListBaseProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interface for the ItemListBase class | Namespace containing all classes that make up the properties interface for the ItemListBase class | |||
*/ | */ | |||
namespace ItemListBaseProperties | namespace ItemListBaseProperties | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIItemListbox.h | CEGUIItemListbox.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemListbox_h_ | #ifndef _CEGUIItemListbox_h_ | |||
#define _CEGUIItemListbox_h_ | #define _CEGUIItemListbox_h_ | |||
#include "elements/CEGUIScrolledItemListBase.h" | #include "CEGUIScrolledItemListBase.h" | |||
#include "elements/CEGUIItemListboxProperties.h" | #include "CEGUIItemListboxProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// begin CEGUI namespace | // begin CEGUI namespace | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIItemListboxProperties.h | CEGUIItemListboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIItemListboxProperties_h_ | #ifndef _CEGUIItemListboxProperties_h_ | |||
#define _CEGUIItemListboxProperties_h_ | #define _CEGUIItemListboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemListboxProperties namespace section | // Start of ItemListboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interface for the ItemListbox class | Namespace containing all classes that make up the properties interface for the ItemListbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUILibxmlParser.h | CEGUILibxmlParser.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUILibxmlParser_h_ | #ifndef _CEGUILibxmlParser_h_ | |||
#define _CEGUILibxmlParser_h_ | #define _CEGUILibxmlParser_h_ | |||
#include "CEGUIXMLParser.h" | #include "../../CEGUIXMLParser.h" | |||
#if defined( __WIN32__ ) || defined( _WIN32 ) | #if defined( __WIN32__ ) || defined( _WIN32 ) | |||
# ifdef CEGUILIBXMLPARSER_EXPORTS | # ifdef CEGUILIBXMLPARSER_EXPORTS | |||
# define CEGUILIBXMLPARSER_API __declspec(dllexport) | # define CEGUILIBXMLPARSER_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUILIBXMLPARSER_API __declspec(dllimport) | # define CEGUILIBXMLPARSER_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUILIBXMLPARSER_API | # define CEGUILIBXMLPARSER_API | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIListHeader.h | CEGUIListHeader.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListHeader_h_ | #ifndef _CEGUIListHeader_h_ | |||
#define _CEGUIListHeader_h_ | #define _CEGUIListHeader_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIListHeaderSegment.h" | #include "CEGUIListHeaderSegment.h" | |||
#include "elements/CEGUIListHeaderProperties.h" | #include "CEGUIListHeaderProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIListHeaderProperties.h | CEGUIListHeaderProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListHeaderProperties_h_ | #ifndef _CEGUIListHeaderProperties_h_ | |||
#define _CEGUIListHeaderProperties_h_ | #define _CEGUIListHeaderProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ListHeaderProperties namespace section | // Start of ListHeaderProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the ListHeader class | Namespace containing all classes that make up the properties interfa ce for the ListHeader class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIListHeaderSegment.h | CEGUIListHeaderSegment.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListHeaderSegment_h_ | #ifndef _CEGUIListHeaderSegment_h_ | |||
#define _CEGUIListHeaderSegment_h_ | #define _CEGUIListHeaderSegment_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIListHeaderSegmentProperties.h" | #include "CEGUIListHeaderSegmentProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIListHeaderSegmentProperties.h | CEGUIListHeaderSegmentProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListHeaderSegmentProperties_h_ | #ifndef _CEGUIListHeaderSegmentProperties_h_ | |||
#define _CEGUIListHeaderSegmentProperties_h_ | #define _CEGUIListHeaderSegmentProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ListHeaderSegmentProperties namespace section | // Start of ListHeaderSegmentProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the ListHeaderSegment class | Namespace containing all classes that make up the properties interfa ce for the ListHeaderSegment class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIListbox.h | CEGUIListbox.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListbox_h_ | #ifndef _CEGUIListbox_h_ | |||
#define _CEGUIListbox_h_ | #define _CEGUIListbox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIListboxProperties.h" | #include "CEGUIListboxProperties.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIListboxItem.h | CEGUIListboxItem.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIListboxItem.h | filename: CEGUIListboxItem.h | |||
created: 8/6/2004 | created: 8/6/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Interface to base class for list items | purpose: Interface to base class for list items | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListboxItem_h_ | #ifndef _CEGUIListboxItem_h_ | |||
#define _CEGUIListboxItem_h_ | #define _CEGUIListboxItem_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "../CEGUIString.h" | |||
#include "CEGUIColourRect.h" | #include "../CEGUIColourRect.h" | |||
#include "CEGUIRenderCache.h" | #include "../CEGUITextUtils.h" | |||
#if defined(_MSC_VER) | ||||
# pragma warning(push) | ||||
# pragma warning(disable : 4251) | ||||
#endif | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Base class for list box items | Base class for list box items | |||
*/ | */ | |||
class CEGUIEXPORT ListboxItem | class CEGUIEXPORT ListboxItem | |||
{ | { | |||
public: | public: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Constants | Constants | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
static const colour DefaultSelectionColour; //!< Default | static const colour DefaultSelectionColour; //!< Default selection | |||
selection brush colour. | brush colour. | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
/*! | /*! | |||
\brief | \brief | |||
base class constructor | base class constructor | |||
*/ | */ | |||
ListboxItem(const String& text, uint item_id = 0, void* item_data = | ListboxItem(const String& text, uint item_id = 0, void* item_data = 0, | |||
0, bool disabled = false, bool auto_delete = true); | bool disabled = false, bool auto_delete = true); | |||
/*! | /*! | |||
\brief | \brief | |||
base class destructor | base class destructor | |||
*/ | */ | |||
virtual ~ListboxItem(void) {} | virtual ~ListboxItem(void) {} | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Accessors | Accessors | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
/*! | /*! | |||
\brief | \brief | |||
return the text string set for this list box item. | return the text string set for this list box item. | |||
Note that even if the item does not render text, the text st | Note that even if the item does not render text, the text string ca | |||
ring can still be useful, since it | n still be useful, since it | |||
is used for sorting list box items. | is used for sorting list box items. | |||
\return | \return | |||
String object containing the current text for the list box i | String object containing the current text for the list box item. | |||
tem. | */ | |||
*/ | const String& getTooltipText(void) const {return d_tooltipText;} | |||
const String& getText(void) const {return d_itemText;} | ||||
const String& getTooltipText(void) const {return d_to | ||||
oltipText;} | ||||
/*! | const String& getText(void) const {return d_textLogical;} | |||
\brief | ||||
Return the current ID assigned to this list box item. | ||||
Note that the system does not make use of this value, client | //! return text string with \e visual ordering of glyphs. | |||
code can assign any meaning it | const String& getTextVisual() const; | |||
wishes to the ID. | ||||
\return | /*! | |||
ID code currently assigned to this list box item | \brief | |||
*/ | Return the current ID assigned to this list box item. | |||
uint getID(void) const {return d_itemID;} | ||||
/*! | Note that the system does not make use of this value, client code c | |||
\brief | an assign any meaning it | |||
Return the pointer to any client assigned user data attached | wishes to the ID. | |||
to this lis box item. | ||||
Note that the system does not make use of this data, client | \return | |||
code can assign any meaning it | ID code currently assigned to this list box item | |||
wishes to the attached data. | */ | |||
uint getID(void) const {return d_itemID;} | ||||
\return | /*! | |||
Pointer to the currently assigned user data. | \brief | |||
*/ | Return the pointer to any client assigned user data attached to thi | |||
void* getUserData(void) const {return d_itemData;} | s lis box item. | |||
/*! | Note that the system does not make use of this data, client code ca | |||
\brief | n assign any meaning it | |||
return whether this item is selected. | wishes to the attached data. | |||
\return | \return | |||
true if the item is selected, false if the item is not selec | Pointer to the currently assigned user data. | |||
ted. | */ | |||
*/ | void* getUserData(void) const {return d_itemData;} | |||
bool isSelected(void) const {return d_selected;} | ||||
/*! | /*! | |||
\brief | \brief | |||
return whether this item is disabled. | return whether this item is selected. | |||
\return | \return | |||
true if the item is disabled, false if the item is enabled. | true if the item is selected, false if the item is not selected. | |||
*/ | */ | |||
bool isDisabled(void) const {return d_disabled;} | bool isSelected(void) const {return d_selected;} | |||
/*! | /*! | |||
\brief | \brief | |||
return whether this item will be automatically deleted when | return whether this item is disabled. | |||
the list box it is attached to | ||||
is destroyed, or when the item is removed from the list box. | ||||
\return | \return | |||
true if the item object will be deleted by the system when t | true if the item is disabled, false if the item is enabled. | |||
he list box it is attached to is | */ | |||
destroyed, or when the item is removed from the list. false | bool isDisabled(void) const {return d_disabled;} | |||
if client code must destroy the | ||||
item after it is removed from the list. | ||||
*/ | ||||
bool isAutoDeleted(void) const {return d_autoDelete;} | ||||
/*! | /*! | |||
\brief | \brief | |||
Get the owner window for this ListboxItem. | return whether this item will be automatically deleted when the lis | |||
t box it is attached to | ||||
is destroyed, or when the item is removed from the list box. | ||||
The owner of a ListboxItem is typically set by the list box | \return | |||
widgets when an item is added or inserted. | true if the item object will be deleted by the system when the list | |||
box it is attached to is | ||||
destroyed, or when the item is removed from the list. false if cli | ||||
ent code must destroy the | ||||
item after it is removed from the list. | ||||
*/ | ||||
bool isAutoDeleted(void) const {return d_autoDelete;} | ||||
\return | /*! | |||
Ponter to the window that is considered the owner of this Li | \brief | |||
stboxItem. | Get the owner window for this ListboxItem. | |||
*/ | ||||
const Window* getOwnerWindow() const {return d_owner;} | ||||
/*! | The owner of a ListboxItem is typically set by the list box widgets | |||
\brief | when an item is added or inserted. | |||
Return the current colours used for selection highlighting. | ||||
\return | \return | |||
ColourRect object describing the currently set colours | Ponter to the window that is considered the owner of this ListboxIt | |||
*/ | em. | |||
ColourRect getSelectionColours(void) const {return d_se | */ | |||
lectCols;} | const Window* getOwnerWindow() const {return d_owner;} | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current selection highlighting brush. | Return the current colours used for selection highlighting. | |||
\return | \return | |||
Pointer to the Image object currently used for selection hig | ColourRect object describing the currently set colours | |||
hlighting. | */ | |||
*/ | ColourRect getSelectionColours(void) const {return d_selectCols;} | |||
const Image* getSelectionBrushImage(void) const {ret | ||||
urn d_selectBrush;} | ||||
/******************************************************************* | /*! | |||
****** | \brief | |||
Manipulators | Return the current selection highlighting brush. | |||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
set the text string for this list box item. | ||||
Note that even if the item does not render text, the text st | \return | |||
ring can still be useful, since it | Pointer to the Image object currently used for selection highlighti | |||
is used for sorting list box items. | ng. | |||
*/ | ||||
const Image* getSelectionBrushImage(void) const {return d_selec | ||||
tBrush;} | ||||
\param text | /********************************************************************** | |||
String object containing the text to set for the list box it | *** | |||
em. | Manipulators | |||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
set the text string for this list box item. | ||||
\return | Note that even if the item does not render text, the text string ca | |||
Nothing. | n still be useful, since it | |||
*/ | is used for sorting list box items. | |||
void setText(const String& text) {d_itemText = text;} | ||||
void setTooltipText(const String& text) {d_tooltipTe | \param text | |||
xt = text;} | String object containing the text to set for the list box item. | |||
/*! | \return | |||
\brief | Nothing. | |||
Set the ID assigned to this list box item. | */ | |||
virtual void setText(const String& text); | ||||
Note that the system does not make use of this value, client | void setTooltipText(const String& text) {d_tooltipText = text;} | |||
code can assign any meaning it | ||||
wishes to the ID. | ||||
\param item_id | /*! | |||
ID code to be assigned to this list box item | \brief | |||
Set the ID assigned to this list box item. | ||||
\return | Note that the system does not make use of this value, client code c | |||
Nothing. | an assign any meaning it | |||
*/ | wishes to the ID. | |||
void setID(uint item_id) {d_itemID = item_id;} | ||||
/*! | \param item_id | |||
\brief | ID code to be assigned to this list box item | |||
Set the client assigned user data attached to this lis box i | ||||
tem. | ||||
Note that the system does not make use of this data, client | \return | |||
code can assign any meaning it | Nothing. | |||
wishes to the attached data. | */ | |||
void setID(uint item_id) {d_itemID = item_id;} | ||||
\param item_data | /*! | |||
Pointer to the user data to attach to this list item. | \brief | |||
Set the client assigned user data attached to this lis box item. | ||||
\return | Note that the system does not make use of this data, client code ca | |||
Nothing. | n assign any meaning it | |||
*/ | wishes to the attached data. | |||
void setUserData(void* item_data) {d_itemData = item_data;} | ||||
/*! | \param item_data | |||
\brief | Pointer to the user data to attach to this list item. | |||
set whether this item is selected. | ||||
\param setting | \return | |||
true if the item is selected, false if the item is not selec | Nothing. | |||
ted. | */ | |||
void setUserData(void* item_data) {d_itemData = item_data;} | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | set whether this item is selected. | |||
void setSelected(bool setting) {d_selected = settin | ||||
g;} | ||||
/*! | \param setting | |||
\brief | true if the item is selected, false if the item is not selected. | |||
set whether this item is disabled. | ||||
\param setting | \return | |||
true if the item is disabled, false if the item is enabled. | Nothing. | |||
*/ | ||||
void setSelected(bool setting) {d_selected = setting;} | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | set whether this item is disabled. | |||
void setDisabled(bool setting) {d_disabled = settin | ||||
g;} | ||||
/*! | \param setting | |||
\brief | true if the item is disabled, false if the item is enabled. | |||
Set whether this item will be automatically deleted when the | ||||
list box it is attached to | ||||
is destroyed, or when the item is removed from the list box. | ||||
\param setting | \return | |||
true if the item object should be deleted by the system when | Nothing. | |||
the list box it is attached to is | */ | |||
destroyed, or when the item is removed from the list. false | void setDisabled(bool setting) {d_disabled = setting;} | |||
if client code will destroy the | ||||
item after it is removed from the list. | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether this item will be automatically deleted when the list b | |||
void setAutoDeleted(bool setting) {d_autoDelete = sett | ox it is attached to | |||
ing;} | is destroyed, or when the item is removed from the list box. | |||
/*! | \param setting | |||
\brief | true if the item object should be deleted by the system when the li | |||
Set the owner window for this ListboxItem. This is called b | st box it is attached to is | |||
y all the list box widgets when | destroyed, or when the item is removed from the list. false if cli | |||
an item is added or inserted. | ent code will destroy the | |||
item after it is removed from the list. | ||||
\param owner | \return | |||
Ponter to the window that should be considered the owner of | Nothing. | |||
this ListboxItem. | */ | |||
void setAutoDeleted(bool setting) {d_autoDelete = setting;} | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Set the owner window for this ListboxItem. This is called by all t | |||
void setOwnerWindow(const Window* owner) {d_owner = o | he list box widgets when | |||
wner;} | an item is added or inserted. | |||
/*! | \param owner | |||
\brief | Ponter to the window that should be considered the owner of this Li | |||
Set the colours used for selection highlighting. | stboxItem. | |||
\param cols | \return | |||
ColourRect object describing the colours to be used. | Nothing | |||
*/ | ||||
void setOwnerWindow(const Window* owner) {d_owner = owner;} | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the colours used for selection highlighting. | |||
void setSelectionColours(const ColourRect& cols) {d_s | ||||
electCols = cols;} | ||||
/*! | \param cols | |||
\brief | ColourRect object describing the colours to be used. | |||
Set the colours used for selection highlighting. | ||||
\param top_left_colour | \return | |||
Colour (as ARGB value) to be applied to the top-left corner | Nothing. | |||
of the selection area. | */ | |||
void setSelectionColours(const ColourRect& cols) {d_selectCols = | ||||
cols;} | ||||
\param top_right_colour | /*! | |||
Colour (as ARGB value) to be applied to the top-right corner | \brief | |||
of the selection area. | Set the colours used for selection highlighting. | |||
\param bottom_left_colour | \param top_left_colour | |||
Colour (as ARGB value) to be applied to the bottom-left corn | Colour (as ARGB value) to be applied to the top-left corner of the | |||
er of the selection area. | selection area. | |||
\param bottom_right_colour | \param top_right_colour | |||
Colour (as ARGB value) to be applied to the bottom-right cor | Colour (as ARGB value) to be applied to the top-right corner of the | |||
ner of the selection area. | selection area. | |||
\return | \param bottom_left_colour | |||
Nothing. | Colour (as ARGB value) to be applied to the bottom-left corner of t | |||
*/ | he selection area. | |||
void setSelectionColours(colour top_left_colour, colour top_right | ||||
_colour, colour bottom_left_colour, colour bottom_right_colour); | ||||
/*! | \param bottom_right_colour | |||
\brief | Colour (as ARGB value) to be applied to the bottom-right corner of | |||
Set the colours used for selection highlighting. | the selection area. | |||
\param col | \return | |||
colour value to be used when rendering. | Nothing. | |||
*/ | ||||
void setSelectionColours(colour top_left_colour, colour top_right_co | ||||
lour, colour bottom_left_colour, colour bottom_right_colour); | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the colours used for selection highlighting. | |||
void setSelectionColours(colour col) {setSelectionColours | ||||
(col, col, col, col);} | ||||
/*! | \param col | |||
\brief | colour value to be used when rendering. | |||
Set the selection highlighting brush image. | ||||
\param image | \return | |||
Pointer to the Image object to be used for selection highlig | Nothing. | |||
hting. | */ | |||
void setSelectionColours(colour col) {setSelectionColours(col, c | ||||
ol, col, col);} | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the selection highlighting brush image. | |||
void setSelectionBrushImage(const Image* image) {d_s | ||||
electBrush = image;} | ||||
/*! | \param image | |||
\brief | Pointer to the Image object to be used for selection highlighting. | |||
Set the selection highlighting brush image. | ||||
\param imageset | \return | |||
Name of the imagest containing the image to be used. | Nothing. | |||
*/ | ||||
void setSelectionBrushImage(const Image* image) {d_selectBrush | ||||
= image;} | ||||
\param image | /*! | |||
Name of the image to be used | \brief | |||
Set the selection highlighting brush image. | ||||
\return | \param imageset | |||
Nothing. | Name of the imagest containing the image to be used. | |||
*/ | ||||
void setSelectionBrushImage(const String& imageset, const String& | ||||
image); | ||||
/******************************************************************* | \param image | |||
****** | Name of the image to be used | |||
Abstract portion of interface | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Return the rendered pixel size of this list box item. | ||||
\return | \return | |||
Size object describing the size of the list box item in pixe | Nothing. | |||
ls. | */ | |||
*/ | void setSelectionBrushImage(const String& imageset, const String& im | |||
virtual Size getPixelSize(void) const = 0; | age); | |||
/*! | /********************************************************************** | |||
\brief | *** | |||
Draw the list box item in its current state | Abstract portion of interface | |||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
Return the rendered pixel size of this list box item. | ||||
\param position | \return | |||
Vecor3 object describing the upper-left corner of area that | Size object describing the size of the list box item in pixels. | |||
should be rendered in to for the draw operation. | */ | |||
virtual Size getPixelSize(void) const = 0; | ||||
\param alpha | /*! | |||
Alpha value to be used when rendering the item (between 0.0f | \brief | |||
and 1.0f). | Draw the list box item in its current state | |||
\param clipper | \param position | |||
Rect object describing the clipping rectangle for the draw o | Vecor2 object describing the upper-left corner of area that should | |||
peration. | be rendered in to for the draw operation. | |||
\return | \param alpha | |||
Nothing. | Alpha value to be used when rendering the item (between 0.0f and 1. | |||
*/ | 0f). | |||
virtual void draw(const Vector3& position, float alpha, const Rec | ||||
t& clipper) const = 0; | ||||
virtual void draw(RenderCache& cache,const Rect& targetRect, float z | \param clipper | |||
Base, float alpha, const Rect* clipper) const = 0; | Rect object describing the clipping rectangle for the draw operatio | |||
n. | ||||
/******************************************************************* | \return | |||
****** | Nothing. | |||
Operators | */ | |||
******************************************************************** | virtual void draw(GeometryBuffer& buffer, const Rect& targetRect, | |||
*****/ | float alpha, const Rect* clipper) const = 0; | |||
/*! | ||||
\brief | ||||
Less-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator<(const ListboxItem& rhs) const {ret | ||||
urn d_itemText < rhs.getText();} | ||||
/*! | /********************************************************************** | |||
\brief | *** | |||
Greater-than operator, compares item texts. | Operators | |||
*/ | *********************************************************************** | |||
virtual bool operator>(const ListboxItem& rhs) const {ret | **/ | |||
urn d_itemText > rhs.getText();} | /*! | |||
\brief | ||||
Less-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator<(const ListboxItem& rhs) const {return get | ||||
Text() < rhs.getText();} | ||||
/*! | ||||
\brief | ||||
Greater-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator>(const ListboxItem& rhs) const {return get | ||||
Text() > rhs.getText();} | ||||
protected: | protected: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Implementation methods | Implementation methods | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return a ColourRect object describing the colours in \a cols | Return a ColourRect object describing the colours in \a cols after | |||
after having their alpha | having their alpha | |||
component modulated by the value \a alpha. | component modulated by the value \a alpha. | |||
*/ | */ | |||
ColourRect getModulateAlphaColourRect(const ColourRect& cols, float | ColourRect getModulateAlphaColourRect(const ColourRect& cols, float alp | |||
alpha) const; | ha) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a colour value describing the colour specified by \a | Return a colour value describing the colour specified by \a col aft | |||
col after having its alpha | er having its alpha | |||
component modulated by the value \a alpha. | component modulated by the value \a alpha. | |||
*/ | */ | |||
colour calculateModulatedAlphaColour(colour col, float alpha) const; | colour calculateModulatedAlphaColour(colour col, float alpha) const; | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Implementation Data | Implementation Data | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
String d_itemText; //!< Text for this list box item. I | String d_textLogical; | |||
f not rendered, this is still used for list sorting. | //! pointer to bidirection support object | |||
String d_tooltipText; //!< Text for the individual tooltip of this | BiDiVisualMapping* d_bidiVisualMapping; | |||
item | //! whether bidi visual mapping has been updated since last text change | |||
uint d_itemID; //!< ID code assigned by client code | . | |||
. This has no meaning within the GUI system. | mutable bool d_bidiDataValid; | |||
void* d_itemData; //!< Pointer to some client code dat | String d_tooltipText; //!< Text for the individual tooltip of this it | |||
a. This has no meaning within the GUI system. | em | |||
bool d_selected; //!< true if this item is selected. | uint d_itemID; //!< ID code assigned by client code. This has | |||
false if the item is not selected. | no meaning within the GUI system. | |||
bool d_disabled; //!< true if this item is disabled. | void* d_itemData; //!< Pointer to some client code data. This ha | |||
false if the item is not disabled. | s no meaning within the GUI system. | |||
bool d_autoDelete; //!< true if the system should destroy this | bool d_selected; //!< true if this item is selected. false if t | |||
item, false if client code will destroy the item. | he item is not selected. | |||
const Window* d_owner; //!< Pointer to the window that owns | bool d_disabled; //!< true if this item is disabled. false if t | |||
this item. | he item is not disabled. | |||
ColourRect d_selectCols; //!< Colours used fo | bool d_autoDelete; //!< true if the system should destroy this ite | |||
r selection highlighting. | m, false if client code will destroy the item. | |||
const Image* d_selectBrush; //!< Image used for renderin | const Window* d_owner; //!< Pointer to the window that owns this i | |||
g selection. | tem. | |||
ColourRect d_selectCols; //!< Colours used for selection hig | ||||
hlighting. | ||||
const Image* d_selectBrush; //!< Image used for rendering selec | ||||
tion. | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIListboxItem_h_ | #if defined(_MSC_VER) | |||
# pragma warning(pop) | ||||
#endif | ||||
#endif // end of guard _CEGUIListboxItem_h_ | ||||
End of changes. 87 change blocks. | ||||
378 lines changed or deleted | 374 lines changed or added | |||
CEGUIListboxProperties.h | CEGUIListboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListboxProperties_h_ | #ifndef _CEGUIListboxProperties_h_ | |||
#define _CEGUIListboxProperties_h_ | #define _CEGUIListboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ListboxProperties namespace section | // Start of ListboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Listbox class | Namespace containing all classes that make up the properties interfa ce for the Listbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIListboxTextItem.h | CEGUIListboxTextItem.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIListboxTextItem_h_ | #ifndef _CEGUIListboxTextItem_h_ | |||
#define _CEGUIListboxTextItem_h_ | #define _CEGUIListboxTextItem_h_ | |||
#include "elements/CEGUIListboxItem.h" | #include "CEGUIListboxItem.h" | |||
#include "../CEGUIBasicRenderedStringParser.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class used for textual items in a list box. | Class used for textual items in a list box. | |||
*/ | */ | |||
class CEGUIEXPORT ListboxTextItem : public ListboxItem | class CEGUIEXPORT ListboxTextItem : public ListboxItem | |||
{ | { | |||
skipping to change at line 101 | skipping to change at line 102 | |||
/*! | /*! | |||
\brief | \brief | |||
Set the font to be used by this ListboxTextItem | Set the font to be used by this ListboxTextItem | |||
\param font | \param font | |||
Font to be used for rendering this item | Font to be used for rendering this item | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setFont(Font* font) {d_font = font;} | void setFont(Font* font); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the font to be used by this ListboxTextItem | Set the font to be used by this ListboxTextItem | |||
\param font_name | \param font_name | |||
String object containing the name of the Font to be used for rendering this item | String object containing the name of the Font to be used for rendering this item | |||
\return | \return | |||
Nothing | Nothing | |||
skipping to change at line 160 | skipping to change at line 161 | |||
Set the colours used for text rendering. | Set the colours used for text rendering. | |||
\param col | \param col | |||
colour value to be used when rendering. | colour value to be used when rendering. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setTextColours(colour col) {setTextColours(col, col, col, col);} | void setTextColours(colour col) {setTextColours(col, col, col, col);} | |||
// base class overrides | ||||
void setText(const String& text); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Required implementations of pure virtuals from the base clas s. | Required implementations of pure virtuals from the base clas s. | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
Size getPixelSize(void) const; | Size getPixelSize(void) const; | |||
void draw(const Vector3& position, float alpha, const Rect& clipper) co | void draw(GeometryBuffer& buffer, const Rect& targetRect, float alpha, | |||
nst; | const Rect* clipper) const; | |||
void draw(RenderCache& cache,const Rect& targetRect, float zBase, floa | ||||
t alpha, const Rect* clipper) const; | ||||
protected: | protected: | |||
void parseTextString() const; | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
ColourRect d_textCols; //!< Colours used fo r rendering the text. | ColourRect d_textCols; //!< Colours used fo r rendering the text. | |||
Font* d_font; //!< Font used for r endering text. | Font* d_font; //!< Font used for r endering text. | |||
//! Parser used to produce a final RenderedString from the standard Str | ||||
ing. | ||||
static BasicRenderedStringParser d_stringParser; | ||||
//! RenderedString drawn by this item. | ||||
mutable RenderedString d_renderedString; | ||||
//! boolean used to track when item state changes (and needs re-parse) | ||||
mutable bool d_renderedStringValid; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIListboxTextItem_h_ | #endif // end of guard _CEGUIListboxTextItem_h_ | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 17 lines changed or added | |||
CEGUILogger.h | CEGUILogger.h | |||
---|---|---|---|---|
skipping to change at line 147 | skipping to change at line 147 | |||
*/ | */ | |||
virtual void setLogFilename(const String& filename, bool append = false ) = 0; | virtual void setLogFilename(const String& filename, bool append = false ) = 0; | |||
protected: | protected: | |||
LoggingLevel d_level; //!< Holds current logging l evel | LoggingLevel d_level; //!< Holds current logging l evel | |||
private: | private: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Copy constructor and assignment usage is denied. | Copy constructor and assignment usage is denied. | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
Logger(const Logger& logger) : Singleton <Logger>() {} | Logger(const Logger&) : Singleton <Logger>() {} | |||
Logger& operator=(const Logger& logger) {return *this;} | Logger& operator=(const Logger&) {return *this;} | |||
}; | }; | |||
/************************************************************************* | /************************************************************************* | |||
This macro is used for 'Insane' level logging so that those items ar e | This macro is used for 'Insane' level logging so that those items ar e | |||
excluded from non-debug builds | excluded from non-debug builds | |||
*************************************************************************/ | *************************************************************************/ | |||
#if defined(DEBUG) || defined (_DEBUG) | #if defined(DEBUG) || defined (_DEBUG) | |||
# define CEGUI_LOGINSANE( message ) CEGUI::Logger::getSingleton().logE vent((message), CEGUI::Insane); | # define CEGUI_LOGINSANE( message ) CEGUI::Logger::getSingleton().logE vent((message), CEGUI::Insane); | |||
#else | #else | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUILua.h | CEGUILua.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUILua.h | filename: CEGUILua.h | |||
created: 16/3/2005 | created: 16/3/2005 | |||
author: Tomas Lindquist Olsen | author: Tomas Lindquist Olsen | |||
purpose: Defines interface for LuaScriptModule class | purpose: Defines interface for LuaScriptModule class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 46 | skipping to change at line 46 | |||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUILUA_EXPORTS | # ifdef CEGUILUA_EXPORTS | |||
# define CEGUILUA_API __declspec(dllexport) | # define CEGUILUA_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUILUA_API __declspec(dllimport) | # define CEGUILUA_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUILUA_API | # define CEGUILUA_API | |||
#endif | #endif | |||
#include "CEGUIScriptModule.h" | #include "../../CEGUIScriptModule.h" | |||
struct lua_State; | struct lua_State; | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Interface for the LuaScriptModule class | Interface for the LuaScriptModule class | |||
*/ | */ | |||
class CEGUILUA_API LuaScriptModule : public CEGUI::ScriptModule | class CEGUILUA_API LuaScriptModule : public CEGUI::ScriptModule | |||
{ | { | |||
public: | public: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Constructor for LuaScriptModule class which create a lua_Sta | Creates a LuaScriptModule object. | |||
te | ||||
*/ | ||||
LuaScriptModule(); | ||||
/*! | ||||
\brief | ||||
Constructor for LuaScriptModule class which takes a lua_Stat | ||||
e | ||||
\param state | \param state | |||
Pointer to the lua_State that the script module should attac | Pointer to the lua_State that the script module should attach to, i | |||
h to. | f | |||
*/ | this is 0 a lua_State will be created. | |||
LuaScriptModule(lua_State* state); | */ | |||
static LuaScriptModule& create(lua_State* state = 0); | ||||
/*! | //! Destroys the given LuaScriptModule object. | |||
\brief | static void destroy(LuaScriptModule& mod); | |||
Destructor for LuaScriptModule class. | ||||
*/ | ||||
~LuaScriptModule(); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Script Execution Functions | Script Execution Functions | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Execute a script file. | Execute a script file. | |||
\param filename | \param filename | |||
String object holding the filename of the script file that i | String object holding the filename of the script file that is to be | |||
s to be executed | executed. | |||
\param resourceGroup | \param resourceGroup | |||
Resource group idendifier to be passed to the ResourceProvid | Resource group idendifier to be passed to the ResourceProvider when | |||
er when loading the script file. | loading the script file. | |||
*/ | */ | |||
void executeScriptFile(const String& filename, const String& resourc | void executeScriptFile(const String& filename, const String& resourceGr | |||
eGroup); | oup); | |||
/*! | /*! | |||
\brief | \brief | |||
Execute a scripted global function. The function should not | Execute a script file. | |||
take any parameters and should return an integer. | ||||
\param function_name | \param filename | |||
String object holding the name of the function, in the globa | String object holding the filename of the script file that is to be | |||
l script environment, that | executed. | |||
is to be executed. | ||||
\return | \param resourceGroup | |||
The integer value returned from the script function. | Resource group idendifier to be passed to the ResourceProvider when | |||
*/ | loading the script file. | |||
int executeScriptGlobal(const String& function_name); | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
*/ | ||||
void executeScriptFile(const String& filename, | ||||
const String& resourceGroup, | ||||
const String& error_handler); | ||||
/*! | /*! | |||
\brief | \brief | |||
Execute a scripted global 'event handler' function by looking it up | Execute a script file. | |||
by name. | ||||
\param filename | ||||
String object holding the filename of the script file that is to be | ||||
executed. | ||||
\param resourceGroup | ||||
Resource group idendifier to be passed to the ResourceProvider when | ||||
loading the script file. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
*/ | ||||
void executeScriptFile(const String& filename, | ||||
const String& resourceGroup, | ||||
const int error_handler); | ||||
/*! | ||||
\brief | ||||
Execute a scripted global function. The function should not take a | ||||
ny | ||||
parameters and should return an integer. | ||||
\param function_name | ||||
String object holding the name of the function, in the global scrip | ||||
t | ||||
environment, that is to be executed. | ||||
\return | ||||
The integer value returned from the script function. | ||||
*/ | ||||
int executeScriptGlobal(const String& function_name); | ||||
/*! | ||||
\brief | ||||
Execute a scripted global function. The function should not take a | ||||
ny | ||||
parameters and should return an integer. | ||||
\param function_name | ||||
String object holding the name of the function, in the global scrip | ||||
t | ||||
environment, that is to be executed. | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
\return | ||||
The integer value returned from the script function. | ||||
*/ | ||||
int executeScriptGlobal(const String& function_name, | ||||
const String& error_handler); | ||||
/*! | ||||
\brief | ||||
Execute a scripted global function. The function should not take a | ||||
ny | ||||
parameters and should return an integer. | ||||
\param function_name | ||||
String object holding the name of the function, in the global scrip | ||||
t | ||||
environment, that is to be executed. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
\return | ||||
The integer value returned from the script function. | ||||
*/ | ||||
int executeScriptGlobal(const String& function_name, | ||||
const int error_handler); | ||||
/*! | ||||
\brief | ||||
Execute a scripted global 'event handler' function by looking it up | ||||
by | ||||
name. | ||||
\param handler_name | \param handler_name | |||
String object holding the name of the scripted handler function. | String object holding the name of the scripted handler function. | |||
If this string contains dots '.' it will be parsed as tables contai | If this string contains dots '.' it will be parsed as tables contai | |||
ning a function field. | ning | |||
For example: 'mytable.subtable.func' | a function field. For example: 'mytable.subtable.func' | |||
\param e | \param e | |||
EventArgs based object that should be passed, by any appropriate me | EventArgs based object that should be passed, by any appropriate me | |||
ans, to the scripted function. | ans, | |||
to the scripted function. | ||||
\return | \return | |||
- true if the event was handled. | - true if the event was handled. | |||
- false if the event was not handled. | - false if the event was not handled. | |||
*/ | */ | |||
bool executeScriptedEventHandler(const String& handler_name, const Even | bool executeScriptedEventHandler(const String& handler_name, | |||
tArgs& e); | const EventArgs& e); | |||
/*! | ||||
\brief | ||||
Execute a scripted global 'event handler' function by looking it up | ||||
by | ||||
name. | ||||
\param handler_name | ||||
String object holding the name of the scripted handler function. | ||||
If this string contains dots '.' it will be parsed as tables contai | ||||
ning | ||||
a function field. For example: 'mytable.subtable.func' | ||||
\param e | ||||
EventArgs based object that should be passed, by any appropriate me | ||||
ans, | ||||
to the scripted function. | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
\return | ||||
- true if the event was handled. | ||||
- false if the event was not handled. | ||||
*/ | ||||
bool executeScriptedEventHandler(const String& handler_name, | ||||
const EventArgs& e, | ||||
const String& error_handler); | ||||
/*! | ||||
\brief | ||||
Execute a scripted global 'event handler' function by looking it up | ||||
by | ||||
name. | ||||
\param handler_name | ||||
String object holding the name of the scripted handler function. | ||||
If this string contains dots '.' it will be parsed as tables contai | ||||
ning | ||||
a function field. For example: 'mytable.subtable.func' | ||||
\param e | ||||
EventArgs based object that should be passed, by any appropriate me | ||||
ans, | ||||
to the scripted function. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
\return | ||||
- true if the event was handled. | ||||
- false if the event was not handled. | ||||
*/ | ||||
bool executeScriptedEventHandler(const String& handler_name, | ||||
const EventArgs& e, | ||||
const int error_handler); | ||||
/*! | /*! | |||
\brief | \brief | |||
Execute script code contained in the given CEGUI::String object. | Execute script code contained in the given CEGUI::String object. | |||
\param str | \param str | |||
String object holding the valid script code that should be executed . | String object holding the valid script code that should be executed . | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void executeString(const String& str); | void executeString(const String& str); | |||
/*! | ||||
\brief | ||||
Execute script code contained in the given CEGUI::String object. | ||||
\param str | ||||
String object holding the valid script code that should be executed | ||||
. | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void executeString(const String& str, const String& error_handler); | ||||
/*! | ||||
\brief | ||||
Execute script code contained in the given CEGUI::String object. | ||||
\param str | ||||
String object holding the valid script code that should be executed | ||||
. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void executeString(const String& str, const int error_handler); | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Event subscription | Event subscription | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Subscribes the named Event to a scripted funtion | Subscribes the named Event to a scripted funtion | |||
\param target | \param target | |||
The target EventSet for the subscription. | The target EventSet for the subscription. | |||
\param name | \param name | |||
String object containing the name of the Event to subscribe to. | String object containing the name of the Event to subscribe to. | |||
\param subscriber_name | \param subscriber_name | |||
String object containing the name of the script funtion that is | String object containing the name of the script funtion that is to | |||
to be subscribed to the Event. | be | |||
subscribed to the Event. | ||||
\return | \return | |||
Connection object that can be used to check the status of the E | Connection object that can be used to check the status of the Event | |||
vent connection and to disconnect (unsubscribe) from the Event. | connection and to disconnect (unsubscribe) from the Event. | |||
*/ | ||||
Event::Connection subscribeEvent(EventSet* target, const String& name, | ||||
const String& subscriber_name); | ||||
\exception UnknownObjectException Thrown if an Event named \a name is | /*! | |||
not in the EventSet | \brief | |||
Subscribes the named Event to a scripted funtion | ||||
\param target | ||||
The target EventSet for the subscription. | ||||
\param name | ||||
String object containing the name of the Event to subscribe to. | ||||
\param subscriber_name | ||||
String object containing the name of the script funtion that is to | ||||
be | ||||
subscribed to the Event. | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Connection object that can be used to check the status of the Event | ||||
connection and to disconnect (unsubscribe) from the Event. | ||||
*/ | */ | |||
Event::Connection subscribeEvent(EventSet* target, const String& name, | Event::Connection subscribeEvent(EventSet* target, const String& name, | |||
const String& subscriber_name); | const String& subscriber_name, | |||
const String& error_handler); | ||||
/*! | /*! | |||
\brief | \brief | |||
Subscribes the specified group of the named Event to a scripted funtion. | Subscribes the named Event to a scripted funtion | |||
\param target | \param target | |||
The target EventSet for the subscription. | The target EventSet for the subscription. | |||
\param name | \param name | |||
String object containing the name of the Event to subscribe to. | String object containing the name of the Event to subscribe to. | |||
\param subscriber_name | ||||
String object containing the name of the script funtion that is to | ||||
be | ||||
subscribed to the Event. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Connection object that can be used to check the status of the Event | ||||
connection and to disconnect (unsubscribe) from the Event. | ||||
*/ | ||||
Event::Connection subscribeEvent(EventSet* target, const String& name, | ||||
const String& subscriber_name, | ||||
const int error_handler); | ||||
/*! | ||||
\brief | ||||
Subscribes the specified group of the named Event to a scripted fun | ||||
tion. | ||||
\param target | ||||
The target EventSet for the subscription. | ||||
\param name | ||||
String object containing the name of the Event to subscribe to. | ||||
\param group | \param group | |||
Group which is to be subscribed to. Subscription groups are ca | Group which is to be subscribed to. Subscription groups are called | |||
lled in ascending order. | in | |||
ascending order. | ||||
\param subscriber_name | \param subscriber_name | |||
String object containing the name of the script funtion that is | String object containing the name of the script funtion that is to | |||
to be subscribed to the Event. | be | |||
subscribed to the Event. | ||||
\return | \return | |||
Connection object that can be used to check the status of the E | Connection object that can be used to check the status of the Event | |||
vent connection and to disconnect (unsubscribe) from the Event. | connection and to disconnect (unsubscribe) from the Event. | |||
*/ | ||||
Event::Connection subscribeEvent(EventSet* target, const String& name, | ||||
Event::Group group, | ||||
const String& subscriber_name); | ||||
\exception UnknownObjectException Thrown if an Event named \a name is | /*! | |||
not in the EventSet | \brief | |||
Subscribes the specified group of the named Event to a scripted fun | ||||
tion. | ||||
\param target | ||||
The target EventSet for the subscription. | ||||
\param name | ||||
String object containing the name of the Event to subscribe to. | ||||
\param group | ||||
Group which is to be subscribed to. Subscription groups are called | ||||
in | ||||
ascending order. | ||||
\param subscriber_name | ||||
String object containing the name of the script funtion that is to | ||||
be | ||||
subscribed to the Event. | ||||
\param error_handler | ||||
String containing the name of the script fuction that will be calle | ||||
d | ||||
if an error occurs while executing the handler function. NB: This | ||||
is | ||||
the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Connection object that can be used to check the status of the Event | ||||
connection and to disconnect (unsubscribe) from the Event. | ||||
*/ | */ | |||
Event::Connection subscribeEvent(EventSet* target, const String& name, | Event::Connection subscribeEvent(EventSet* target, const String& name, | |||
Event::Group group, const String& subscriber_name); | Event::Group group, | |||
const String& subscriber_name, | ||||
const String& error_handler); | ||||
/*! | ||||
\brief | ||||
Subscribes the specified group of the named Event to a scripted fun | ||||
tion. | ||||
\param target | ||||
The target EventSet for the subscription. | ||||
\param name | ||||
String object containing the name of the Event to subscribe to. | ||||
\param group | ||||
Group which is to be subscribed to. Subscription groups are called | ||||
in | ||||
ascending order. | ||||
\param subscriber_name | ||||
String object containing the name of the script funtion that is to | ||||
be | ||||
subscribed to the Event. | ||||
\param error_handler | ||||
integer value describing a lua registry reference to the function t | ||||
hat | ||||
will be called if an error occurs while executing the handler funct | ||||
ion. | ||||
NB: This is the function passed as the error handler to lua_pcall. | ||||
\return | ||||
Connection object that can be used to check the status of the Event | ||||
connection and to disconnect (unsubscribe) from the Event. | ||||
*/ | ||||
Event::Connection subscribeEvent(EventSet* target, const String& name, | ||||
Event::Group group, | ||||
const String& subscriber_name, | ||||
const int error_handler); | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Bindings creation / destruction | Bindings creation / destruction | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Method called during system initialisation, prior to running any sc | Method called during system initialisation, prior to running any sc | |||
ripts via the ScriptModule, to enable the ScriptModule | ripts | |||
to perform any operations required to complete initialisation or bi | via the ScriptModule, to enable the ScriptModule to perform any | |||
nding of the script language to the gui system objects. | operations required to complete initialisation or binding of the sc | |||
ript | ||||
language to the gui system objects. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void createBindings(void); | void createBindings(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Method called during system destruction, after all scripts have bee | Method called during system destruction, after all scripts have bee | |||
n run via the ScriptModule, to enable the ScriptModule | n run | |||
to perform any operations required to cleanup bindings of the scrip | via the ScriptModule, to enable the ScriptModule to perform any | |||
t language to the gui system objects, as set-up in the | operations required to cleanup bindings of the script language to t | |||
earlier createBindings call. | he | |||
gui system objects, as set-up in the earlier createBindings call. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void destroyBindings(void); | void destroyBindings(void); | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Accessor type functions | Accessor type functions | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Method used to get a pointer to the lua_State that the script modul | Method used to get a pointer to the lua_State that the script modul | |||
e is attached to. | e is | |||
attached to. | ||||
\return | \return | |||
A pointer to the lua_State that the script module is attached to. | A pointer to the lua_State that the script module is attached to. | |||
*/ | */ | |||
lua_State* getLuaState(void) const {return d_state;} | lua_State* getLuaState(void) const {return d_state;} | |||
/********************************************************************** | ||||
*** | ||||
Lua error handler related functions | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
Set the name of the lua function that will be passed as the error | ||||
handler in calls to lua_pcall, unless an alternative is specified | ||||
in some other function call. | ||||
\param error_handler_function | ||||
Name of the lua function to be called. This is looked up / bound o | ||||
n | ||||
first usage. | ||||
*/ | ||||
void setDefaultPCallErrorHandler(const String& error_handler_function); | ||||
/*! | ||||
\brief | ||||
Set the function that will be passed as the error handler in calls | ||||
to | ||||
lua_pcall, unless an alternative is specified in some other functio | ||||
n | ||||
call. | ||||
\param function_reference | ||||
Lua function registry index of the function to be called. | ||||
*/ | ||||
void setDefaultPCallErrorHandler(int function_reference); | ||||
/*! | ||||
\brief | ||||
Return the function name string of the active error handler functio | ||||
n. | ||||
The 'active' error handler for the LuaScriptModule is either the | ||||
default as specified by calling setDefaultPCallErrorHandler, or | ||||
whatever might have been set up by a call to the internal | ||||
initErrorHandlerFunc function. | ||||
\note | ||||
This function is really intended for use internally by other parts | ||||
of | ||||
the lua scripting support. Although it could be useful elsewhere f | ||||
or | ||||
advanced uses, so long as you're careful! | ||||
*/ | ||||
const String& getActivePCallErrorHandlerString() const; | ||||
/*! | ||||
\brief | ||||
return the lua registry index of the active error handler function. | ||||
The 'active' error handler for the LuaScriptModule is either the | ||||
default as specified by calling setDefaultPCallErrorHandler, or | ||||
whatever might have been set up by a call to the internal | ||||
initErrorHandlerFunc function. | ||||
\par This may return a value previously set by the user, or the val | ||||
ue as | ||||
bound internally by the script module for an error handler specifie | ||||
d by | ||||
function name. | ||||
\note | ||||
This function is really intended for use internally by other parts | ||||
of | ||||
the lua scripting support. Although it could be useful elsewhere f | ||||
or | ||||
advanced uses, so long as you're careful! | ||||
\warning | ||||
You should never call luaL_unref on the value returned by this func | ||||
tion | ||||
unless you created tge reference in the first place, and even then | ||||
only | ||||
after having called setDefaultPCallErrorHandler passing LUA_NOREF. | ||||
*/ | ||||
int getActivePCallErrorHandlerReference() const; | ||||
private: | private: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation Functions | Implementation Functions | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | ||||
\brief | ||||
Constructor for LuaScriptModule class which takes a lua_State | ||||
\param state | ||||
Pointer to the lua_State that the script module should attach to, i | ||||
f 0 | ||||
a new lua_State will be created. | ||||
*/ | ||||
LuaScriptModule(lua_State* state); | ||||
//! Destructor for LuaScriptModule class. | ||||
~LuaScriptModule(); | ||||
void setModuleIdentifierString(); | void setModuleIdentifierString(); | |||
/** Init the error handler function. Return the lua stack index that | ||||
* should be passed to lua_pcall. NB: This should be called prior to | ||||
* pushing any function parameters onto the lua stack. | ||||
*/ | ||||
int initErrorHandlerFunc(); | ||||
/** Init the error handler function. Return the lua stack index that | ||||
* should be passed to lua_pcall. NB: This should be called prior to | ||||
* pushing any function parameters onto the lua stack. | ||||
*/ | ||||
int initErrorHandlerFunc(const String func_name); | ||||
/** Init the error handler function. Return the lua stack index that | ||||
* should be passed to lua_pcall. NB: This should be called prior to | ||||
* pushing any function parameters onto the lua stack. | ||||
*/ | ||||
int initErrorHandlerFunc(int func); | ||||
/** do any needed cleanup after having called initErrorHandlerFunc and | ||||
* (possible) executed a script. | ||||
* | ||||
* NB: This probably does less than you think ;) | ||||
*/ | ||||
void cleanupErrorHandlerFunc(); | ||||
//! release any reference we might have made to an error handling funct | ||||
ion. | ||||
void unrefErrorFunc(); | ||||
//! Implementation function that executes a scipt file. | ||||
void executeScriptFile_impl(const String& filename, | ||||
const String& resourceGroup, | ||||
const int err_idx, const int top); | ||||
//! Implementation function that executes a global script function. | ||||
int executeScriptGlobal_impl(const String& function_name, | ||||
const int err_idx, const int top); | ||||
//! Implementation function that executes a scripted event handler. | ||||
bool executeScriptedEventHandler_impl(const String& handler_name, | ||||
const EventArgs& e, | ||||
const int err_idx, const int top) | ||||
; | ||||
//! Implementation function that executes script contained in a String. | ||||
void executeString_impl(const String& str, const int err_idx, const int | ||||
top); | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation Data | Implementation Data | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
bool d_ownsState; //!< true when the attached lua_State was create | //! true when the attached lua_State was created by this script module | |||
d by this script module | bool d_ownsState; | |||
lua_State* d_state; //!< The lua_State that this script module uses. | //! The lua_State that this script module uses. | |||
lua_State* d_state; | ||||
//! Default error handler function to pass to lua_pcall. | ||||
String d_errFuncName; | ||||
//! Default registry index of the function to pass to lua_pcall. | ||||
int d_errFuncIndex; | ||||
/** Error handler function that is currently in use (as setup via a cal | ||||
l | ||||
to initErrorHandlerFunc) | ||||
*/ | ||||
String d_activeErrFuncName; | ||||
/** Registry index of the function that is currently in use (as setup v | ||||
ia a | ||||
call to initErrorHandlerFunc) | ||||
*/ | ||||
int d_activeErrFuncIndex; | ||||
}; | }; | |||
} // namespace CEGUI | } // namespace CEGUI | |||
#endif // end of guard _CEGUILua_h_ | #endif // end of guard _CEGUILua_h_ | |||
End of changes. 38 change blocks. | ||||
94 lines changed or deleted | 576 lines changed or added | |||
CEGUILuaFunctor.h | CEGUILuaFunctor.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUILuaFunctor.h | filename: CEGUILuaFunctor.h | |||
created: Thu Jan 26 2006 | created: Thu Jan 26 2006 | |||
author: Tomas Lindquist Olsen <tomas@famolsen.dk> | author: Tomas Lindquist Olsen <tomas@famolsen.dk> | |||
purpose: Defines interface for LuaFunctor class | purpose: Defines interface for LuaFunctor class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUILuaFunctor_h_ | #ifndef _CEGUILuaFunctor_h_ | |||
#define _CEGUILuaFunctor_h_ | #define _CEGUILuaFunctor_h_ | |||
#include "CEGUIEventSet.h" | #include "../../CEGUIEventSet.h" | |||
#include "CEGUIScriptWindowHelper.h" | ||||
struct lua_State; | struct lua_State; | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// forward declaration | // forward declaration | |||
class LuaScriptModule; | class LuaScriptModule; | |||
/*! | /*! | |||
\brief | \brief | |||
Functor class used for subscribing Lua functions to CEGUI events | Functor class used for subscribing Lua functions to CEGUI events | |||
*/ | */ | |||
class LuaFunctor | class LuaFunctor | |||
{ | { | |||
public: | public: | |||
LuaFunctor(lua_State* state, int func, int selfIndex); | LuaFunctor(lua_State* state, int func, int selfIndex); | |||
LuaFunctor(lua_State* state, const String& func, int selfIndex); | LuaFunctor(lua_State* state, const String& func, int selfIndex); | |||
LuaFunctor(lua_State* state, const int func, const int selfIndex, | ||||
const String& error_handler); | ||||
LuaFunctor(lua_State* state, const String& func, const int selfIndex, | ||||
const String& error_handler); | ||||
LuaFunctor(lua_State* state, const int func, const int selfIndex, | ||||
const int error_handler); | ||||
LuaFunctor(lua_State* state, const String& func, const int selfIndex, | ||||
const int error_handler); | ||||
LuaFunctor(const LuaFunctor& cp); | LuaFunctor(const LuaFunctor& cp); | |||
~LuaFunctor(); | ~LuaFunctor(); | |||
bool operator()(const EventArgs& args) const; | bool operator()(const EventArgs& args) const; | |||
/*! | /*! | |||
\brief | \brief | |||
function used to subscribe any Lua function as event handler. | function used to subscribe any Lua function as event handler. | |||
References using the Lua registry. | References using the Lua registry. | |||
To be called from Lua only. | To be called from Lua only. | |||
*/ | */ | |||
static Event::Connection SubscribeEvent(EventSet* self, const String& e | static Event::Connection SubscribeEvent(EventSet* self, | |||
ventName, int funcIndex, int selfIndex, lua_State* L); | const String& eventName, | |||
const int funcIndex, | ||||
const int selfIndex, | ||||
const int error_handler, | ||||
lua_State* L); | ||||
/*! | /*! | |||
\brief | \brief | |||
Pushes the Lua function named \param name on top of the Lua stack. | Pushes the Lua function named \param name on top of the Lua stack. | |||
The name may contain '.' (dots) character for (nested) table values . | The name may contain '.' (dots) character for (nested) table values . | |||
*/ | */ | |||
static void pushNamedFunction(lua_State* L, const String& name); | static void pushNamedFunction(lua_State* L, const String& name); | |||
private: | private: | |||
/*! | ||||
\brief | ||||
Invalidate the registry references. This is used internally to ens | ||||
ure | ||||
that the references do not get released (for example when we destro | ||||
y | ||||
a temporary object) | ||||
*/ | ||||
void invalidateLuaRefs(); | ||||
lua_State* L; | lua_State* L; | |||
mutable int index; | mutable int index; | |||
int self; | int self; | |||
mutable bool needs_lookup; | mutable bool needs_lookup; | |||
mutable String function_name; | mutable String function_name; | |||
//! Error handler function to pass to lua_pcall. | ||||
mutable String d_errFuncName; | ||||
//! registry index of the function to pass to lua_pcall. | ||||
mutable int d_errFuncIndex; | ||||
//! signfies whether we made the reference index at d_errFuncIndex. | ||||
mutable bool d_ourErrFuncIndex; | ||||
friend class LuaScriptModule; | friend class LuaScriptModule; | |||
}; | }; | |||
} // namespace CEGUI | } // namespace CEGUI | |||
#endif // end of guard _CEGUILuaFunctor_h_ | #endif // end of guard _CEGUILuaFunctor_h_ | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 35 lines changed or added | |||
CEGUIMenuBase.h | CEGUIMenuBase.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMenuBase_h_ | #ifndef _CEGUIMenuBase_h_ | |||
#define _CEGUIMenuBase_h_ | #define _CEGUIMenuBase_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIMenuBaseProperties.h" | #include "CEGUIMenuBaseProperties.h" | |||
#include "elements/CEGUIItemListBase.h" | #include "CEGUIItemListBase.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIMenuBaseProperties.h | CEGUIMenuBaseProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMenuBaseProperties_h_ | #ifndef _CEGUIMenuBaseProperties_h_ | |||
#define _CEGUIMenuBaseProperties_h_ | #define _CEGUIMenuBaseProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemListBaseProperties namespace section | // Start of ItemListBaseProperties namespace section | |||
namespace MenuBaseProperties | namespace MenuBaseProperties | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIMenuItem.h | CEGUIMenuItem.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMenuItem_h_ | #ifndef _CEGUIMenuItem_h_ | |||
#define _CEGUIMenuItem_h_ | #define _CEGUIMenuItem_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIItemEntry.h" | #include "CEGUIItemEntry.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Base class for menu items. | Base class for menu items. | |||
*/ | */ | |||
class CEGUIEXPORT MenuItem : public ItemEntry | class CEGUIEXPORT MenuItem : public ItemEntry | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIMenubar.h | CEGUIMenubar.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMenubar_h_ | #ifndef _CEGUIMenubar_h_ | |||
#define _CEGUIMenubar_h_ | #define _CEGUIMenubar_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIMenuBase.h" | #include "CEGUIMenuBase.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIMouseCursor.h | CEGUIMouseCursor.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIMouseCursor.h | filename: CEGUIMouseCursor.h | |||
created: 21/2/2004 | created: 21/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Defines interface for the MouseCursor class | purpose: Defines interface for the MouseCursor class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 244 | skipping to change at line 243 | |||
*/ | */ | |||
bool isVisible(void) const {return d_visible;} | bool isVisible(void) const {return d_visible;} | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current mouse cursor position as a pixel offset f rom the top-left corner of the display. | Return the current mouse cursor position as a pixel offset f rom the top-left corner of the display. | |||
\return | \return | |||
Point object describing the mouse cursor position in screen pixels. | Point object describing the mouse cursor position in screen pixels. | |||
*/ | */ | |||
Point getPosition(void) const {return Point(d_position.d_x | Point getPosition(void) const | |||
, d_position.d_y);} | { return d_position; } | |||
/*! | /*! | |||
\brief | \brief | |||
return the current constraint area of the mouse cursor. | return the current constraint area of the mouse cursor. | |||
\return | \return | |||
Rect object describing the active area that the mouse cursor is constrained to. | Rect object describing the active area that the mouse cursor is constrained to. | |||
*/ | */ | |||
Rect getConstraintArea(void) const; | Rect getConstraintArea(void) const; | |||
skipping to change at line 275 | skipping to change at line 275 | |||
\brief | \brief | |||
Return the current mouse cursor position as display resoluti on independant values. | Return the current mouse cursor position as display resoluti on independant values. | |||
\return | \return | |||
Point object describing the current mouse cursor position as resolution independant values that | Point object describing the current mouse cursor position as resolution independant values that | |||
range from 0.0f to 1.0f, where 0.0f represents the left-most and top-most positions, and 1.0f | range from 0.0f to 1.0f, where 0.0f represents the left-most and top-most positions, and 1.0f | |||
represents the right-most and bottom-most positions. | represents the right-most and bottom-most positions. | |||
*/ | */ | |||
Point getDisplayIndependantPosition(void) const; | Point getDisplayIndependantPosition(void) const; | |||
/*! | ||||
\brief | ||||
Function used to notify the MouseCursor of changes in the display s | ||||
ize. | ||||
You normally would not call this directly; rather you would call th | ||||
e | ||||
function System::notifyDisplaySizeChanged and that will then call t | ||||
his | ||||
function for you. | ||||
\param new_size | ||||
Size object describing the new display size in pixels. | ||||
*/ | ||||
void notifyDisplaySizeChanged(const Size& new_size); | ||||
protected: | protected: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
New event handlers | New event handlers | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
event triggered internally when image of mouse cursor change s | event triggered internally when image of mouse cursor change s | |||
*/ | */ | |||
virtual void onImageChanged(MouseCursorEventArgs& e); | virtual void onImageChanged(MouseCursorEventArgs& e); | |||
skipping to change at line 299 | skipping to change at line 312 | |||
/*! | /*! | |||
\brief | \brief | |||
Checks the mouse cursor position is within the current 'cons train' Rect and adjusts as required. | Checks the mouse cursor position is within the current 'cons train' Rect and adjusts as required. | |||
*/ | */ | |||
void constrainPosition(void); | void constrainPosition(void); | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
const Image* d_cursorImage; //!< Image that is currently set as the mouse cursor. | const Image* d_cursorImage; //!< Image that is currently set as the mouse cursor. | |||
Vector3 d_position; //!< Current location of the cursor | Vector2 d_position; //!< Current location of the cursor | |||
bool d_visible; //!< true if the cursor will be drawn, else false. | bool d_visible; //!< true if the cursor will be drawn, else false. | |||
URect d_constraints; //!< Specifies the a rea (in screen pixels) that the mouse can move around in. | URect d_constraints; //!< Specifies the a rea (in screen pixels) that the mouse can move around in. | |||
//! buffer to hold geometry for mouse cursor imagery. | ||||
GeometryBuffer* d_geometry; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIMouseCursor_h_ | #endif // end of guard _CEGUIMouseCursor_h_ | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 22 lines changed or added | |||
CEGUIMultiColumnList.h | CEGUIMultiColumnList.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMultiColumnList_h_ | #ifndef _CEGUIMultiColumnList_h_ | |||
#define _CEGUIMultiColumnList_h_ | #define _CEGUIMultiColumnList_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIListHeader.h" | #include "CEGUIListHeader.h" | |||
#include "elements/CEGUIMultiColumnListProperties.h" | #include "CEGUIMultiColumnListProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
skipping to change at line 503 | skipping to change at line 503 | |||
- true if there is a ListboxItem at \a grid_ref and it is se lected. | - true if there is a ListboxItem at \a grid_ref and it is se lected. | |||
- false if there is no ListboxItem at \a grid_ref, or if the item is not selected. | - false if there is no ListboxItem at \a grid_ref, or if the item is not selected. | |||
\exception InvalidRequestException thrown if \a grid_ref contai ns an invalid grid position. | \exception InvalidRequestException thrown if \a grid_ref contai ns an invalid grid position. | |||
*/ | */ | |||
bool isItemSelected(const MCLGridRef& grid_ref) const; | bool isItemSelected(const MCLGridRef& grid_ref) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the ID of the currently set nominated selection colum n to be used when in one of the NominatedColumn* | Return the ID of the currently set nominated selection colum n to be used when in one of the NominatedColumn* | |||
selection modes. | selection modes. There must be at least one column to succes sfully call this method. | |||
\note | \note | |||
You should only ever call this when getColumnCount() returns > 0. | You should only ever call this when getColumnCount() returns > 0. | |||
\return | \return | |||
ID code of the nominated selection column. | ID code of the nominated selection column. | |||
*/ | */ | |||
uint getNominatedSelectionColumnID(void) const; | uint getNominatedSelectionColumnID(void) const; | |||
/*! | /*! | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIMultiColumnListProperties.h | CEGUIMultiColumnListProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMultiColumnListProperties_h_ | #ifndef _CEGUIMultiColumnListProperties_h_ | |||
#define _CEGUIMultiColumnListProperties_h_ | #define _CEGUIMultiColumnListProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of MultiColumnListProperties namespace section | // Start of MultiColumnListProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the MultiColumnList class | Namespace containing all classes that make up the properties interfa ce for the MultiColumnList class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIMultiLineEditbox.h | CEGUIMultiLineEditbox.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMultiLineEditbox_h_ | #ifndef _CEGUIMultiLineEditbox_h_ | |||
#define _CEGUIMultiLineEditbox_h_ | #define _CEGUIMultiLineEditbox_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIFont.h" | #include "../CEGUIFont.h" | |||
#include "elements/CEGUIMultiLineEditboxProperties.h" | #include "CEGUIMultiLineEditboxProperties.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIMultiLineEditboxProperties.h | CEGUIMultiLineEditboxProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIMultiLineEditboxProperties_h_ | #ifndef _CEGUIMultiLineEditboxProperties_h_ | |||
#define _CEGUIMultiLineEditboxProperties_h_ | #define _CEGUIMultiLineEditboxProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of MultiLineEditboxProperties namespace section | // Start of MultiLineEditboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the MultiLineEditbox class | Namespace containing all classes that make up the properties interfa ce for the MultiLineEditbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIPixmapFont.h | CEGUIPixmapFont.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIPixmapFont.h | filename: CEGUIPixmapFont.h | |||
created: 14/6/2006 | created: 14/6/2006 | |||
author: Andrew Zabolotny | author: Andrew Zabolotny | |||
purpose: Implementation of the Font class via static imagesets | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 34 | skipping to change at line 32 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIPixmapFont_h_ | #ifndef _CEGUIPixmapFont_h_ | |||
#define _CEGUIPixmapFont_h_ | #define _CEGUIPixmapFont_h_ | |||
#include "CEGUIFont.h" | #include "CEGUIFont.h" | |||
#include "CEGUIImage.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Forward declarations for font properties | ||||
namespace FontProperties | ||||
{ | ||||
class PixmapImageset; | ||||
class PixmapMapping; | ||||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
Implementation of the Font class interface using static Imageset's. | Implementation of the Font class interface using static Imageset's. | |||
To create such a font you must create a Imageset with all the glyphs, | To create such a font you must create a Imageset with all the glyphs, | |||
and then define individual glyphs via the Mapping object property | and then define individual glyphs via defineMapping. | |||
(or via the Mapping XML element). | ||||
*/ | */ | |||
class PixmapFont : public Font | class PixmapFont : public Font | |||
{ | { | |||
protected: | public: | |||
friend class FontManager; | ||||
friend class FontProperties::PixmapImageset; | ||||
friend class FontProperties::PixmapMapping; | ||||
/// The imageset with the glyphs | ||||
Imageset *d_glyphImages; | ||||
/// Current X scaling for glyph images | ||||
float d_origHorzScaling; | ||||
/// true if we're the owners of the imageset | ||||
bool d_imagesetOwner; | ||||
/*! | /*! | |||
\brief | \brief | |||
Constructs a new semi-complete Font object. It is the responsabilit | Constructor for Pixmap type fonts. | |||
y | ||||
of the user to define the glyph mapping (via the Mapping property), | ||||
and finally call the load() method which will make font available | ||||
for use (this is not *required* for PixmapFont, though). | ||||
All font parameters that are not initialized are set to sensible | \param font_name | |||
default values. | The name that the font will use within the CEGUI system. | |||
\param name | \param imageset_filename | |||
The unique name that will be used to identify this Font. | The filename of an imageset to load that will be used as the source | |||
for | ||||
glyph images for this font. If \a resource_group is the special va | ||||
lue | ||||
of "*", this parameter may instead refer to the name of an already | ||||
loaded Imagset. | ||||
\param fontname | \param resource_group | |||
The filename of the font file, which contains the font data. | The resource group identifier to use when loading the imageset file | |||
This can be a TrueType, PostScript, bitmap font etc file. | specified by \a imageset_filename. If this group is set to the spe | |||
If resourceGroup is set to the special value of "*", | cial | |||
fontname is interpreted as a imageset name and the respective | value of "*", then \a imageset_filename instead will refer to the n | |||
Imageset object must be already loaded. | ame | |||
of an existing Imageset. | ||||
\param resourceGroup | \param auto_scaled | |||
Resource group identifier to be passed to the resource provider | Specifies whether the font imagery should be automatically scaled t | |||
to load the font definition file. | o | |||
maintain the same physical size (which is calculated by using the | ||||
native resolution setting). | ||||
\exception | \param native_horz_res | |||
UnknownObjectException Thrown if no Imageset named \a filename is | The horizontal native resolution value. This is only significant w | |||
present in within the system (when resourceGroup == "*"). | hen | |||
*/ | auto scaling is enabled. | |||
PixmapFont (const String& name, const String& fontname, | ||||
const String& resourceGroup = ""); | ||||
/// \copydoc Font::Font | \param native_vert_res | |||
PixmapFont (const XMLAttributes& attributes); | The vertical native resolution value. This is only significant whe | |||
n | ||||
auto scaling is enabled. | ||||
*/ | ||||
PixmapFont(const String& font_name, const String& imageset_filename, | ||||
const String& resource_group = "", | ||||
const bool auto_scaled = false, | ||||
const float native_horz_res = 640.0f, | ||||
const float native_vert_res = 480.0f); | ||||
/// \copydoc Font::~Font | //! Destructor. | |||
virtual ~PixmapFont (); | ~PixmapFont(); | |||
/// \copydoc Font::updateFont | void defineMapping(const utf32 codepoint, const String& image_name, | |||
virtual void updateFont (); | const float horz_advance); | |||
/// \copydoc Font::writeXMLToStream_impl | //! Return the name of the imageset the font is using for it's glyphs. | |||
virtual void writeXMLToStream_impl (XMLSerializer& xml_stream) const; | const String& getImageset() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Define a glyph mapping (handle a <Mapping /> XML element) | Set Imageset the font is using for it's glyphs. | |||
*/ | ||||
virtual void defineMapping (const XMLAttributes& attributes); | ||||
/*! | This will potentially cause an existing imageset to be unloaded (if | |||
\brief | it | |||
Define a single glyph mapping | was created specifically by, and for, this Font). The new Imageset | |||
*/ | must already exist within the system. | |||
void defineMapping (String image_name, utf32 codepoint, float horzAdvan | ||||
ce); | ||||
/*! | \param imageset | |||
\brief | Name ofan existing image set to be used as the glyph source for thi | |||
Register all properties of this class. | s | |||
*/ | Font. | |||
void addPixmapFontProperties (); | ||||
/*! | \exception UnknownObjectException | |||
\brief | thrown if \a imageset is not known in the system. | |||
Initialize the imageset. | ||||
*/ | */ | |||
void reinit (); | void setImageset(const String& imageset); | |||
public: | protected: | |||
/// \copydoc Font::load | //! Initialize the imageset. | |||
virtual void load (); | void reinit(); | |||
//! Register all properties of this class. | ||||
void addPixmapFontProperties(); | ||||
// override of functions in Font base class. | ||||
void updateFont (); | ||||
void writeXMLToStream_impl (XMLSerializer& xml_stream) const; | ||||
//! The imageset with the glyphs | ||||
Imageset* d_glyphImages; | ||||
//! Current X scaling for glyph images | ||||
float d_origHorzScaling; | ||||
//! true if we own the imageset | ||||
bool d_imagesetOwner; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIPixmapFont_h_ | #endif // end of guard _CEGUIPixmapFont_h_ | |||
End of changes. 22 change blocks. | ||||
83 lines changed or deleted | 76 lines changed or added | |||
CEGUIPopupMenu.h | CEGUIPopupMenu.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIPopupMenu_h_ | #ifndef _CEGUIPopupMenu_h_ | |||
#define _CEGUIPopupMenu_h_ | #define _CEGUIPopupMenu_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIPopupMenuProperties.h" | #include "CEGUIPopupMenuProperties.h" | |||
#include "elements/CEGUIMenuBase.h" | #include "CEGUIMenuBase.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUIPopupMenuProperties.h | CEGUIPopupMenuProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIPopupMenuProperties_h_ | #ifndef _CEGUIPopupMenuProperties_h_ | |||
#define _CEGUIPopupMenuProperties_h_ | #define _CEGUIPopupMenuProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemListBaseProperties namespace section | // Start of ItemListBaseProperties namespace section | |||
namespace PopupMenuProperties | namespace PopupMenuProperties | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIProgressBar.h | CEGUIProgressBar.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIProgressBar_h_ | #ifndef _CEGUIProgressBar_h_ | |||
#define _CEGUIProgressBar_h_ | #define _CEGUIProgressBar_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIProgressBarProperties.h" | #include "CEGUIProgressBarProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIProgressBarProperties.h | CEGUIProgressBarProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIProgressBarProperties_h_ | #ifndef _CEGUIProgressBarProperties_h_ | |||
#define _CEGUIProgressBarProperties_h_ | #define _CEGUIProgressBarProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ProgressBarProperties namespace section | // Start of ProgressBarProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the ProgressBar class | Namespace containing all classes that make up the properties interfa ce for the ProgressBar class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIPropertyHelper.h | CEGUIPropertyHelper.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
*/ | */ | |||
class CEGUIEXPORT PropertyHelper | class CEGUIEXPORT PropertyHelper | |||
{ | { | |||
public: | public: | |||
static float stringToFloat(const String& str); | static float stringToFloat(const String& str); | |||
static uint stringToUint(const String& str); | static uint stringToUint(const String& str); | |||
static int stringToInt(const String& str); | static int stringToInt(const String& str); | |||
static bool stringToBool(const String& str); | static bool stringToBool(const String& str); | |||
static Size stringToSize(const String& str); | static Size stringToSize(const String& str); | |||
static Point stringToPoint(const String& str); | static Point stringToPoint(const String& str); | |||
static Vector3 stringToVector3(const String& str); | ||||
static Rect stringToRect(const String& str); | static Rect stringToRect(const String& str); | |||
static const Image* stringToImage(const String& str); | static const Image* stringToImage(const String& str); | |||
static colour stringToColour(const String& str); | static colour stringToColour(const String& str); | |||
static ColourRect stringToColourRect(const String& str); | static ColourRect stringToColourRect(const String& str); | |||
static UDim stringToUDim(const String& str); | static UDim stringToUDim(const String& str); | |||
static UVector2 stringToUVector2(const String& str); | static UVector2 stringToUVector2(const String& str); | |||
static URect stringToURect(const String& str); | static URect stringToURect(const String& str); | |||
static String floatToString(float val); | static String floatToString(float val); | |||
static String uintToString(uint val); | static String uintToString(uint val); | |||
static String intToString(int val); | static String intToString(int val); | |||
static String boolToString(bool val); | static String boolToString(bool val); | |||
static String sizeToString(const Size& val); | static String sizeToString(const Size& val); | |||
static String pointToString(const Point& val); | static String pointToString(const Point& val); | |||
static String vector3ToString(const Vector3& val); | ||||
static String rectToString(const Rect& val); | static String rectToString(const Rect& val); | |||
static String imageToString(const Image* const val); | static String imageToString(const Image* const val); | |||
static String colourToString(const colour& val); | static String colourToString(const colour& val); | |||
static String colourRectToString(const ColourRect& val); | static String colourRectToString(const ColourRect& val); | |||
static String udimToString(const UDim& val); | static String udimToString(const UDim& val); | |||
static String uvector2ToString(const UVector2& val); | static String uvector2ToString(const UVector2& val); | |||
static String urectToString(const URect& val); | static String urectToString(const URect& val); | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
CEGUIPushButton.h | CEGUIPushButton.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIPushButton_h_ | #ifndef _CEGUIPushButton_h_ | |||
#define _CEGUIPushButton_h_ | #define _CEGUIPushButton_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "elements/CEGUIButtonBase.h" | #include "CEGUIButtonBase.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIRadioButton.h | CEGUIRadioButton.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIRadioButton_h_ | #ifndef _CEGUIRadioButton_h_ | |||
#define _CEGUIRadioButton_h_ | #define _CEGUIRadioButton_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "elements/CEGUIButtonBase.h" | #include "CEGUIButtonBase.h" | |||
#include "elements/CEGUIRadioButtonProperties.h" | #include "CEGUIRadioButtonProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIRadioButtonProperties.h | CEGUIRadioButtonProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIRadioButtonProperties_h_ | #ifndef _CEGUIRadioButtonProperties_h_ | |||
#define _CEGUIRadioButtonProperties_h_ | #define _CEGUIRadioButtonProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of RadioButtonProperties namespace section | // Start of RadioButtonProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the RadioButton class | Namespace containing all classes that make up the properties interfa ce for the RadioButton class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIRenderer.h | CEGUIRenderer.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIRenderer.h | filename: CEGUIRenderer.h | |||
created: 20/2/2004 | created: 20/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Defines interface for abstract Renderer class | purpose: Defines interface for abstract Renderer class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 34 | skipping to change at line 34 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIRenderer_h_ | #ifndef _CEGUIRenderer_h_ | |||
#define _CEGUIRenderer_h_ | #define _CEGUIRenderer_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | ||||
#include "CEGUIRect.h" | ||||
#include "CEGUIColourRect.h" | ||||
#include "CEGUIEventSet.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
//------------------------------------------------------------------------- ---// | ||||
/*! | /*! | |||
\brief | \brief | |||
Enumerated type that contains the valid flags that can be to use whe | Enumerated type that contains the valid diagonal-mode that specify how | |||
n rendering image | a | |||
*/ | quad is split into triangles when rendered with by a 3D API. | |||
enum OrientationFlags { | ||||
FlipHorizontal = 1, //!< Horizontal flip the image | ||||
FlipVertical = 2, //!< Vertical flip the image | ||||
RotateRightAngle = 4 //!< Rotate the image anticl | ||||
ockwise 90 degree | ||||
}; | ||||
/*! | ||||
\brief | ||||
Enumerated type that contains the valid diagonal-mode that specify h | ||||
ow a quad is split into triangles when rendered with fx. a 3D API | ||||
*/ | */ | |||
enum QuadSplitMode | enum QuadSplitMode | |||
{ | { | |||
TopLeftToBottomRight, //!< Diagonal goes from top-left to bottom-r | //! Diagonal split goes from top-left to bottom-right | |||
ight | TopLeftToBottomRight, | |||
BottomLeftToTopRight //!< Diagonal goes from bottom-left to top-r | //! Diagonal split goes from bottom-left to top-right | |||
ight | BottomLeftToTopRight | |||
}; | }; | |||
//------------------------------------------------------------------------- | ||||
---// | ||||
/*! | /*! | |||
\brief | \brief | |||
Abstract class defining the interface for Renderer objects. | Abstract class defining the basic required interface for Renderer objec ts. | |||
Objects derived from Renderer are the means by which the GUI system | Objects derived from Renderer are the means by which the GUI system | |||
interfaces | interfaces with specific rendering technologies. To use a rendering sy | |||
with specific rendering technologies. To use a rendering system or | stem | |||
API to draw | or API to draw CEGUI imagery requires that an appropriate Renderer obje | |||
CEGUI imagery requires that an appropriate Renderer object be availa | ct be | |||
ble. | available. | |||
*/ | */ | |||
class CEGUIEXPORT Renderer : public EventSet | class CEGUIEXPORT Renderer | |||
{ | { | |||
public: | public: | |||
static const String EventNamespace; //!< | /*! | |||
Namespace for global events | \brief | |||
Return the default rendering root for the renderer. The default | ||||
/******************************************************************* | rendering root is typically a RenderingRoot that targets the entire | |||
****** | screen (or rendering window). | |||
Event name constants | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
event that fires when the underlying display size had change | ||||
d. | ||||
It is important that all Renderer implementers fire this pro | ||||
perly as the | ||||
system itself subscribes to this event. | ||||
*/ | ||||
static const String EventDisplaySizeChanged; | ||||
/******************************************************************* | ||||
****** | ||||
Abstract interface methods | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Add a quad to the rendering queue. All clipping and other a | ||||
djustments should have been made prior to calling this. | ||||
\param dest_rect | ||||
Rect object describing the destination area (values are in p | ||||
ixels) | ||||
\param z | ||||
float value specifying the z co-ordinate / z order of the qu | ||||
ad | ||||
\param tex | ||||
pointer to the Texture object that holds the imagery to be r | ||||
endered | ||||
\param texture_rect | ||||
Rect object holding the area of \a tex that is to be rendere | ||||
d (values are in texture co-ordinates). | ||||
\param colours | \return | |||
ColourRect object describing the colour values that are to b | RenderingRoot object that is the default RenderingSurface provided | |||
e applied when rendering. | by | |||
the Renderer. | ||||
*/ | ||||
virtual RenderingRoot& getDefaultRenderingRoot() = 0; | ||||
\param quad_split_mode | /*! | |||
One of the QuadSplitMode values specifying the way quads are | \brief | |||
split into triangles | Create a new GeometryBuffer and return a reference to it. You shou | |||
ld | ||||
remove the GeometryBuffer from any RenderQueues and call | ||||
destroyGeometryBuffer when you want to destroy the GeometryBuffer. | ||||
\return | \return | |||
Nothing | GeometryBuffer object. | |||
*/ | */ | |||
virtual void addQuad(const Rect& dest_rect, float z, const Textur | virtual GeometryBuffer& createGeometryBuffer() = 0; | |||
e* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode | ||||
quad_split_mode) = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Perform final rendering for all quads that have been queued | Destroy a GeometryBuffer that was returned when calling the | |||
for rendering | createGeometryBuffer function. Before destroying any GeometryBuffe | |||
r | ||||
you should ensure that it has been removed from any RenderQueue tha | ||||
t | ||||
was using it. | ||||
The contents of the rendering queue is retained and can be r | \param buffer | |||
endered again as required. If the contents is not required call clearRende | The GeometryBuffer object to be destroyed. | |||
rList(). | */ | |||
virtual void destroyGeometryBuffer(const GeometryBuffer& buffer) = 0; | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Destroy all GeometryBuffer objects created by this Renderer. | |||
virtual void doRender(void) = 0; | */ | |||
virtual void destroyAllGeometryBuffers() = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Clears all queued quads from the render queue. | Create a TextureTarget that can be used to cache imagery; this is a | |||
RenderTarget that does not lose it's content from one frame to anot | ||||
her. | ||||
\return | If the renderer is unable to offer such a thing, 0 should be return | |||
Nothing | ed. | |||
*/ | ||||
virtual void clearRenderList(void) = 0; | ||||
/*! | \return | |||
\brief | Pointer to a TextureTarget object that is suitable for caching imag | |||
Enable or disable the queueing of quads from this point on. | ery, | |||
or 0 if the renderer is unable to offer such a thing. | ||||
*/ | ||||
virtual TextureTarget* createTextureTarget() = 0; | ||||
This only affects queueing. If queueing is turned off, any | /*! | |||
calls to addQuad will cause the quad to be rendered directly. Note that | \brief | |||
disabling queueing will not cause currently queued quads to | Function that cleans up TextureTarget objects created with the | |||
be rendered, nor is the queue cleared - at any time the queue can still | createTextureTarget function. | |||
be drawn by calling doRender, and the list can be cleared by | ||||
calling clearRenderList. Re-enabling the queue causes subsequent quads | ||||
to be added as if queueing had never been disabled. | ||||
\param setting | \param target | |||
true to enable queueing, or false to disable queueing (see n | A pointer to a TextureTarget object that was previously returned fr | |||
otes above). | om a | |||
call to createTextureTarget. | ||||
*/ | ||||
virtual void destroyTextureTarget(TextureTarget* target) = 0; | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Destory all TextureTarget objects created by this Renderer. | |||
virtual void setQueueingEnabled(bool setting) = 0; | */ | |||
virtual void destroyAllTextureTargets() = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Creates a 'null' Texture object. | Create a 'null' Texture object. | |||
\return | \return | |||
a newly created Texture object. The returned Texture object | A newly created Texture object. The returned Texture object has no | |||
has no size or imagery associated with it, and is | size | |||
generally of little or no use. | or imagery associated with it. | |||
*/ | */ | |||
virtual Texture* createTexture(void) = 0; | virtual Texture& createTexture() = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Create a Texture object using the given image file. | Create a Texture object using the given image file. | |||
\param filename | \param filename | |||
String object that specifies the path and filename of the im | String object that specifies the path and filename of the image fil | |||
age file to use when creating the texture. | e to | |||
use when creating the texture. | ||||
\param resourceGroup | \param resourceGroup | |||
Resource group identifier to be passed to the resource provider whe | String objet that specifies the resource group identifier to be pas | |||
n loading the texture file. | sed | |||
to the resource provider when loading the texture file \a filename. | ||||
\return | ||||
a newly created Texture object. The initial contents of the | ||||
texture memory is the requested image file. | ||||
\note | ||||
Textures are always created with a size that is a power of 2 | ||||
. If the file you specify is of a size that is not | ||||
a power of two, the final size will be rounded up. Addition | ||||
ally, textures are always square, so the ultimate | ||||
size is governed by the larger of the width and height of th | ||||
e specified file. You can check the ultimate sizes | ||||
by querying the texture after creation. | ||||
*/ | ||||
virtual Texture* createTexture(const String& filename, const | ||||
String& resourceGroup) = 0; | ||||
/*! | ||||
\brief | ||||
Create a Texture object with the given pixel dimensions as s | ||||
pecified by \a size. NB: Textures are always square. | ||||
\param size | ||||
float value that specifies the size to use for the width and | ||||
height when creating the new texture. | ||||
\return | ||||
a newly created Texture object. The initial contents of the | ||||
texture memory is undefined / random. | ||||
\note | ||||
Textures are always created with a size that is a power of 2 | ||||
. If you specify a size that is not a power of two, the final | ||||
size will be rounded up. So if you specify a size of 1024, | ||||
the texture will be (1024 x 1024), however, if you specify a size | ||||
of 1025, the texture will be (2048 x 2048). You can check t | ||||
he ultimate size by querying the texture after creation. | ||||
*/ | ||||
virtual Texture* createTexture(float size) = 0; | ||||
/*! | ||||
\brief | ||||
Destroy the given Texture object. | ||||
\param texture | ||||
pointer to the Texture object to be destroyed | ||||
\return | ||||
Nothing | ||||
*/ | ||||
virtual void destroyTexture(Texture* texture) = 0; | ||||
/*! | ||||
\brief | ||||
Destroy all Texture objects. | ||||
\return | ||||
Nothing | ||||
*/ | ||||
virtual void destroyAllTextures(void) = 0; | ||||
/*! | ||||
\brief | ||||
Return whether queueing is enabled. | ||||
\return | ||||
true if queueing is enabled, false if queueing is disabled. | ||||
*/ | ||||
virtual bool isQueueingEnabled(void) const = 0; | ||||
/*! | ||||
\brief | ||||
Return the current width of the display in pixels | ||||
\return | ||||
float value equal to the current width of the display in pix | ||||
els. | ||||
*/ | ||||
virtual float getWidth(void) const = 0; | ||||
/*! | ||||
\brief | ||||
Return the current height of the display in pixels | ||||
\return | ||||
float value equal to the current height of the display in pi | ||||
xels. | ||||
*/ | ||||
virtual float getHeight(void) const = 0; | ||||
/*! | ||||
\brief | ||||
Return the size of the display in pixels | ||||
\return | ||||
Size object describing the dimensions of the current display | ||||
. | ||||
*/ | ||||
virtual Size getSize(void) const = 0; | ||||
/*! | \return | |||
\brief | A newly created Texture object. The initial content of the texture | |||
Return a Rect describing the screen | memory is the requested image file. | |||
\return | \note | |||
A Rect object that describes the screen area. Typically, th | Due to possible limitations of the underlying hardware, API or engi | |||
e top-left values are always 0, and the size of the area described is | ne, | |||
equal to the screen resolution. | the final size of the texture may not match the size of the loaded | |||
*/ | file. | |||
virtual Rect getRect(void) const = 0; | You can check the ultimate sizes by querying the Texture object | |||
after creation. | ||||
*/ | ||||
virtual Texture& createTexture(const String& filename, | ||||
const String& resourceGroup) = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the maximum texture size available | Create a Texture object with the given pixel dimensions as specifie | |||
d by | ||||
\a size. | ||||
\return | \param size | |||
Size of the maximum supported texture in pixels (textures ar | Size object that describes the desired texture size. | |||
e always assumed to be square) | ||||
*/ | ||||
virtual uint getMaxTextureSize(void) const = 0; | ||||
/*! | \return | |||
\brief | A newly created Texture object. The initial contents of the textur | |||
Return the horizontal display resolution dpi | e | |||
memory is undefined. | ||||
\return | \note | |||
horizontal resolution of the display in dpi. | Due to possible limitations of the underlying hardware, API or engi | |||
*/ | ne, | |||
virtual uint getHorzScreenDPI(void) const = 0; | the final size of the texture may not match the requested size. Yo | |||
u can | ||||
check the ultimate sizes by querying the Texture object after creat | ||||
ion. | ||||
*/ | ||||
virtual Texture& createTexture(const Size& size) = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the vertical display resolution dpi | Destroy a Texture object that was previously created by calling the | |||
createTexture functions. | ||||
\return | \param texture | |||
vertical resolution of the display in dpi. | Texture object to be destroyed. | |||
*/ | */ | |||
virtual uint getVertScreenDPI(void) const = 0; | virtual void destroyTexture(Texture& texture) = 0; | |||
/******************************************************************* | /*! | |||
****** | \brief | |||
Basic stuff we provide in base class | Destroy all Texture objects created by this Renderer. | |||
******************************************************************** | */ | |||
*****/ | virtual void destroyAllTextures() = 0; | |||
/*! | ||||
\brief | ||||
Reset the z co-ordinate for rendering. | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Perform any operations required to put the system into a state read | |||
void resetZValue(void) {d_current_z | y | |||
= GuiZInitialValue;} | for rendering operations to begin. | |||
*/ | ||||
virtual void beginRendering() = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Update the z co-ordinate for the next major UI element (wind | Perform any operations required to finalise rendering. | |||
ow). | */ | |||
virtual void endRendering() = 0; | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Set the size of the display or host window in pixels for this Rende | |||
void advanceZValue(void) {d_current_z | rer | |||
-= GuiZElementStep;} | object. | |||
/*! | This is intended to be called by the System as part of the notifica | |||
\brief | tion | |||
return the current Z value to use (equates to layer 0 for th | process when display size changes are notified to it via the | |||
is UI element). | System::notifyDisplaySizeChanged function. | |||
\return | \note | |||
float value that specifies the z co-ordinate to be used for | The Renderer implementation should not use this function other than | |||
layer 0 on the current GUI element. | to | |||
*/ | perform internal state updates on the Renderer and related objects. | |||
float getCurrentZ(void) const {return d_current_z; | ||||
} | ||||
/*! | \param size | |||
\brief | Size object describing the dimesions of the current or host window | |||
return the z co-ordinate to use for the requested layer on t | in | |||
he current GUI element. | pixels. | |||
*/ | ||||
virtual void setDisplaySize(const Size& size) = 0; | ||||
\param layer | /*! | |||
Specifies the layer to return the Z co-ordinate for. Each G | \brief | |||
UI element can use up to 10 layers, so valid inputs are 0 to 9 inclusive. | Return the size of the display or host window in pixels. | |||
If you specify an invalid value for \a layer, results are un | ||||
defined. | ||||
\return | \return | |||
float value that specifies the Z co-ordinate for layer \a la | Size object describing the pixel dimesntions of the current display | |||
yer on the current GUI element. | or | |||
*/ | host window. | |||
float getZLayer(uint layer) const {return d_current_z | */ | |||
- ((float)layer * GuiZLayerStep);} | virtual const Size& getDisplaySize() const = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Return identification string for the renderer module. If the inter | Return the resolution of the display or host window in dots per inc | |||
nal id string has not been | h. | |||
set by the Renderer module creator, a generic string of "Unknown re | ||||
nderer" will be returned. | ||||
\return | \return | |||
String object holding a string that identifies the Renderer in use. | Vector2 object that describes the resolution of the display or host | |||
window in DPI. | ||||
*/ | */ | |||
const String& getIdentifierString() const; | virtual const Vector2& getDisplayDPI() const = 0; | |||
virtual ResourceProvider* createResourceProvider(void); | ||||
protected: | /*! | |||
/******************************************************************* | \brief | |||
****** | Return the pixel size of the maximum supported texture. | |||
Construction and Destruction | ||||
******************************************************************** | ||||
*****/ | ||||
Renderer(void); | ||||
public: // for luabind support | \return | |||
virtual ~Renderer(void); | Size of the maximum supported texture in pixels. | |||
*/ | ||||
virtual uint getMaxTextureSize() const = 0; | ||||
private: | /*! | |||
/******************************************************************* | \brief | |||
****** | Return identification string for the renderer module. | |||
Implementation constants | ||||
******************************************************************** | ||||
*****/ | ||||
static const float GuiZInitialValue; //!< Initial | ||||
value to use for 'z' each frame. | ||||
static const float GuiZElementStep; //!< Value t | ||||
o step 'z' for each GUI element. | ||||
static const float GuiZLayerStep; //!< Value t | ||||
o step 'z' for each GUI layer. | ||||
/******************************************************************* | \return | |||
****** | String object holding text that identifies the Renderer in use. | |||
Implementation Data | */ | |||
******************************************************************** | virtual const String& getIdentifierString() const = 0; | |||
*****/ | ||||
float d_current_z; //!< The current z co-ordinate value | ||||
. | ||||
protected: | //! Destructor. | |||
ResourceProvider* d_resourceProvider; //!< Holds the pointer to th | virtual ~Renderer() {} | |||
e ResourceProvider object. | ||||
String d_identifierString; //!< String that holds some | ||||
id information about the renderer. | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIRenderer_h_ | #endif // end of guard _CEGUIRenderer_h_ | |||
End of changes. 55 change blocks. | ||||
360 lines changed or deleted | 216 lines changed or added | |||
CEGUIResourceProvider.h | CEGUIResourceProvider.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIResourceProvider_h_ | #ifndef _CEGUIResourceProvider_h_ | |||
#define _CEGUIResourceProvider_h_ | #define _CEGUIResourceProvider_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIDataContainer.h" | #include "CEGUIDataContainer.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include <vector> | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Abstract class that defines the required interface for all resource provider sub-classes. | Abstract class that defines the required interface for all resource provider sub-classes. | |||
A ResourceProvider is used to load both XML and binary data from an external source. This could be from a filesystem or the resource manager o f a specific renderer. | A ResourceProvider is used to load both XML and binary data from an external source. This could be from a filesystem or the resource manager o f a specific renderer. | |||
*/ | */ | |||
skipping to change at line 106 | skipping to change at line 107 | |||
/*! | /*! | |||
\brief | \brief | |||
Unload raw binary data. This gives the resource provider a change t o unload the data | Unload raw binary data. This gives the resource provider a change t o unload the data | |||
in its own way before the data container object is destroyed. If i t does nothing, | in its own way before the data container object is destroyed. If i t does nothing, | |||
then the object will release its memory. | then the object will release its memory. | |||
\param data | \param data | |||
Reference to a RawDataContainer object that is about to be destroye d. | Reference to a RawDataContainer object that is about to be destroye d. | |||
*/ | */ | |||
virtual void unloadRawDataContainer(RawDataContainer& data) { } | virtual void unloadRawDataContainer(RawDataContainer&) { } | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current default resource group identifier. | Return the current default resource group identifier. | |||
\return | \return | |||
String object containing the currently set default resource group i dentifier. | String object containing the currently set default resource group i dentifier. | |||
*/ | */ | |||
const String& getDefaultResourceGroup(void) const { return d_defa ultResourceGroup; } | const String& getDefaultResourceGroup(void) const { return d_defa ultResourceGroup; } | |||
skipping to change at line 129 | skipping to change at line 130 | |||
Set the default resource group identifier. | Set the default resource group identifier. | |||
\param resourceGroup | \param resourceGroup | |||
String object containing the default resource group identifier to b e used. | String object containing the default resource group identifier to b e used. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setDefaultResourceGroup(const String& resourceGroup) { d_def aultResourceGroup = resourceGroup; } | void setDefaultResourceGroup(const String& resourceGroup) { d_def aultResourceGroup = resourceGroup; } | |||
/** enumerate the files in \a resource_group that match \a file_pattern | ||||
and | ||||
append thier names to \a out_vec | ||||
*/ | ||||
virtual size_t getResourceGroupFileNames(std::vector<String>& out_vec, | ||||
const String& file_pattern, | ||||
const String& resource_group) | ||||
= 0; | ||||
protected: | protected: | |||
String d_defaultResourceGroup; //!< Default resource group identif ier. | String d_defaultResourceGroup; //!< Default resource group identif ier. | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIResourceProvider_h_ | #endif // end of guard _CEGUIResourceProvider_h_ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added | |||
CEGUIScheme.h | CEGUIScheme.h | |||
---|---|---|---|---|
skipping to change at line 122 | skipping to change at line 122 | |||
String describing the default resource group identifier to be used. | String describing the default resource group identifier to be used. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
static void setDefaultResourceGroup(const String& resourceGroup) | static void setDefaultResourceGroup(const String& resourceGroup) | |||
{ d_defaultResourceGroup = resourceGroup; } | { d_defaultResourceGroup = resourceGroup; } | |||
private: | private: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Constants | ||||
******************************************************************** | ||||
*****/ | ||||
static const char GUISchemeSchemaName[]; //!< | ||||
Filename of the XML schema used for validating GUIScheme files. | ||||
/******************************************************************* | ||||
****** | ||||
Friends | ||||
******************************************************************** | ||||
*****/ | ||||
friend Scheme* SchemeManager::loadScheme(const String& scheme_filen | ||||
ame, const String& resourceGroup); | ||||
friend void SchemeManager::unloadScheme(const String& scheme_nam | ||||
e); | ||||
/******************************************************************* | ||||
****** | ||||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Creates a scheme object from the data specified in the file | Constructs an empty scheme object with the specified name. | |||
\a filename | ||||
\param filename | ||||
String object holding the name of the file to use when creat | ||||
ing this Scheme object. | ||||
\param resourceGroup | ||||
Group identifier to be passed to the resource provider when loading | ||||
the scheme | ||||
specification file. | ||||
\return | \param name | |||
Nothing. | String object holding the name of the Scheme object. | |||
*/ | */ | |||
Scheme(const String& filename, const String& resourceGroup); | Scheme(const String& name); | |||
/*! | /*! | |||
\brief | \brief | |||
Load all XML based imagesets required by the scheme. | Load all XML based imagesets required by the scheme. | |||
*/ | */ | |||
void loadXMLImagesets(); | void loadXMLImagesets(); | |||
/*! | /*! | |||
\brief | \brief | |||
Load all image file based imagesets required by the scheme. | Load all image file based imagesets required by the scheme. | |||
skipping to change at line 328 | skipping to change at line 310 | |||
String name; | String name; | |||
}; | }; | |||
struct UIModule | struct UIModule | |||
{ | { | |||
String name; | String name; | |||
FactoryModule* module; | FactoryModule* module; | |||
std::vector<UIElementFactory> factories; | std::vector<UIElementFactory> factories; | |||
}; | }; | |||
struct WRModule | ||||
{ | ||||
String name; | ||||
DynamicModule* dynamicModule; | ||||
WindowRendererModule* wrModule; | ||||
std::vector<String> wrTypes; | ||||
}; | ||||
struct AliasMapping | struct AliasMapping | |||
{ | { | |||
String aliasName; | String aliasName; | |||
String targetName; | String targetName; | |||
}; | }; | |||
struct FalagardMapping | struct FalagardMapping | |||
{ | { | |||
String windowName; | String windowName; | |||
String targetName; | String targetName; | |||
skipping to change at line 351 | skipping to change at line 341 | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
String d_name; //!< the name of this scheme. | String d_name; //!< the name of this scheme. | |||
std::vector<LoadableUIElement> d_imagesets; | std::vector<LoadableUIElement> d_imagesets; | |||
std::vector<LoadableUIElement> d_imagesetsFromImages; | std::vector<LoadableUIElement> d_imagesetsFromImages; | |||
std::vector<LoadableUIElement> d_fonts; | std::vector<LoadableUIElement> d_fonts; | |||
std::vector<UIModule> d_widgetModules; | std::vector<UIModule> d_widgetModules; | |||
std::vector<UIModule> d_windowRendererModules; | std::vector<WRModule> d_windowRendererModules; | |||
std::vector<AliasMapping> d_aliasMappings; | std::vector<AliasMapping> d_aliasMappings; | |||
std::vector<LoadableUIElement> d_looknfeels; | std::vector<LoadableUIElement> d_looknfeels; | |||
std::vector<FalagardMapping> d_falagardMappings; | std::vector<FalagardMapping> d_falagardMappings; | |||
static String d_defaultResourceGroup; //!< holds default resource gro up | static String d_defaultResourceGroup; //!< holds default resource gro up | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
End of changes. 6 change blocks. | ||||
33 lines changed or deleted | 13 lines changed or added | |||
CEGUISchemeManager.h | CEGUISchemeManager.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUISchemeManager.h | filename: CEGUISchemeManager.h | |||
created: 21/2/2004 | created: Mon Jul 20 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines the interface to the SchemeManager class | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 34 | skipping to change at line 32 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUISchemeManager_h_ | #ifndef _CEGUISchemeManager_h_ | |||
#define _CEGUISchemeManager_h_ | #define _CEGUISchemeManager_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | ||||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
#include "CEGUINamedXMLResourceManager.h" | ||||
#include "CEGUIScheme.h" | ||||
#include "CEGUIScheme_xmlHandler.h" | ||||
#include "CEGUIIteratorBase.h" | #include "CEGUIIteratorBase.h" | |||
#include <map> | ||||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
A class that manages the creation of, access to, and destruction of | A class that manages the creation of, access to, and destruction of GUI | |||
GUI Scheme objects | Scheme objects | |||
*/ | */ | |||
class CEGUIEXPORT SchemeManager : public Singleton<SchemeManager> | class CEGUIEXPORT SchemeManager : | |||
public Singleton<SchemeManager>, | ||||
public NamedXMLResourceManager<Scheme, Scheme_xmlHandler> | ||||
{ | { | |||
public: | public: | |||
/*! | //! Constructor. | |||
\brief | SchemeManager(); | |||
Constructor for SchemeManager objects | ||||
*/ | ||||
SchemeManager(void); | ||||
/*! | ||||
\brief | ||||
Destructor for SchemeManager objects | ||||
*/ | ||||
~SchemeManager(void); | ||||
/*! | ||||
\brief | ||||
Loads a scheme | ||||
\param scheme_filename | ||||
String object that holds the filename of the scheme to be lo | ||||
aded | ||||
\param resourceGroup | ||||
Resource group identifier to be passed to the resource manager. NB | ||||
: This | ||||
affects loading of the scheme xml file only, scheme resources may s | ||||
pecify | ||||
their own groups. | ||||
\return | ||||
Pointer to an object representing the loaded Scheme. | ||||
*/ | ||||
Scheme* loadScheme(const String& scheme_filename, const String& reso | ||||
urceGroup = ""); | ||||
/*! | ||||
\brief | ||||
Unloads all data referenced in a scheme. If any object is u | ||||
sing some resource which is listed in the scheme, this function | ||||
will effectively pull the rug out from under those objects. | ||||
This should be used with extreme caution, or not at all. | ||||
\param scheme_name | ||||
String object specifying the name of the Scheme to be unload | ||||
ed. | ||||
*/ | ||||
void unloadScheme(const String& scheme_name); | ||||
/*! | ||||
\brief | ||||
Returns true if the named Scheme is present in the system (t | ||||
hough the resources for the scheme may or may not be loaded) | ||||
\param scheme_name | ||||
String object specifying the name of the Scheme to check for | ||||
. | ||||
\return | ||||
true if the scheme is loaded, false if it is not. | ||||
*/ | ||||
bool isSchemePresent(const String& scheme_name) const | ||||
{return (d_schemes.find(scheme_name) != d_schemes.end());} | ||||
/*! | ||||
\brief | ||||
Returns a pointer to the Scheme object with the specified na | ||||
me. | ||||
\param name | ||||
String object holding the name of the Scheme to be returned. | ||||
\return | ||||
Pointer to the Scheme named \a name. | ||||
\exception UnknownObjectException thrown if no Scheme named \a | ||||
name is present in the system | ||||
*/ | ||||
Scheme* getScheme(const String& name) const; | ||||
/*! | ||||
\brief | ||||
Unload all schemes currently defined within the system. | ||||
\note | ||||
Calling this method has the potential to be very dangerous; | ||||
if any of the | ||||
data that forms part of the scheme is still in use, you can | ||||
expect | ||||
fireworks shortly after! | ||||
\return | //! Destructor. | |||
Nothing. | ~SchemeManager(); | |||
*/ | ||||
void unloadAllSchemes(void); | ||||
private: | //! Definition of SchemeIterator type. | |||
/******************************************************************* | typedef ConstBaseIterator<ObjectRegistry> SchemeIterator; | |||
****** | ||||
Implementation Data | ||||
******************************************************************** | ||||
*****/ | ||||
typedef std::map<String, Scheme*, String::FastLessCompare> SchemeReg | ||||
istry; | ||||
SchemeRegistry d_schemes; //!< Collection that | ||||
tracks the loaded Schemes. | ||||
public: | /*! | |||
/******************************************************************* | \brief | |||
****** | Return a SchemeManager::SchemeIterator object to iterate over the | |||
Iterator stuff | available schemes. | |||
******************************************************************** | */ | |||
*****/ | SchemeIterator getIterator() const; | |||
typedef ConstBaseIterator<SchemeRegistry> SchemeIterator; | ||||
/*! | protected: | |||
\brief | // override from base | |||
Return a SchemeManager::SchemeIterator object to iterate ove | void doPostObjectAdditionAction(Scheme& object); | |||
r the available schemes. | ||||
*/ | ||||
SchemeIterator getIterator(void) const; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUISchemeManager_h_ | #endif // end of guard _CEGUISchemeManager_h_ | |||
End of changes. 15 change blocks. | ||||
129 lines changed or deleted | 31 lines changed or added | |||
CEGUIScheme_xmlHandler.h | CEGUIScheme_xmlHandler.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIScheme_xmlHandler.h | filename: CEGUIScheme_xmlHandler.h | |||
created: 21/2/2004 | created: Mon Jul 20 2009 | |||
author: Paul D Turner | author: Paul D Turner <paul@cegui.org.uk> | |||
purpose: Defines abstract base class for the GUI Scheme object. | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScheme_xmlHandler_h_ | #ifndef _CEGUIScheme_xmlHandler_h_ | |||
#define _CEGUIScheme_xmlHandler_h_ | #define _CEGUIScheme_xmlHandler_h_ | |||
#include "CEGUIScheme.h" | ||||
#include "CEGUIXMLHandler.h" | #include "CEGUIXMLHandler.h" | |||
#include "CEGUIString.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
//! Handler class used to parse the Scheme XML files using SAX2 | ||||
class CEGUIEXPORT Scheme_xmlHandler : public XMLHandler | ||||
{ | ||||
public: | ||||
//! Constructor. | ||||
Scheme_xmlHandler(const String& filename, const String& resource_group) | ||||
; | ||||
/*! | //! Destructor. | |||
\brief | ~Scheme_xmlHandler(); | |||
Handler class used to parse the Scheme XML files using SAX2 | ||||
*/ | ||||
class Scheme_xmlHandler : public XMLHandler | ||||
{ | ||||
public: | ||||
/****************************************************************** | ||||
******* | ||||
Construction & Destruction | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Constructor for Scheme::xmlHandler objects | ||||
\param scheme | ||||
Pointer to the Scheme object creating this xmlHandler object | ||||
*/ | ||||
Scheme_xmlHandler(Scheme* scheme) : d_scheme(scheme) | ||||
{} | ||||
/*! | ||||
\brief | ||||
Destructor for Scheme::xmlHandler objects | ||||
*/ | ||||
virtual ~Scheme_xmlHandler(void) | ||||
{} | ||||
/****************************************************************** | ||||
******* | ||||
SAX2 Handler overrides | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
document processing (only care about elements, schema validates | ||||
format) | ||||
*/ | ||||
virtual void elementStart(const String& element, const XMLAttribute | ||||
s& attributes); | ||||
virtual void elementEnd(const String& element); | ||||
private: | ||||
/****************************************************************** | ||||
******* | ||||
Implementation Constants | ||||
******************************************************************* | ||||
******/ | ||||
// XML related strings | ||||
static const String GUISchemeElement; //!< Root GUISc | ||||
heme element. | ||||
static const String ImagesetElement; //!< Element sp | ||||
ecifying an Imageset | ||||
static const String ImagesetFromImageElement; //!< Element sp | ||||
ecifying an Imageset to be created directly via an image file. | ||||
static const String FontElement; //!< Element sp | ||||
ecifying a Font | ||||
static const String WindowSetElement; //!< Element sp | ||||
ecifying a module and set of WindowFactory elements. | ||||
static const String WindowFactoryElement; //!< Element sp | ||||
ecifying a WindowFactory type. | ||||
static const String WindowAliasElement; //!< Element sp | ||||
ecifying a WindowFactory type alias | ||||
static const String FalagardMappingElement; //!< Element sp | ||||
ecifying a Falagard window mapping | ||||
static const String LookNFeelElement; //!< Element sp | ||||
ecifying a LookNFeel. | ||||
static const String NameAttribute; //!< Attribute | ||||
specifying the name of some object. | ||||
static const String FilenameAttribute; //!< Attribute | ||||
specifying the name of some file. | ||||
static const String AliasAttribute; //!< Attribute | ||||
specifying an alias name. | ||||
static const String TargetAttribute; //!< Attribute | ||||
specifying target for an alias. | ||||
static const String ResourceGroupAttribute; //!< Attribute | ||||
specifying resource group for some loadable resource. | ||||
static const String WindowTypeAttribute; //!< Attribute | ||||
specifying the type of a window being created via a mapping. | ||||
static const String TargetTypeAttribute; //!< Attribute | ||||
specifying the base target type of a falagard mapped window type. | ||||
static const String LookNFeelAttribute; //!< Attribute | ||||
specifying the name of a LookNFeel for a falagard mapping.. | ||||
static const String WindowRendererSetElement; //!< Element sp | ||||
ecifying a module and set of WindowRendererFactory elements. | ||||
static const String WindowRendererFactoryElement; //!< Element sp | ||||
ecifying a WindowRendererFactory type. | ||||
static const String WindowRendererAttribute; //!< Attribute | ||||
specifying the type name of a window renderer. | ||||
/*! | ||||
\brief | ||||
Method that handles the opening GUIScheme XML element. | ||||
*/ | ||||
void elementGUISchemeStart(const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Method that handles the Imageset XML element. | ||||
*/ | ||||
void elementImagesetStart(const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Method that handles the ImagesetFromImage XML element. | ||||
*/ | ||||
void elementImagesetFromImageStart(const XMLAttributes& attributes) | ||||
; | ||||
/*! | ||||
\brief | ||||
Method that handles the Font XML element. | ||||
*/ | ||||
void elementFontStart(const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Method that handles the WindowSet XML element. | ||||
*/ | ||||
void elementWindowSetStart(const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Method that handles the WindowFactory XML element. | ||||
*/ | ||||
void elementWindowFactoryStart(const XMLAttributes& attributes); | ||||
/*! | ||||
\brief | ||||
Method that handles the WindowRendererSet XML element. | ||||
*/ | ||||
void elementWindowRendererSetStart(const XMLAttributes& attributes) | ||||
; | ||||
/*! | //! Return string holding the name of the created Imageset. | |||
\brief | const String& getObjectName() const; | |||
Method that handles the WindowRendererFactory XML element. | ||||
*/ | ||||
void elementWindowRendererFactoryStart(const XMLAttributes& attribu | ||||
tes); | ||||
/*! | //! Return reference to the created Scheme object. | |||
\brief | Scheme& getObject() const; | |||
Method that handles the WindowAlias XML element. | ||||
*/ | ||||
void elementWindowAliasStart(const XMLAttributes& attributes); | ||||
/*! | // XMLHandler overrides | |||
\brief | void elementStart(const String& element, const XMLAttributes& attribute | |||
Method that handles the FalagardMapping XML element. | s); | |||
*/ | void elementEnd(const String& element); | |||
void elementFalagardMappingStart(const XMLAttributes& attributes); | ||||
/*! | private: | |||
\brief | //! Filename of the XML schema used for validating GUIScheme files. | |||
Method that handles the LookNFeel XML element. | static const String GUISchemeSchemaName; | |||
*/ | //! Root GUIScheme element. | |||
void elementLookNFeelStart(const XMLAttributes& attributes); | static const String GUISchemeElement; | |||
//! Element specifying an Imageset. | ||||
static const String ImagesetElement; | ||||
//! Element specifying an Imageset to be created directly via an image | ||||
file. | ||||
static const String ImagesetFromImageElement; | ||||
//! Element specifying a Font. | ||||
static const String FontElement; | ||||
//! Element specifying a module and set of WindowFactory elements. | ||||
static const String WindowSetElement; | ||||
//! Element specifying a WindowFactory type. | ||||
static const String WindowFactoryElement; | ||||
//! Element specifying a WindowFactory type alias. | ||||
static const String WindowAliasElement; | ||||
//! Element specifying a Falagard window mapping. | ||||
static const String FalagardMappingElement; | ||||
//! Element specifying a LookNFeel. | ||||
static const String LookNFeelElement; | ||||
//! Attribute specifying the name of some object. | ||||
static const String NameAttribute; | ||||
//! Attribute specifying the name of some file. | ||||
static const String FilenameAttribute; | ||||
//! Attribute specifying an alias name. | ||||
static const String AliasAttribute; | ||||
//! Attribute specifying target for an alias. | ||||
static const String TargetAttribute; | ||||
//! Attribute specifying resource group for some loadable resource. | ||||
static const String ResourceGroupAttribute; | ||||
//! Attribute specifying the type of a window being created via a mappi | ||||
ng. | ||||
static const String WindowTypeAttribute; | ||||
//! Attribute specifying the base type of a falagard mapped window type | ||||
. | ||||
static const String TargetTypeAttribute; | ||||
//! Attribute specifying the name of a LookNFeel for a falagard mapping | ||||
. | ||||
static const String LookNFeelAttribute; | ||||
//! Element specifying a module and set of WindowRendererFactory elemen | ||||
ts. | ||||
static const String WindowRendererSetElement; | ||||
//! Element specifying a WindowRendererFactory type. | ||||
static const String WindowRendererFactoryElement; | ||||
//! Attribute specifying the type name of a window renderer. | ||||
static const String WindowRendererAttribute; | ||||
/*! | //! Function that handles the opening GUIScheme XML element. | |||
\brief | void elementGUISchemeStart(const XMLAttributes& attributes); | |||
Method that handles the closing GUIScheme XML element. | //! Function that handles the Imageset XML element. | |||
*/ | void elementImagesetStart(const XMLAttributes& attributes); | |||
void elementGUISchemeEnd(); | //! Function that handles the ImagesetFromImage XML element. | |||
void elementImagesetFromImageStart(const XMLAttributes& attributes); | ||||
//! Function that handles the Font XML element. | ||||
void elementFontStart(const XMLAttributes& attributes); | ||||
//! Function that handles the WindowSet XML element. | ||||
void elementWindowSetStart(const XMLAttributes& attributes); | ||||
//! Function that handles the WindowFactory XML element. | ||||
void elementWindowFactoryStart(const XMLAttributes& attributes); | ||||
//! Function that handles the WindowRendererSet XML element. | ||||
void elementWindowRendererSetStart(const XMLAttributes& attributes); | ||||
//! Function that handles the WindowRendererFactory XML element. | ||||
void elementWindowRendererFactoryStart(const XMLAttributes& attributes) | ||||
; | ||||
//! Function that handles the WindowAlias XML element. | ||||
void elementWindowAliasStart(const XMLAttributes& attributes); | ||||
//! Function that handles the FalagardMapping XML element. | ||||
void elementFalagardMappingStart(const XMLAttributes& attributes); | ||||
//! Function that handles the LookNFeel XML element. | ||||
void elementLookNFeelStart(const XMLAttributes& attributes); | ||||
//! Function that handles the closing GUIScheme XML element. | ||||
void elementGUISchemeEnd(); | ||||
/****************************************************************** | //! Scheme object that we are constructing | |||
******* | Scheme* d_scheme; | |||
Implementation Data | //! inidcates whether client read the created object | |||
******************************************************************* | mutable bool d_objectRead; | |||
******/ | }; | |||
Scheme* d_scheme; //!< Scheme object that we are helping | ||||
to build | ||||
}; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIScheme_xmlHandler_h_ | #endif // end of guard _CEGUIScheme_xmlHandler_h_ | |||
End of changes. 12 change blocks. | ||||
174 lines changed or deleted | 99 lines changed or added | |||
CEGUIScriptModule.h | CEGUIScriptModule.h | |||
---|---|---|---|---|
skipping to change at line 152 | skipping to change at line 152 | |||
/*! | /*! | |||
\brief | \brief | |||
Return identification string for the ScriptModule. If the internal id string has not been | Return identification string for the ScriptModule. If the internal id string has not been | |||
set by the ScriptModule creator, a generic string of "Unknown scrip ting module" will be returned. | set by the ScriptModule creator, a generic string of "Unknown scrip ting module" will be returned. | |||
\return | \return | |||
String object holding a string that identifies the ScriptModule in use. | String object holding a string that identifies the ScriptModule in use. | |||
*/ | */ | |||
const String& getIdentifierString() const; | const String& getIdentifierString() const; | |||
/*! | ||||
\brief | ||||
Return an string which identifies the language of this modul | ||||
e. | ||||
/return | ||||
String object holding a string that identifies the languge o | ||||
f the module | ||||
*/ | ||||
const String& getLanguage() const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Subscribes the named Event to a scripted funtion | Subscribes the named Event to a scripted funtion | |||
\param target | \param target | |||
The target EventSet for the subscription. | The target EventSet for the subscription. | |||
\param name | \param name | |||
String object containing the name of the Event to subscribe to. | String object containing the name of the Event to subscribe to. | |||
skipping to change at line 229 | skipping to change at line 221 | |||
\return | \return | |||
String describing the default resource group identifier.. | String describing the default resource group identifier.. | |||
*/ | */ | |||
static const String& getDefaultResourceGroup() | static const String& getDefaultResourceGroup() | |||
{ return d_defaultResourceGroup; } | { return d_defaultResourceGroup; } | |||
protected: | protected: | |||
//! String that holds some id information about the module. | //! String that holds some id information about the module. | |||
String d_identifierString; | String d_identifierString; | |||
//! String that holds a string containing the languge of the scripti | ||||
ng modue. | ||||
String d_language; | ||||
//! holds the default resource group ID for loading script files. | //! holds the default resource group ID for loading script files. | |||
static String d_defaultResourceGroup; | static String d_defaultResourceGroup; | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Functor class used for binding named script functions to events | Functor class used for binding named script functions to events | |||
*/ | */ | |||
class ScriptFunctor | class ScriptFunctor | |||
{ | { | |||
End of changes. 2 change blocks. | ||||
13 lines changed or deleted | 0 lines changed or added | |||
CEGUIScrollablePane.h | CEGUIScrollablePane.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIScrollablePane.h | filename: CEGUIScrollablePane.h | |||
created: 1/3/2005 | created: 1/3/2005 | |||
author: Paul D Turner | author: Paul D Turner | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrollablePane_h_ | #ifndef _CEGUIScrollablePane_h_ | |||
#define _CEGUIScrollablePane_h_ | #define _CEGUIScrollablePane_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIScrollablePaneProperties.h" | #include "CEGUIScrollablePaneProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | //! Base class for ScrollablePane window renderer objects. | |||
\brief | class CEGUIEXPORT ScrollablePaneWindowRenderer : public WindowRenderer | |||
Base class for ScrollablePane window renderer objects. | { | |||
*/ | public: | |||
class CEGUIEXPORT ScrollablePaneWindowRenderer : public WindowRenderer | //! Constructor | |||
{ | ScrollablePaneWindowRenderer(const String& name); | |||
public: | ||||
/*! | ||||
\brief | ||||
Constructor | ||||
*/ | ||||
ScrollablePaneWindowRenderer(const String& name); | ||||
/*! | ||||
\brief | ||||
Return a Rect that described the pane's viewable area, relative | ||||
to this Window, in pixels. | ||||
\return | ||||
Rect object describing the ScrollablePane's viewable area. | ||||
*/ | ||||
virtual Rect getViewableArea(void) const = 0; | ||||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
Base class for the ScrollablePane widget. | Return a Rect that described the pane's viewable area, relative | |||
to this Window, in pixels. | ||||
The ScrollablePane widget allows child windows to be attached which | \return | |||
cover an area | Rect object describing the ScrollablePane's viewable area. | |||
larger than the ScrollablePane itself and these child windows can b | ||||
e scrolled into | ||||
view using the scrollbars of the scrollable pane. | ||||
*/ | */ | |||
class CEGUIEXPORT ScrollablePane : public Window | virtual Rect getViewableArea(void) const = 0; | |||
{ | }; | |||
public: | ||||
/****************************************************************** | ||||
******* | ||||
Constants | ||||
******************************************************************* | ||||
******/ | ||||
static const String WidgetTypeName; //!< Window fac | ||||
tory name | ||||
static const String EventNamespace; //!< Namespace | ||||
for global events | ||||
static const String EventContentPaneChanged; //!< Event fire | ||||
d when an area on the content pane has been updated. | ||||
static const String EventVertScrollbarModeChanged; //!< Event t | ||||
riggered when the vertical scroll bar 'force' setting changes. | ||||
static const String EventHorzScrollbarModeChanged; //!< Event t | ||||
riggered when the horizontal scroll bar 'force' setting changes. | ||||
static const String EventAutoSizeSettingChanged; //!< Event fire | ||||
d when the auto size setting changes. | ||||
static const String EventContentPaneScrolled; //!< Event fire | ||||
d when the pane gets scrolled. | ||||
/****************************************************************** | /*! | |||
******* | \brief | |||
Child Widget name suffix constants | Base class for the ScrollablePane widget. | |||
******************************************************************* | ||||
******/ | ||||
static const String VertScrollbarNameSuffix; //!< Widget nam | ||||
e suffix for the vertical scrollbar component. | ||||
static const String HorzScrollbarNameSuffix; //!< Widget nam | ||||
e suffix for the horizontal scrollbar component. | ||||
static const String ScrolledContainerNameSuffix; //!< Widget nam | ||||
e suffix for the scrolled container component. | ||||
/****************************************************************** | The ScrollablePane widget allows child windows to be attached which cov | |||
******* | er an | |||
Construction / Destruction | area larger than the ScrollablePane itself and these child windows can | |||
******************************************************************* | be | |||
******/ | scrolled into view using the scrollbars of the scrollable pane. | |||
/*! | */ | |||
\brief | class CEGUIEXPORT ScrollablePane : public Window | |||
Constructor for the ScrollablePane base class. | { | |||
*/ | public: | |||
ScrollablePane(const String& type, const String& name); | //! Window factory name | |||
static const String WidgetTypeName; | ||||
//! Namespace for global events | ||||
static const String EventNamespace; | ||||
//! Event fired when an area on the content pane has been updated. | ||||
static const String EventContentPaneChanged; | ||||
//! Event triggered when the vertical scroll bar 'force' setting change | ||||
s. | ||||
static const String EventVertScrollbarModeChanged; | ||||
//! Event triggered when the horizontal scroll bar 'force' setting chan | ||||
ges. | ||||
static const String EventHorzScrollbarModeChanged; | ||||
//! Event fired when the auto size setting changes. | ||||
static const String EventAutoSizeSettingChanged; | ||||
//! Event fired when the pane gets scrolled. | ||||
static const String EventContentPaneScrolled; | ||||
//! Widget name suffix for the vertical scrollbar component. | ||||
static const String VertScrollbarNameSuffix; | ||||
//! Widget name suffix for the horizontal scrollbar component. | ||||
static const String HorzScrollbarNameSuffix; | ||||
//! Widget name suffix for the scrolled container component. | ||||
static const String ScrolledContainerNameSuffix; | ||||
/*! | //! Constructor for the ScrollablePane base class. | |||
\brief | ScrollablePane(const String& type, const String& name); | |||
Destructor for the ScrollablePane base class. | ||||
*/ | ||||
~ScrollablePane(void); | ||||
/****************************************************************** | //! Destructor for the ScrollablePane base class. | |||
******* | ~ScrollablePane(void); | |||
Public interface | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Returns a pointer to the window holding the pane contents. | ||||
The purpose of this is so that attached windows may be inspecte | /*! | |||
d, | \brief | |||
client code may not modify the returned window in any way. | Returns a pointer to the window holding the pane contents. | |||
\return | The purpose of this is so that attached windows may be inspected, | |||
Pointer to the ScrolledContainer that is acting as the containe | client code may not modify the returned window in any way. | |||
r for the | ||||
scrollable pane content. The returned window is const, client | ||||
code should | ||||
not modify the ScrolledContainer settings directly. | ||||
*/ | ||||
const ScrolledContainer* getContentPane(void) const; | ||||
/*! | \return | |||
\brief | Pointer to the ScrolledContainer that is acting as the container fo | |||
Return whether the vertical scroll bar is always shown. | r the | |||
scrollable pane content. The returned window is const, client code | ||||
should not modify the ScrolledContainer settings directly. | ||||
*/ | ||||
const ScrolledContainer* getContentPane(void) const; | ||||
\return | /*! | |||
- true if the scroll bar will always be shown even if it is not | \brief | |||
required. | Return whether the vertical scroll bar is always shown. | |||
- false if the scroll bar will only be shown when it is require | ||||
d. | ||||
*/ | ||||
bool isVertScrollbarAlwaysShown(void) const; | ||||
/*! | ||||
\brief | ||||
Set whether the vertical scroll bar should always be shown. | ||||
\param setting | \return | |||
- true if the vertical scroll bar should be shown even when it | - true if the scroll bar will be shown even if it is not required. | |||
is not required. | - false if the scroll bar will only be shown when it is required. | |||
- false if the vertical scroll bar should only be shown when it | */ | |||
is required. | bool isVertScrollbarAlwaysShown(void) const; | |||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the vertical scroll bar should always be shown. | |||
void setShowVertScrollbar(bool setting); | ||||
/*! | \param setting | |||
\brief | - true if the vertical scroll bar should be shown even when it is n | |||
Return whether the horizontal scroll bar is always shown. | ot | |||
required. | ||||
- false if the vertical scroll bar should only be shown when it is | ||||
required. | ||||
\return | \return | |||
- true if the scroll bar will always be shown even if it is not | Nothing. | |||
required. | */ | |||
- false if the scroll bar will only be shown when it is require | void setShowVertScrollbar(bool setting); | |||
d. | ||||
*/ | ||||
bool isHorzScrollbarAlwaysShown(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Set whether the horizontal scroll bar should always be shown. | Return whether the horizontal scroll bar is always shown. | |||
\param setting | \return | |||
- true if the horizontal scroll bar should be shown even when i | - true if the scroll bar will be shown even if it is not required. | |||
t is not required. | - false if the scroll bar will only be shown when it is required. | |||
- false if the horizontal scroll bar should only be shown when | */ | |||
it is required. | bool isHorzScrollbarAlwaysShown(void) const; | |||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the horizontal scroll bar should always be shown. | |||
void setShowHorzScrollbar(bool setting); | ||||
/*! | \param setting | |||
\brief | - true if the horizontal scroll bar should be shown even when it is | |||
Return whether the content pane is auto sized. | not | |||
required. | ||||
- false if the horizontal scroll bar should only be shown when it i | ||||
s | ||||
required. | ||||
\return | \return | |||
- true to indicate the content pane will automatically resize i | Nothing. | |||
tself. | */ | |||
- false to indicate the content pane will not automatically res | void setShowHorzScrollbar(bool setting); | |||
ize itself. | ||||
*/ | ||||
bool isContentPaneAutoSized(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Set whether the content pane should be auto-sized. | Return whether the content pane is auto sized. | |||
\param setting | \return | |||
- true to indicate the content pane should automatically resize | - true to indicate the content pane will automatically resize itsel | |||
itself. | f. | |||
- false to indicate the content pane should not automatically r | - false to indicate the content pane will not automatically resize | |||
esize itself. | itself. | |||
*/ | ||||
bool isContentPaneAutoSized(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the content pane should be auto-sized. | |||
void setContentPaneAutoSized(bool setting); | ||||
/*! | \param setting | |||
\brief | - true to indicate the content pane should automatically resize its | |||
Return the current content pane area for the ScrollablePane. | elf. | |||
- false to indicate the content pane should not automatically resiz | ||||
e | ||||
itself. | ||||
\return | \return | |||
Rect object that details the current pixel extents of the conte | Nothing. | |||
nt | */ | |||
pane attached to this ScrollablePane. | void setContentPaneAutoSized(bool setting); | |||
*/ | ||||
const Rect& getContentPaneArea(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the current content pane area for the ScrollablePane. | Return the current content pane area for the ScrollablePane. | |||
\note | \return | |||
If the ScrollablePane is configured to auto-size the content pa | Rect object that details the current pixel extents of the content | |||
ne | pane attached to this ScrollablePane. | |||
this call will have no effect. | */ | |||
const Rect& getContentPaneArea(void) const; | ||||
\param area | /*! | |||
Rect object that details the pixel extents to use for the conte | \brief | |||
nt | Set the current content pane area for the ScrollablePane. | |||
pane attached to this ScrollablePane. | ||||
\return | \note | |||
Nothing. | If the ScrollablePane is configured to auto-size the content pane | |||
*/ | this call will have no effect. | |||
void setContentPaneArea(const Rect& area); | ||||
/*! | \param area | |||
\brief | Rect object that details the pixel extents to use for the content | |||
Returns the horizontal scrollbar step size as a fraction of one | pane attached to this ScrollablePane. | |||
complete view page. | ||||
\return | \return | |||
float value specifying the step size where 1.0f would be the wi | Nothing. | |||
dth of | */ | |||
the viewing area. | void setContentPaneArea(const Rect& area); | |||
*/ | ||||
float getHorizontalStepSize(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Sets the horizontal scrollbar step size as a fraction of one | Returns the horizontal scrollbar step size as a fraction of one | |||
complete view page. | complete view page. | |||
\param step | \return | |||
float value specifying the step size, where 1.0f would be the w | float value specifying the step size where 1.0f would be the width | |||
idth of | of | |||
the viewing area. | the viewing area. | |||
*/ | ||||
float getHorizontalStepSize(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the horizontal scrollbar step size as a fraction of one | |||
void setHorizontalStepSize(float step); | complete view page. | |||
/*! | \param step | |||
\brief | float value specifying the step size, where 1.0f would be the width | |||
Returns the horizontal scrollbar overlap size as a fraction of | of | |||
one | the viewing area. | |||
complete view page. | ||||
\return | \return | |||
float value specifying the overlap size where 1.0f would be the | Nothing. | |||
width of | */ | |||
the viewing area. | void setHorizontalStepSize(float step); | |||
*/ | ||||
float getHorizontalOverlapSize(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Sets the horizontal scrollbar overlap size as a fraction of one | Returns the horizontal scrollbar overlap size as a fraction of one | |||
complete view page. | complete view page. | |||
\param overlap | \return | |||
float value specifying the overlap size, where 1.0f would be th | float value specifying the overlap size where 1.0f would be the wid | |||
e width of | th of | |||
the viewing area. | the viewing area. | |||
*/ | ||||
float getHorizontalOverlapSize(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the horizontal scrollbar overlap size as a fraction of one | |||
void setHorizontalOverlapSize(float overlap); | complete view page. | |||
/*! | \param overlap | |||
\brief | float value specifying the overlap size, where 1.0f would be the wi | |||
Returns the horizontal scroll position as a fraction of the | dth | |||
complete scrollable width. | of the viewing area. | |||
\return | \return | |||
float value specifying the scroll position. | Nothing. | |||
*/ | */ | |||
float getHorizontalScrollPosition(void) const; | void setHorizontalOverlapSize(float overlap); | |||
/*! | /*! | |||
\brief | \brief | |||
Sets the horizontal scroll position as a fraction of the | Returns the horizontal scroll position as a fraction of the | |||
complete scrollable width. | complete scrollable width. | |||
\param position | \return | |||
float value specifying the new scroll position. | float value specifying the scroll position. | |||
*/ | ||||
float getHorizontalScrollPosition(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the horizontal scroll position as a fraction of the | |||
void setHorizontalScrollPosition(float position); | complete scrollable width. | |||
/*! | \param position | |||
\brief | float value specifying the new scroll position. | |||
Returns the vertical scrollbar step size as a fraction of one | ||||
complete view page. | ||||
\return | \return | |||
float value specifying the step size where 1.0f would be the he | Nothing. | |||
ight of | */ | |||
the viewing area. | void setHorizontalScrollPosition(float position); | |||
*/ | ||||
float getVerticalStepSize(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Sets the vertical scrollbar step size as a fraction of one | Returns the vertical scrollbar step size as a fraction of one | |||
complete view page. | complete view page. | |||
\param step | \return | |||
float value specifying the step size, where 1.0f would be the h | float value specifying the step size where 1.0f would be the height | |||
eight of | of | |||
the viewing area. | the viewing area. | |||
*/ | ||||
float getVerticalStepSize(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the vertical scrollbar step size as a fraction of one | |||
void setVerticalStepSize(float step); | complete view page. | |||
/*! | \param step | |||
\brief | float value specifying the step size, where 1.0f would be the heigh | |||
Returns the vertical scrollbar overlap size as a fraction of on | t of | |||
e | the viewing area. | |||
complete view page. | ||||
\return | \return | |||
float value specifying the overlap size where 1.0f would be the | Nothing. | |||
height of | */ | |||
the viewing area. | void setVerticalStepSize(float step); | |||
*/ | ||||
float getVerticalOverlapSize(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Sets the vertical scrollbar overlap size as a fraction of one | Returns the vertical scrollbar overlap size as a fraction of one | |||
complete view page. | complete view page. | |||
\param overlap | \return | |||
float value specifying the overlap size, where 1.0f would be th | float value specifying the overlap size where 1.0f would be the hei | |||
e height of | ght | |||
the viewing area. | of the viewing area. | |||
*/ | ||||
float getVerticalOverlapSize(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the vertical scrollbar overlap size as a fraction of one | |||
void setVerticalOverlapSize(float overlap); | complete view page. | |||
/*! | \param overlap | |||
\brief | float value specifying the overlap size, where 1.0f would be the he | |||
Returns the vertical scroll position as a fraction of the | ight | |||
complete scrollable height. | of the viewing area. | |||
\return | \return | |||
float value specifying the scroll position. | Nothing. | |||
*/ | */ | |||
float getVerticalScrollPosition(void) const; | void setVerticalOverlapSize(float overlap); | |||
/*! | /*! | |||
\brief | \brief | |||
Sets the vertical scroll position as a fraction of the | Returns the vertical scroll position as a fraction of the | |||
complete scrollable height. | complete scrollable height. | |||
\param position | \return | |||
float value specifying the new scroll position. | float value specifying the scroll position. | |||
*/ | ||||
float getVerticalScrollPosition(void) const; | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Sets the vertical scroll position as a fraction of the | |||
void setVerticalScrollPosition(float position); | complete scrollable height. | |||
/*! | \param position | |||
\brief | float value specifying the new scroll position. | |||
Return a Rect that described the pane's viewable area, relative | ||||
to this Window, in pixels. | ||||
\return | \return | |||
Rect object describing the ScrollablePane's viewable area. | Nothing. | |||
*/ | */ | |||
Rect getViewableArea(void) const; | void setVerticalScrollPosition(float position); | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the vertical scrollbar component widget for | Return a Rect that described the pane's viewable area, relative | |||
this | to this Window, in pixels. | |||
ScrollablePane. | ||||
\return | \return | |||
Pointer to a Scrollbar object. | Rect object describing the ScrollablePane's viewable area. | |||
*/ | ||||
Rect getViewableArea(void) const; | ||||
\exception UnknownObjectException | /*! | |||
Thrown if the vertical Scrollbar component does not exist. | \brief | |||
*/ | Return a pointer to the vertical scrollbar component widget for thi | |||
Scrollbar* getVertScrollbar() const; | s | |||
ScrollablePane. | ||||
/*! | \return | |||
\brief | Pointer to a Scrollbar object. | |||
Return a pointer to the horizontal scrollbar component widget f | ||||
or | ||||
this ScrollablePane. | ||||
\return | \exception UnknownObjectException | |||
Pointer to a Scrollbar object. | Thrown if the vertical Scrollbar component does not exist. | |||
*/ | ||||
Scrollbar* getVertScrollbar() const; | ||||
\exception UnknownObjectException | /*! | |||
Thrown if the horizontal Scrollbar component does not exist. | \brief | |||
*/ | Return a pointer to the horizontal scrollbar component widget for | |||
Scrollbar* getHorzScrollbar() const; | this ScrollablePane. | |||
/****************************************************************** | \return | |||
******* | Pointer to a Scrollbar object. | |||
Overridden from Window | ||||
******************************************************************* | ||||
******/ | ||||
void initialiseComponents(void); | ||||
void destroy(void); | ||||
protected: | \exception UnknownObjectException | |||
/****************************************************************** | Thrown if the horizontal Scrollbar component does not exist. | |||
******* | */ | |||
Abstract interface | Scrollbar* getHorzScrollbar() const; | |||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Return a Rect that described the pane's viewable area, relative | ||||
to this Window, in pixels. | ||||
\return | // Overridden from Window | |||
Rect object describing the ScrollablePane's viewable area. | void initialiseComponents(void); | |||
*/ | void destroy(void); | |||
//virtual Rect getViewableArea_impl(void) const = 0; | ||||
/****************************************************************** | protected: | |||
******* | /*! | |||
Implementation Methods | \brief | |||
******************************************************************* | display required integrated scroll bars according to current size o | |||
******/ | f | |||
/*! | the ScrollablePane view area and the size of the attached | |||
\brief | ScrolledContainer. | |||
display required integrated scroll bars according to cur | */ | |||
rent size of | void configureScrollbars(void); | |||
the ScrollablePane view area and the size of the attached Scrol | ||||
ledContainer. | ||||
*/ | ||||
void configureScrollbars(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether the vertical scrollbar is needed. | Return whether the vertical scrollbar is needed. | |||
\return | \return | |||
- true if the scrollbar is either needed or forced via setting. | - true if the scrollbar is either needed or forced via setting. | |||
- false if the scrollbar should not be shown. | - false if the scrollbar should not be shown. | |||
*/ | */ | |||
bool isVertScrollbarNeeded(void) const; | bool isVertScrollbarNeeded(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether the horizontal scrollbar is needed. | Return whether the horizontal scrollbar is needed. | |||
\return | \return | |||
- true if the scrollbar is either needed or forced via setting. | - true if the scrollbar is either needed or forced via setting. | |||
- false if the scrollbar should not be shown. | - false if the scrollbar should not be shown. | |||
*/ | */ | |||
bool isHorzScrollbarNeeded(void) const; | bool isHorzScrollbarNeeded(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Update the content container position according to the current | Update the content container position according to the current | |||
state of the widget (like scrollbar positions, etc). | state of the widget (like scrollbar positions, etc). | |||
*/ | */ | |||
void updateContainerPosition(void); | void updateContainerPosition(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the gi | Return whether this window was inherited from the given class name | |||
ven class name at some point in the inheritance hierarchy. | at | |||
some point in the inheritance hierarchy. | ||||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name | true if this window was inherited from \a class_name. false if not. | |||
. false if not. | */ | |||
*/ | virtual bool testClassName_impl(const String& class_name) const | |||
virtual bool testClassName_impl(const String& class_name) | { | |||
const | if (class_name=="ScrollablePane") | |||
{ | return true; | |||
if (class_name=="ScrollablePane") return true; | ||||
return Window::testClassName_impl(class_name); | ||||
} | ||||
/*! | return Window::testClassName_impl(class_name); | |||
\brief | } | |||
Return a pointer to the ScrolledContainer component widget for | ||||
this | ||||
ScrollablePane. | ||||
\return | /*! | |||
Pointer to a ScrolledContainer object. | \brief | |||
Return a pointer to the ScrolledContainer component widget for this | ||||
ScrollablePane. | ||||
\exception UnknownObjectException | \return | |||
Thrown if the scrolled container component does not exist. | Pointer to a ScrolledContainer object. | |||
*/ | ||||
ScrolledContainer* getScrolledContainer() const; | ||||
// validate window renderer | \exception UnknownObjectException | |||
virtual bool validateWindowRenderer(const String& name) const | Thrown if the scrolled container component does not exist. | |||
{ | */ | |||
return (name == "ScrollablePane"); | ScrolledContainer* getScrolledContainer() const; | |||
} | ||||
/****************************************************************** | // validate window renderer | |||
******* | virtual bool validateWindowRenderer(const String& name) const | |||
Event triggers | { | |||
******************************************************************* | return (name == "ScrollablePane"); | |||
******/ | } | |||
/*! | ||||
\brief | ||||
Event trigger method called when some pane content has changed | ||||
size | ||||
or location. | ||||
\param e | /********************************************************************** | |||
WindowEventArgs object. | *** | |||
Event triggers | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | ||||
\brief | ||||
Event trigger method called when some pane content has changed size | ||||
or location. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onContentPaneChanged(WindowEventArgs& e); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Event trigger method called when the setting that controls whet | */ | |||
her the | virtual void onContentPaneChanged(WindowEventArgs& e); | |||
vertical scrollbar is always shown or not, is changed. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Event trigger method called when the setting that controls whether | ||||
the | ||||
vertical scrollbar is always shown or not, is changed. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onVertScrollbarModeChanged(WindowEventArgs& e); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Event trigger method called when the setting that controls whet | */ | |||
her the | virtual void onVertScrollbarModeChanged(WindowEventArgs& e); | |||
horizontal scrollbar is always shown or not, is changed. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Event trigger method called when the setting that controls whether | ||||
the | ||||
horizontal scrollbar is always shown or not, is changed. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onHorzScrollbarModeChanged(WindowEventArgs& e); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Notification method called whenever the setting that controls w | */ | |||
hether | virtual void onHorzScrollbarModeChanged(WindowEventArgs& e); | |||
the content pane is automatically sized is changed. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Notification method called whenever the setting that controls wheth | ||||
er | ||||
the content pane is automatically sized is changed. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onAutoSizeSettingChanged(WindowEventArgs& e); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Notification method called whenever the content pane is scrolle | */ | |||
d via | virtual void onAutoSizeSettingChanged(WindowEventArgs& e); | |||
changes in the scrollbar positions. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Notification method called whenever the content pane is scrolled vi | ||||
a | ||||
changes in the scrollbar positions. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onContentPaneScrolled(WindowEventArgs& e); | ||||
/****************************************************************** | \return | |||
******* | Nothing. | |||
Event handler methods | */ | |||
******************************************************************* | virtual void onContentPaneScrolled(WindowEventArgs& e); | |||
******/ | ||||
/*! | ||||
\brief | ||||
Handler method which gets subscribed to the scrollbar position | ||||
change | ||||
events. | ||||
*/ | ||||
bool handleScrollChange(const EventArgs& e); | ||||
/*! | /********************************************************************** | |||
\brief | *** | |||
Handler method which gets subscribed to the ScrolledContainer c | Event handler methods | |||
ontent | *********************************************************************** | |||
change events. | **/ | |||
*/ | /*! | |||
bool handleContentAreaChange(const EventArgs& e); | \brief | |||
Handler method which gets subscribed to the scrollbar position chan | ||||
ge | ||||
events. | ||||
*/ | ||||
bool handleScrollChange(const EventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Handler method which gets subscribed to the ScrolledContainer a | Handler method which gets subscribed to the ScrolledContainer conte | |||
uto-size | nt | |||
setting changes. | change events. | |||
*/ | */ | |||
bool handleAutoSizePaneChanged(const EventArgs& e); | bool handleContentAreaChange(const EventArgs& e); | |||
/****************************************************************** | /*! | |||
******* | \brief | |||
Overridden from Window | Handler method which gets subscribed to the ScrolledContainer auto- | |||
******************************************************************* | size | |||
******/ | setting changes. | |||
void addChild_impl(Window* wnd); | */ | |||
void removeChild_impl(Window* wnd); | bool handleAutoSizePaneChanged(const EventArgs& e); | |||
void onSized(WindowEventArgs& e); | ||||
void onMouseWheel(MouseEventArgs& e); | ||||
/****************************************************************** | // Overridden from Window | |||
******* | void addChild_impl(Window* wnd); | |||
Data fields | void removeChild_impl(Window* wnd); | |||
******************************************************************* | void onSized(WindowEventArgs& e); | |||
******/ | void onMouseWheel(MouseEventArgs& e); | |||
bool d_forceVertScroll; //!< true if vertical scroll | ||||
bar should always be displayed | ||||
bool d_forceHorzScroll; //!< true if horizontal scro | ||||
llbar should always be displayed | ||||
Rect d_contentRect; //!< holds content area so we can t | ||||
rack changes. | ||||
float d_vertStep; //!< vertical scroll step fraction. | ||||
float d_vertOverlap; //!< vertical scroll overlap fracti | ||||
on. | ||||
float d_horzStep; //!< horizontal scroll step fractio | ||||
n. | ||||
float d_horzOverlap; //!< horizontal scroll overlap frac | ||||
tion. | ||||
Event::Connection d_contentChangedConn; //!< Event connection to c | ||||
ontent pane | ||||
Event::Connection d_autoSizeChangedConn; //!< Event connection to c | ||||
ontent pane | ||||
private: | //! true if vertical scrollbar should always be displayed | |||
/*************************************************************** | bool d_forceVertScroll; | |||
********** | //! true if horizontal scrollbar should always be displayed | |||
Static Properties for this class | bool d_forceHorzScroll; | |||
**************************************************************** | //! holds content area so we can track changes. | |||
*********/ | Rect d_contentRect; | |||
static ScrollablePaneProperties::ForceHorzScrollbar d_horzScrol | //! vertical scroll step fraction. | |||
lbarProperty; | float d_vertStep; | |||
static ScrollablePaneProperties::ForceVertScrollbar d_vertScrol | //! vertical scroll overlap fraction. | |||
lbarProperty; | float d_vertOverlap; | |||
static ScrollablePaneProperties::ContentPaneAutoSized d_au | //! horizontal scroll step fraction. | |||
toSizedProperty; | float d_horzStep; | |||
static ScrollablePaneProperties::ContentArea d_conten | //! horizontal scroll overlap fraction. | |||
tAreaProperty; | float d_horzOverlap; | |||
static ScrollablePaneProperties::HorzStepSize d_horzStepP | //! Event connection to content pane | |||
roperty; | Event::Connection d_contentChangedConn; | |||
static ScrollablePaneProperties::HorzOverlapSize d_horzOverl | //! Event connection to content pane | |||
apProperty; | Event::Connection d_autoSizeChangedConn; | |||
static ScrollablePaneProperties::HorzScrollPosition d_horzScrol | ||||
lPositionProperty; | ||||
static ScrollablePaneProperties::VertStepSize d_vertStepP | ||||
roperty; | ||||
static ScrollablePaneProperties::VertOverlapSize d_vertOverl | ||||
apProperty; | ||||
static ScrollablePaneProperties::VertScrollPosition d_vertScrol | ||||
lPositionProperty; | ||||
/*************************************************************** | private: | |||
********** | static ScrollablePaneProperties::ForceHorzScrollbar d_horzScrollbar | |||
Private methods | Property; | |||
**************************************************************** | static ScrollablePaneProperties::ForceVertScrollbar d_vertScrollbar | |||
*********/ | Property; | |||
void addScrollablePaneProperties(void); | static ScrollablePaneProperties::ContentPaneAutoSized d_autoSizedProp | |||
}; | erty; | |||
static ScrollablePaneProperties::ContentArea d_contentAreaPr | ||||
operty; | ||||
static ScrollablePaneProperties::HorzStepSize d_horzStepPrope | ||||
rty; | ||||
static ScrollablePaneProperties::HorzOverlapSize d_horzOverlapPr | ||||
operty; | ||||
static ScrollablePaneProperties::HorzScrollPosition d_horzScrollPos | ||||
itionProperty; | ||||
static ScrollablePaneProperties::VertStepSize d_vertStepPrope | ||||
rty; | ||||
static ScrollablePaneProperties::VertOverlapSize d_vertOverlapPr | ||||
operty; | ||||
static ScrollablePaneProperties::VertScrollPosition d_vertScrollPos | ||||
itionProperty; | ||||
void addScrollablePaneProperties(void); | ||||
}; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIScrollablePane_h_ | #endif // end of guard _CEGUIScrollablePane_h_ | |||
End of changes. 112 change blocks. | ||||
590 lines changed or deleted | 509 lines changed or added | |||
CEGUIScrollablePaneProperties.h | CEGUIScrollablePaneProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrollablePaneProperties_h_ | #ifndef _CEGUIScrollablePaneProperties_h_ | |||
#define _CEGUIScrollablePaneProperties_h_ | #define _CEGUIScrollablePaneProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ScrollablePaneProperties namespace section | // Start of ScrollablePaneProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the ScrollablePane class | Namespace containing all classes that make up the properties interfa ce for the ScrollablePane class | |||
*/ | */ | |||
namespace ScrollablePaneProperties | namespace ScrollablePaneProperties | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIScrollbar.h | CEGUIScrollbar.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrollbar_h_ | #ifndef _CEGUIScrollbar_h_ | |||
#define _CEGUIScrollbar_h_ | #define _CEGUIScrollbar_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUIScrollbarProperties.h" | #include "CEGUIScrollbarProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUIScrollbarProperties.h | CEGUIScrollbarProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrollbarProperties_h_ | #ifndef _CEGUIScrollbarProperties_h_ | |||
#define _CEGUIScrollbarProperties_h_ | #define _CEGUIScrollbarProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ScrollbarProperties namespace section | // Start of ScrollbarProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Scrollbar class | Namespace containing all classes that make up the properties interfa ce for the Scrollbar class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIScrolledContainer.h | CEGUIScrolledContainer.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIScrolledContainer.h | filename: CEGUIScrolledContainer.h | |||
created: 1/3/2005 | created: 1/3/2005 | |||
author: Paul D Turner | author: Paul D Turner | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrolledContainer_h_ | #ifndef _CEGUIScrolledContainer_h_ | |||
#define _CEGUIScrolledContainer_h_ | #define _CEGUIScrolledContainer_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIWindowFactory.h" | #include "../CEGUIWindowFactory.h" | |||
#include "elements/CEGUIScrolledContainerProperties.h" | #include "CEGUIScrolledContainerProperties.h" | |||
#include <map> | #include <map> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Helper container window class which is used in the implementation o | Helper container window class which is used in the implementation of th | |||
f the | e | |||
ScrollablePane widget class. | ScrollablePane widget class. | |||
*/ | */ | |||
class CEGUIEXPORT ScrolledContainer : public Window | class CEGUIEXPORT ScrolledContainer : public Window | |||
{ | { | |||
public: | public: | |||
/****************************************************************** | //! Type name for ScrolledContainer. | |||
******* | static const String WidgetTypeName; | |||
Constants | //! Namespace for global events | |||
******************************************************************* | static const String EventNamespace; | |||
******/ | //! Event fired whenever some child changes. | |||
static const String WidgetTypeName; //!< Type name for Scrolled | static const String EventContentChanged; | |||
Container. | //! Event fired when the autosize setting changes. | |||
static const String EventNamespace; //!< Namespace for global e | static const String EventAutoSizeSettingChanged; | |||
vents | ||||
static const String EventContentChanged; //!< Event fired whenev | ||||
er some child changes. | ||||
static const String EventAutoSizeSettingChanged; //!< Event fire | ||||
d when the autosize setting changes. | ||||
/****************************************************************** | ||||
******* | ||||
Object construction and destruction | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Constructor for ScrolledContainer objects. | ||||
*/ | ||||
ScrolledContainer(const String& type, const String& name); | ||||
/*! | //! Constructor for ScrolledContainer objects. | |||
\brief | ScrolledContainer(const String& type, const String& name); | |||
Destructor for ScrolledContainer objects. | ||||
*/ | ||||
~ScrolledContainer(void); | ||||
/****************************************************************** | //! Destructor for ScrolledContainer objects. | |||
******* | ~ScrolledContainer(void); | |||
Public interface methods | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Return whether the content pane is auto sized. | ||||
\return | /*! | |||
- true to indicate the content pane will automatically resize i | \brief | |||
tself. | Return whether the content pane is auto sized. | |||
- false to indicate the content pane will not automatically res | ||||
ize itself. | ||||
*/ | ||||
bool isContentPaneAutoSized(void) const; | ||||
/*! | \return | |||
\brief | - true to indicate the content pane will automatically resize itsel | |||
Set whether the content pane should be auto-sized. | f. | |||
- false to indicate the content pane will not automatically resize | ||||
itself. | ||||
*/ | ||||
bool isContentPaneAutoSized(void) const; | ||||
\param setting | /*! | |||
- true to indicate the content pane should automatically resize | \brief | |||
itself. | Set whether the content pane should be auto-sized. | |||
- false to indicate the content pane should not automatically r | ||||
esize itself. | ||||
\return | \param setting | |||
Nothing. | - true to indicate the content pane should automatically resize its | |||
*/ | elf. | |||
void setContentPaneAutoSized(bool setting); | - false to indicate the content pane should not automatically resiz | |||
e | ||||
itself. | ||||
/*! | \return | |||
\brief | Nothing. | |||
Return the current content pane area for the ScrolledContainer. | */ | |||
void setContentPaneAutoSized(bool setting); | ||||
\return | /*! | |||
Rect object that details the current pixel extents of the conte | \brief | |||
nt | Return the current content pane area for the ScrolledContainer. | |||
pane represented by this ScrolledContainer. | ||||
*/ | ||||
const Rect& getContentArea(void) const; | ||||
/*! | \return | |||
\brief | Rect object that details the current pixel extents of the content | |||
Set the current content pane area for the ScrolledContainer. | pane represented by this ScrolledContainer. | |||
*/ | ||||
const Rect& getContentArea(void) const; | ||||
\note | /*! | |||
If the ScrolledContainer is configured to auto-size the content | \brief | |||
pane | Set the current content pane area for the ScrolledContainer. | |||
this call will have no effect. | ||||
\param area | \note | |||
Rect object that details the pixel extents to use for the conte | If the ScrolledContainer is configured to auto-size the content pan | |||
nt | e | |||
pane represented by this ScrolledContainer. | this call will have no effect. | |||
\return | \param area | |||
Nothing. | Rect object that details the pixel extents to use for the content | |||
*/ | pane represented by this ScrolledContainer. | |||
void setContentArea(const Rect& area); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Return the current extents of the attached content. | */ | |||
void setContentArea(const Rect& area); | ||||
\return | /*! | |||
Rect object that describes the pixel extents of the attached | \brief | |||
child windows. This is effectively the smallest bounding box | Return the current extents of the attached content. | |||
that could contain all the attached windows. | ||||
*/ | ||||
Rect getChildExtentsArea(void) const; | ||||
// Overridden from Window. | \return | |||
Rect getUnclippedInnerRect_impl(void) const; | Rect object that describes the pixel extents of the attached | |||
child windows. This is effectively the smallest bounding box | ||||
that could contain all the attached windows. | ||||
*/ | ||||
Rect getChildExtentsArea(void) const; | ||||
protected: | // Overridden from Window. | |||
/****************************************************************** | Rect getUnclippedInnerRect_impl(void) const; | |||
******* | ||||
Implementation methods | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Return whether this window was inherited from the gi | ||||
ven class name at some point in the inheritance hierarchy. | ||||
\param class_name | protected: | |||
The class name that is to be checked. | /*! | |||
\brief | ||||
Return whether this window was inherited from the given class name | ||||
at | ||||
some point in the inheritance hierarchy. | ||||
\return | \param class_name | |||
true if this window was inherited from \a class_name | The class name that is to be checked. | |||
. false if not. | ||||
*/ | ||||
virtual bool testClassName_impl(const String& class_name) | ||||
const | ||||
{ | ||||
if (class_name=="ScrolledContainer") return true; | ||||
return Window::testClassName_impl(class_name); | ||||
} | ||||
/****************************************************************** | \return | |||
******* | true if this window was inherited from \a class_name. false if not. | |||
Implementation of abstract methods from Window | */ | |||
******************************************************************* | virtual bool testClassName_impl(const String& class_name) const | |||
******/ | { | |||
void drawSelf(float z) {}; | if (class_name=="ScrolledContainer") | |||
return true; | ||||
/****************************************************************** | return Window::testClassName_impl(class_name); | |||
******* | } | |||
Event trigger methods. | ||||
******************************************************************* | ||||
******/ | ||||
/*! | ||||
\brief | ||||
Notification method called whenever the content size may have c | ||||
hanged. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Notification method called whenever the content size may have chang | ||||
ed. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onContentChanged(WindowEventArgs& e); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Notification method called whenever the setting that controls w | */ | |||
hether | virtual void onContentChanged(WindowEventArgs& e); | |||
the content pane is automatically sized is changed. | ||||
\param e | /*! | |||
WindowEventArgs object. | \brief | |||
Notification method called whenever the setting that controls wheth | ||||
er | ||||
the content pane is automatically sized is changed. | ||||
\return | \param e | |||
Nothing. | WindowEventArgs object. | |||
*/ | ||||
virtual void onAutoSizeSettingChanged(WindowEventArgs& e); | ||||
/****************************************************************** | \return | |||
******* | Nothing. | |||
Event callbacks | */ | |||
******************************************************************* | virtual void onAutoSizeSettingChanged(WindowEventArgs& e); | |||
******/ | ||||
/*! | ||||
\brief | ||||
Method which receives notifications about child windows being m | ||||
oved. | ||||
*/ | ||||
bool handleChildSized(const EventArgs& e); | ||||
/*! | //! handles notifications about child windows being moved. | |||
\brief | bool handleChildSized(const EventArgs& e); | |||
Method which receives notifications about child windows being s | //! handles notifications about child windows being sized. | |||
ized. | bool handleChildMoved(const EventArgs& e); | |||
*/ | ||||
bool handleChildMoved(const EventArgs& e); | ||||
/****************************************************************** | // overridden from Window. | |||
******* | void drawSelf(const RenderingContext&) {}; | |||
Overridden from Window. | void onChildAdded(WindowEventArgs& e); | |||
******************************************************************* | void onChildRemoved(WindowEventArgs& e); | |||
******/ | void onParentSized(WindowEventArgs& e); | |||
void onChildAdded(WindowEventArgs& e); | ||||
void onChildRemoved(WindowEventArgs& e); | ||||
void onParentSized(WindowEventArgs& e); | ||||
/****************************************************************** | //! type definition for collection used to track event connections. | |||
******* | typedef std::multimap<Window*, Event::Connection> ConnectionTracker; | |||
Data fields | //! Tracks event connections we make. | |||
******************************************************************* | ConnectionTracker d_eventConnections; | |||
******/ | //! Holds extents of the content pane. | |||
typedef std::multimap<Window*, Event::Connection> ConnectionTracke | Rect d_contentArea; | |||
r; | //! true if the pane auto-sizes itself. | |||
ConnectionTracker d_eventConnections; //!< Tracks event connectio | bool d_autosizePane; | |||
ns we make. | ||||
Rect d_contentArea; //!< Holds extents of the content pane. | ||||
bool d_autosizePane; //!< true if the pane auto-sizes itself. | ||||
private: | private: | |||
/*************************************************************** | static ScrolledContainerProperties::ContentPaneAutoSized d_autoSizedPro | |||
********** | perty; | |||
Static Properties for this class | static ScrolledContainerProperties::ContentArea d_contentAreaP | |||
**************************************************************** | roperty; | |||
*********/ | static ScrolledContainerProperties::ChildExtentsArea d_childExtents | |||
static ScrolledContainerProperties::ContentPaneAutoSized d_au | AreaProperty; | |||
toSizedProperty; | ||||
static ScrolledContainerProperties::ContentArea d_co | ||||
ntentAreaProperty; | ||||
static ScrolledContainerProperties::ChildExtentsArea d_ch | ||||
ildExtentsAreaProperty; | ||||
/*************************************************************** | void addScrolledContainerProperties(void); | |||
********** | }; | |||
Private methods | ||||
**************************************************************** | ||||
*********/ | ||||
void addScrolledContainerProperties(void); | ||||
}; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIScrolledContainer_h_ | #endif // end of guard _CEGUIScrolledContainer_h_ | |||
End of changes. 37 change blocks. | ||||
219 lines changed or deleted | 151 lines changed or added | |||
CEGUIScrolledContainerProperties.h | CEGUIScrolledContainerProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIScrolledContainerProperties_h_ | #ifndef _CEGUIScrolledContainerProperties_h_ | |||
#define _CEGUIScrolledContainerProperties_h_ | #define _CEGUIScrolledContainerProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ScrolledContainerProperties namespace section | // Start of ScrolledContainerProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the ScrolledContainer class | Namespace containing all classes that make up the properties interfa ce for the ScrolledContainer class | |||
*/ | */ | |||
namespace ScrolledContainerProperties | namespace ScrolledContainerProperties | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIScrolledItemListBase.h | CEGUIScrolledItemListBase.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public | You should have received a copy of the GNU Lesser General Public | |||
License along with this library; if not, write to the Free Software | License along with this library; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA | |||
*************************************************************************/ | *************************************************************************/ | |||
#ifndef _CEGUIScrolledItemListBase_h_ | #ifndef _CEGUIScrolledItemListBase_h_ | |||
#define _CEGUIScrolledItemListBase_h_ | #define _CEGUIScrolledItemListBase_h_ | |||
#include "elements/CEGUIItemListBase.h" | #include "CEGUIItemListBase.h" | |||
#include "elements/CEGUIScrollbar.h" | #include "CEGUIScrollbar.h" | |||
#include "elements/CEGUIScrolledItemListBaseProperties.h" | #include "CEGUIScrolledItemListBaseProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// begin CEGUI namespace | // begin CEGUI namespace | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
skipping to change at line 100 | skipping to change at line 100 | |||
Sets whether the vertical scrollbar should be forced visible. Despi te content size. | Sets whether the vertical scrollbar should be forced visible. Despi te content size. | |||
*/ | */ | |||
void setShowVertScrollbar(bool mode); | void setShowVertScrollbar(bool mode); | |||
/*! | /*! | |||
\brief | \brief | |||
Sets whether the horizontal scrollbar should be forced visible. Des pite content size. | Sets whether the horizontal scrollbar should be forced visible. Des pite content size. | |||
*/ | */ | |||
void setShowHorzScrollbar(bool mode); | void setShowHorzScrollbar(bool mode); | |||
/*! | ||||
\brief | ||||
Scroll the vertical list position if needed to ensure that the Item | ||||
Entry | ||||
\a item is, if possible, fully visible witin the ScrolledItemListB | ||||
ase | ||||
viewable area. | ||||
\param item | ||||
const reference to an ItemEntry attached to this ScrolledItemListBa | ||||
se | ||||
that should be made visible in the view area. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void ensureItemIsVisibleVert(const ItemEntry& item); | ||||
/*! | ||||
\brief | ||||
Scroll the horizontal list position if needed to ensure that the | ||||
ItemEntry \a item is, if possible, fully visible witin the | ||||
ScrolledItemListBase viewable area. | ||||
\param item | ||||
const reference to an ItemEntry attached to this ScrolledItemListBa | ||||
se | ||||
that should be made visible in the view area. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
void ensureItemIsVisibleHorz(const ItemEntry& item); | ||||
/********************************************************************** ** | /********************************************************************** ** | |||
Object Construction and Destruction | Object Construction and Destruction | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Constructor for the ScrolledItemListBase base class constructor | Constructor for the ScrolledItemListBase base class constructor | |||
*/ | */ | |||
ScrolledItemListBase(const String& type, const String& name); | ScrolledItemListBase(const String& type, const String& name); | |||
/*! | /*! | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 37 lines changed or added | |||
CEGUIScrolledItemListBaseProperties.h | CEGUIScrolledItemListBaseProperties.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public | You should have received a copy of the GNU Lesser General Public | |||
License along with this library; if not, write to the Free Software | License along with this library; if not, write to the Free Software | |||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U SA | |||
*************************************************************************/ | *************************************************************************/ | |||
#ifndef _CEGUIScrolledItemListBaseProperties_h_ | #ifndef _CEGUIScrolledItemListBaseProperties_h_ | |||
#define _CEGUIScrolledItemListBaseProperties_h_ | #define _CEGUIScrolledItemListBaseProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ItemListboxProperties namespace section | // Start of ItemListboxProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interface for the ScrolledItemListBase class | Namespace containing all classes that make up the properties interface for the ScrolledItemListBase class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUISingleton.h | CEGUISingleton.h | |||
---|---|---|---|---|
skipping to change at line 81 | skipping to change at line 81 | |||
{ | { | |||
assert( !ms_Singleton ); | assert( !ms_Singleton ); | |||
ms_Singleton = static_cast<T*>(this); | ms_Singleton = static_cast<T*>(this); | |||
} | } | |||
~Singleton( void ) | ~Singleton( void ) | |||
{ assert( ms_Singleton ); ms_Singleton = 0; } | { assert( ms_Singleton ); ms_Singleton = 0; } | |||
static T& getSingleton( void ) | static T& getSingleton( void ) | |||
{ assert( ms_Singleton ); return ( *ms_Singleton ); } | { assert( ms_Singleton ); return ( *ms_Singleton ); } | |||
static T* getSingletonPtr( void ) | static T* getSingletonPtr( void ) | |||
{ return ( ms_Singleton ); } | { return ( ms_Singleton ); } | |||
private: | ||||
Singleton& operator=(const Singleton&) { return this; } | ||||
Singleton(const Singleton&) {} | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUISingleton_h_ | #endif // end of guard _CEGUISingleton_h_ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
CEGUISlider.h | CEGUISlider.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUISlider_h_ | #ifndef _CEGUISlider_h_ | |||
#define _CEGUISlider_h_ | #define _CEGUISlider_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUISliderProperties.h" | #include "CEGUISliderProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUISliderProperties.h | CEGUISliderProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUISliderProperties_h_ | #ifndef _CEGUISliderProperties_h_ | |||
#define _CEGUISliderProperties_h_ | #define _CEGUISliderProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of SliderProperties namespace section | // Start of SliderProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Slider class | Namespace containing all classes that make up the properties interfa ce for the Slider class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUISpinner.h | CEGUISpinner.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUISpinner_h_ | #ifndef _CEGUISpinner_h_ | |||
#define _CEGUISpinner_h_ | #define _CEGUISpinner_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUISpinnerProperties.h" | #include "CEGUISpinnerProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Base class for the Spinner widget. | Base class for the Spinner widget. | |||
The spinner widget has a text area where numbers may be entered | The spinner widget has a text area where numbers may be entered | |||
and two buttons which may be used to increase or decrease the | and two buttons which may be used to increase or decrease the | |||
value in the text area by a user specified amount. | value in the text area by a user specified amount. | |||
\note | ||||
While the Spinner widget has support for floating point values, the | ||||
results of using this support in its current state may not be | ||||
satisfactory. The general advice, for the moment, is to avoid | ||||
very large or very small values in floating point mode, and to | ||||
perform as little manipulation of the values as possible. The | ||||
various issues you may see range from scientific notation appearing | ||||
in the box, to complete breakdown of 'expected' values upon | ||||
manipulation. This is something that we intend to address for a | ||||
future release. | ||||
*/ | */ | |||
class CEGUIEXPORT Spinner : public Window | class CEGUIEXPORT Spinner : public Window | |||
{ | { | |||
public: | public: | |||
/*! | /*! | |||
\brief | \brief | |||
Enumerated type specifying possible input and/or display modes for the spinner. | Enumerated type specifying possible input and/or display modes for the spinner. | |||
*/ | */ | |||
enum TextInputMode | enum TextInputMode | |||
{ | { | |||
skipping to change at line 130 | skipping to change at line 119 | |||
void initialiseComponents(void); | void initialiseComponents(void); | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Accessors | Accessors | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current spinner value. | Return the current spinner value. | |||
\return | \return | |||
current float value of the Spinner. | current value of the Spinner. | |||
*/ | */ | |||
float getCurrentValue(void) const; | double getCurrentValue(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current step value. | Return the current step value. | |||
\return | \return | |||
float step value. This is the value added to the spinner vaue when the | Step value. This is the value added to the spinner vaue when t he | |||
up / down buttons are clicked. | up / down buttons are clicked. | |||
*/ | */ | |||
float getStepSize(void) const; | double getStepSize(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current maximum limit value for the Spinner. | Return the current maximum limit value for the Spinner. | |||
\return | \return | |||
Maximum value that is allowed for the spinner. | Maximum value that is allowed for the spinner. | |||
*/ | */ | |||
float getMaximumValue(void) const; | double getMaximumValue(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current minimum limit value for the Spinner. | Return the current minimum limit value for the Spinner. | |||
\return | \return | |||
Minimum value that is allowed for the spinner. | Minimum value that is allowed for the spinner. | |||
*/ | */ | |||
float getMinimumValue(void) const; | double getMinimumValue(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current text input / display mode setting. | Return the current text input / display mode setting. | |||
\return | \return | |||
One of the TextInputMode enumerated values indicating the curre nt | One of the TextInputMode enumerated values indicating the curre nt | |||
text input and display mode. | text input and display mode. | |||
*/ | */ | |||
TextInputMode getTextInputMode(void) const; | TextInputMode getTextInputMode(void) const; | |||
skipping to change at line 185 | skipping to change at line 174 | |||
/*! | /*! | |||
\brief | \brief | |||
Set the current spinner value. | Set the current spinner value. | |||
\param value | \param value | |||
value to be assigned to the Spinner. | value to be assigned to the Spinner. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setCurrentValue(float value); | void setCurrentValue(double value); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the current step value. | Set the current step value. | |||
\param step | \param step | |||
The value added to be the spinner value when the | The value added to be the spinner value when the | |||
up / down buttons are clicked. | up / down buttons are clicked. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setStepSize(float step); | void setStepSize(double step); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the spinner maximum value. | Set the spinner maximum value. | |||
\param maxValue | \param maxValue | |||
The maximum value to be allowed by the spinner. | The maximum value to be allowed by the spinner. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setMaximumValue(float maxValue); | void setMaximumValue(double maxValue); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the spinner minimum value. | Set the spinner minimum value. | |||
\param minVaue | \param minVaue | |||
The minimum value to be allowed by the spinner. | The minimum value to be allowed by the spinner. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setMinimumValue(float minVaue); | void setMinimumValue(double minVaue); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the spinner input / display mode. | Set the spinner input / display mode. | |||
\param mode | \param mode | |||
One of the TextInputMode enumerated values indicating the text | One of the TextInputMode enumerated values indicating the text | |||
input / display mode to be used by the spinner. | input / display mode to be used by the spinner. | |||
\return | \return | |||
skipping to change at line 254 | skipping to change at line 243 | |||
static const String OctalValidator; //!< Validator regex used for octal mode. | static const String OctalValidator; //!< Validator regex used for octal mode. | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Protected Implementation Methods | Protected Implementation Methods | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
/*! | /*! | |||
\brief | \brief | |||
Returns the numerical representation of the current editbox tex t. | Returns the numerical representation of the current editbox tex t. | |||
\return | \return | |||
float value that is the numerical equivalent of the editbox tex t. | double value that is the numerical equivalent of the editbox te xt. | |||
\exception InvalidRequestException thrown if the text can not be c onverted. | \exception InvalidRequestException thrown if the text can not be c onverted. | |||
*/ | */ | |||
virtual float getValueFromText(void) const; | virtual double getValueFromText(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Returns the textual representation of the current spinner value . | Returns the textual representation of the current spinner value . | |||
\return | \return | |||
String object that is equivalent to the the numerical value of the spinner. | String object that is equivalent to the the numerical value of the spinner. | |||
*/ | */ | |||
virtual String getTextFromValue(void) const; | virtual String getTextFromValue(void) const; | |||
skipping to change at line 403 | skipping to change at line 392 | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Internal event listener methods | Internal event listener methods | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
bool handleIncreaseButton(const EventArgs& e); | bool handleIncreaseButton(const EventArgs& e); | |||
bool handleDecreaseButton(const EventArgs& e); | bool handleDecreaseButton(const EventArgs& e); | |||
bool handleEditTextChange(const EventArgs& e); | bool handleEditTextChange(const EventArgs& e); | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Data Fields | Data Fields | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
float d_stepSize; //!< Step size value used y the increase & | double d_stepSize; //!< Step size value used y the increase & | |||
decrease buttons. | decrease buttons. | |||
float d_currentValue; //!< Numerical copy of the text in d_editbo | double d_currentValue; //!< Numerical copy of the text in d_editb | |||
x. | ox. | |||
float d_maxValue; //!< Maximum value for spinner. | double d_maxValue; //!< Maximum value for spinner. | |||
float d_minValue; //!< Minimum value for spinner. | double d_minValue; //!< Minimum value for spinner. | |||
TextInputMode d_inputMode; //!< Current text display/input mod e. | TextInputMode d_inputMode; //!< Current text display/input mod e. | |||
private: | private: | |||
/****************************************************************** ******* | /****************************************************************** ******* | |||
Static properties for the Spinner widget | Static properties for the Spinner widget | |||
******************************************************************* ******/ | ******************************************************************* ******/ | |||
static SpinnerProperties::CurrentValue d_currentValueProperty; | static SpinnerProperties::CurrentValue d_currentValueProperty; | |||
static SpinnerProperties::StepSize d_stepSizeProperty; | static SpinnerProperties::StepSize d_stepSizeProperty; | |||
static SpinnerProperties::MaximumValue d_maxValueProperty; | static SpinnerProperties::MaximumValue d_maxValueProperty; | |||
static SpinnerProperties::MinimumValue d_minValueProperty; | static SpinnerProperties::MinimumValue d_minValueProperty; | |||
End of changes. 15 change blocks. | ||||
32 lines changed or deleted | 21 lines changed or added | |||
CEGUISpinnerProperties.h | CEGUISpinnerProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUISpinnerProperties_h_ | #ifndef _CEGUISpinnerProperties_h_ | |||
#define _CEGUISpinnerProperties_h_ | #define _CEGUISpinnerProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of SpinnerProperties namespace section | // Start of SpinnerProperties namespace section | |||
namespace SpinnerProperties | namespace SpinnerProperties | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the current value of the spinner. | Property to access the current value of the spinner. | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUISystem.h | CEGUISystem.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUISystem.h | filename: CEGUISystem.h | |||
created: 20/2/2004 | created: 20/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Defines interface for main GUI system class | purpose: Defines interface for main GUI system class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 81 | skipping to change at line 81 | |||
static const Size DefaultMultiClickAreaSize; //!< Default allowable mouse movement for multi-click event generation. | static const Size DefaultMultiClickAreaSize; //!< Default allowable mouse movement for multi-click event generation. | |||
// event names | // event names | |||
static const String EventGUISheetChanged; //!< Name of event fired whenever the GUI sheet is changed. | static const String EventGUISheetChanged; //!< Name of event fired whenever the GUI sheet is changed. | |||
static const String EventSingleClickTimeoutChanged; //!< Name of event fired when the single-click timeout is changed. | static const String EventSingleClickTimeoutChanged; //!< Name of event fired when the single-click timeout is changed. | |||
static const String EventMultiClickTimeoutChanged; //!< Name of event fired when the multi-click timeout is changed. | static const String EventMultiClickTimeoutChanged; //!< Name of event fired when the multi-click timeout is changed. | |||
static const String EventMultiClickAreaSizeChanged; //!< Name of event fired when the size of the multi-click tolerance area is changed. | static const String EventMultiClickAreaSizeChanged; //!< Name of event fired when the size of the multi-click tolerance area is changed. | |||
static const String EventDefaultFontChanged; //!< Name of event fired when the default font changes. | static const String EventDefaultFontChanged; //!< Name of event fired when the default font changes. | |||
static const String EventDefaultMouseCursorChanged; //!< Name of event fired when the default mouse cursor changes. | static const String EventDefaultMouseCursorChanged; //!< Name of event fired when the default mouse cursor changes. | |||
static const String EventMouseMoveScalingChanged; //!< Name of event fired when the mouse move scaling factor changes. | static const String EventMouseMoveScalingChanged; //!< Name of event fired when the mouse move scaling factor changes. | |||
//! Name of event fired for display size changes (as notified by client | ||||
). | ||||
static const String EventDisplaySizeChanged; | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Construct a new System object | Create the System object and return a reference to it. | |||
\param renderer | \param renderer | |||
Pointer to the valid Renderer object that will be used to render GU I | Reference to a valid Renderer object that will be used to render GU I | |||
imagery. | imagery. | |||
\param resourceProvider | \param resourceProvider | |||
Pointer to a ResourceProvider object, or NULL to use whichever defa ult | Pointer to a ResourceProvider object, or NULL to use whichever defa ult | |||
the Renderer provides. | the Renderer provides. | |||
\param xmlParser | \param xmlParser | |||
Pointer to a valid XMLParser object to be used when parsing XML fil es, | Pointer to a valid XMLParser object to be used when parsing XML fil es, | |||
or NULL to use a default parser. | or NULL to use a default parser. | |||
\param imageCodec | ||||
Pointer to a valid ImageCodec object to be used when loading image | ||||
files, or NULL to use a default image codec. | ||||
\param scriptModule | \param scriptModule | |||
Pointer to a ScriptModule object. may be NULL for none. | Pointer to a ScriptModule object. may be NULL for none. | |||
\param configFile | \param configFile | |||
String object containing the name of a configuration file to use. | String object containing the name of a configuration file to use. | |||
\param logFile | \param logFile | |||
String object containing the name to use for the log file. | String object containing the name to use for the log file. | |||
*/ | */ | |||
System(Renderer* renderer, ResourceProvider* resourceProvider = 0, XMLP | static System& create(Renderer& renderer, | |||
arser* xmlParser = 0, ScriptModule* scriptModule = 0, const String& configF | ResourceProvider* resourceProvider = 0, | |||
ile = "", const String& logFile = "CEGUI.log"); | XMLParser* xmlParser = 0, | |||
ImageCodec* imageCodec = 0, | ||||
ScriptModule* scriptModule = 0, | ||||
const String& configFile = "", | ||||
const String& logFile = "CEGUI.log"); | ||||
/*! | //! Destroy the System object. | |||
\brief | static void destroy(); | |||
Destructor for System objects. | ||||
*/ | ||||
~System(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the Renderer object being used by the sy stem | Return a pointer to the Renderer object being used by the sy stem | |||
\return | \return | |||
Pointer to the Renderer object used by the system. | Pointer to the Renderer object used by the system. | |||
*/ | */ | |||
Renderer* getRenderer(void) const {return d_re nderer;} | Renderer* getRenderer(void) const {return d_re nderer;} | |||
skipping to change at line 647 | skipping to change at line 656 | |||
\brief | \brief | |||
Return the name of the currently set default xml parser module. | Return the name of the currently set default xml parser module. | |||
\return | \return | |||
String holding the currently set default xml parser name. Note tha t if | String holding the currently set default xml parser name. Note tha t if | |||
this name has been changed after instantiating the system, the name | this name has been changed after instantiating the system, the name | |||
returned may not actually correspond to the module in use. | returned may not actually correspond to the module in use. | |||
*/ | */ | |||
static const String getDefaultXMLParserName(); | static const String getDefaultXMLParserName(); | |||
/*! | ||||
\brief | ||||
Perform updates with regards to the window that contains the mouse | ||||
cursor, firing any required MouseEnters / MouseLeaves events. | ||||
\note | ||||
The CEGUI system components call this member as a matter of course, | ||||
in most cases there will be no need for user / client code to call | ||||
this | ||||
member directly. | ||||
\return | ||||
- true if the window containing the mouse had changed. | ||||
- false if the window containing the mouse had not changed. | ||||
*/ | ||||
bool updateWindowContainingMouse(); | ||||
/*! | ||||
\brief | ||||
Retrieve the image codec to be used by the system. | ||||
*/ | ||||
ImageCodec& getImageCodec() const; | ||||
/*! | ||||
\brief | ||||
Set the image codec to be used by the system. | ||||
*/ | ||||
void setImageCodec(const String& codecName); | ||||
/*! | ||||
\brief | ||||
Set the image codec to use from an existing image codec. | ||||
In this case the renderer does not take the ownership of the image | ||||
codec | ||||
object. | ||||
\param codec | ||||
The ImageCodec object to be used. | ||||
*/ | ||||
void setImageCodec(ImageCodec& codec); | ||||
/*! | ||||
\brief | ||||
Set the name of the default image codec to be used. | ||||
*/ | ||||
static void setDefaultImageCodecName(const String& codecName); | ||||
/*! | ||||
\brief | ||||
Get the name of the default image codec. | ||||
*/ | ||||
static const String& getDefaultImageCodecName(); | ||||
/*! | ||||
\brief | ||||
Notification function to be called when the main display changes si | ||||
ze. | ||||
Client code should call this function when the host window changes | ||||
size, | ||||
or if the display resolution is changed in full-screen mode. | ||||
Calling this function ensures that any other parts of the system th | ||||
at | ||||
need to know about display size changes are notified. This affects | ||||
things such as the MouseCursor default constraint area, and also th | ||||
e | ||||
auto-scale functioning of Imagesets and Fonts. | ||||
\note | ||||
This function will also fire the System::EventDisplaySizeChanged ev | ||||
ent. | ||||
\param new_size | ||||
Size object describing the new display size in pixels. | ||||
*/ | ||||
void notifyDisplaySizeChanged(const Size& new_size); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Input injection interface | Input injection interface | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Method that injects a mouse movement event into the system | Method that injects a mouse movement event into the system | |||
\param delta_x | \param delta_x | |||
amount the mouse moved on the x axis. | amount the mouse moved on the x axis. | |||
skipping to change at line 788 | skipping to change at line 868 | |||
Currently, this method always returns true. | Currently, this method always returns true. | |||
*/ | */ | |||
bool injectTimePulse(float timeElapsed); | bool injectTimePulse(float timeElapsed); | |||
private: | private: | |||
// unimplemented constructors / assignment | // unimplemented constructors / assignment | |||
System(const System& obj); | System(const System& obj); | |||
System& operator=(const System& obj); | System& operator=(const System& obj); | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Constants | ||||
******************************************************************** | ||||
*****/ | ||||
static const char CEGUIConfigSchemaName[]; | ||||
//!< Filename of the XML schema used for validating Config files. | ||||
/******************************************************************* | ||||
****** | ||||
Implementation Functions | Implementation Functions | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | ||||
\brief | ||||
Construct a new System object | ||||
\param renderer | ||||
Reference to a valid Renderer object that will be used to render GU | ||||
I | ||||
imagery. | ||||
\param resourceProvider | ||||
Pointer to a ResourceProvider object, or NULL to use whichever defa | ||||
ult | ||||
the Renderer provides. | ||||
\param xmlParser | ||||
Pointer to a valid XMLParser object to be used when parsing XML fil | ||||
es, | ||||
or NULL to use a default parser. | ||||
\param imageCodec | ||||
Pointer to a valid ImageCodec object to be used when loading image | ||||
files, or NULL to use a default image codec. | ||||
\param scriptModule | ||||
Pointer to a ScriptModule object. may be NULL for none. | ||||
\param configFile | ||||
String object containing the name of a configuration file to use. | ||||
\param logFile | ||||
String object containing the name to use for the log file. | ||||
*/ | ||||
System(Renderer& renderer, ResourceProvider* resourceProvider, | ||||
XMLParser* xmlParser, ImageCodec* imageCodec, | ||||
ScriptModule* scriptModule, const String& configFile, | ||||
const String& logFile); | ||||
/*! | ||||
\brief | ||||
Destructor for System objects. | ||||
*/ | ||||
~System(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
Given Point \a pt, return a pointer to the Window that shoul d receive a mouse input if \a pt is the mouse location. | Given Point \a pt, return a pointer to the Window that shoul d receive a mouse input if \a pt is the mouse location. | |||
\param pt | \param pt | |||
Point object describing a screen location in pixels. | Point object describing a screen location in pixels. | |||
\param allow_disabled | ||||
Specifies whether a disabled window may be returned. | ||||
\return | \return | |||
Pointer to a Window object that should receive mouse input w ith the system in its current state and the mouse at location \a pt. | Pointer to a Window object that should receive mouse input w ith the system in its current state and the mouse at location \a pt. | |||
*/ | */ | |||
Window* getTargetWindow(const Point& pt) const; | Window* getTargetWindow(const Point& pt, const bool allow_disabled) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the Window that should receive keyboard input considering the current modal target. | Return a pointer to the Window that should receive keyboard input considering the current modal target. | |||
\return | \return | |||
Pointer to a Window object that should receive the keyboard input. | Pointer to a Window object that should receive the keyboard input. | |||
*/ | */ | |||
Window* getKeyboardTargetWindow(void) const; | Window* getKeyboardTargetWindow(void) const; | |||
skipping to change at line 857 | skipping to change at line 975 | |||
Key::Scan value describing the value to be converted | Key::Scan value describing the value to be converted | |||
\param direction | \param direction | |||
true if the key is being pressed, false if the key is being released. | true if the key is being pressed, false if the key is being released. | |||
\return | \return | |||
SystemKey value that corresponds to the same key as \a key, or 0 if key was not a system key. | SystemKey value that corresponds to the same key as \a key, or 0 if key was not a system key. | |||
*/ | */ | |||
SystemKey keyCodeToSyskey(Key::Scan key, bool direction); | SystemKey keyCodeToSyskey(Key::Scan key, bool direction); | |||
/*! | ||||
\brief | ||||
Handler method for display size change notifications | ||||
*/ | ||||
bool handleDisplaySizeChange(const EventArgs& e); | ||||
//! output the standard log header | //! output the standard log header | |||
void outputLogHeader(); | void outputLogHeader(); | |||
//! adds factories for all the basic window types | //! adds factories for all the basic window types | |||
void addStandardWindowFactories(); | void addStandardWindowFactories(); | |||
//! create the other core system singleton objects (except the logger) | //! create the other core system singleton objects (except the logger) | |||
void createSingletons(); | void createSingletons(); | |||
//! cleanup the core system singleton objects | //! cleanup the core system singleton objects | |||
skipping to change at line 884 | skipping to change at line 996 | |||
//! handle creation and initialisation of the XML parser. | //! handle creation and initialisation of the XML parser. | |||
void setupXMLParser(); | void setupXMLParser(); | |||
//! handle cleanup of the XML parser | //! handle cleanup of the XML parser | |||
void cleanupXMLParser(); | void cleanupXMLParser(); | |||
//! common function used for injection of mouse positions and movements | //! common function used for injection of mouse positions and movements | |||
bool mouseMoveInjection_impl(MouseEventArgs& ma); | bool mouseMoveInjection_impl(MouseEventArgs& ma); | |||
//! setup image codec | ||||
void setupImageCodec(const String& codecName); | ||||
//! cleanup image codec | ||||
void cleanupImageCodec(); | ||||
//! Set the CEGUI version string that gets output to the log. | ||||
void initialiseVersionString(); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Handlers for System events | Handlers for System events | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called when the main system GUI Sheet (or root windo w) is changed. | Handler called when the main system GUI Sheet (or root windo w) is changed. | |||
\a e is a WindowEventArgs with 'window' set to the old root window. | \a e is a WindowEventArgs with 'window' set to the old root window. | |||
*/ | */ | |||
void onGUISheetChanged(WindowEventArgs& e); | void onGUISheetChanged(WindowEventArgs& e); | |||
skipping to change at line 936 | skipping to change at line 1057 | |||
\brief | \brief | |||
Handler called when the mouse movement scaling factor is cha nged. | Handler called when the mouse movement scaling factor is cha nged. | |||
*/ | */ | |||
void onMouseMoveScalingChanged(EventArgs& e); | void onMouseMoveScalingChanged(EventArgs& e); | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
Renderer* d_renderer; //!< Holds the point er to the Renderer object given to us in the constructor | Renderer* d_renderer; //!< Holds the point er to the Renderer object given to us in the constructor | |||
ResourceProvider* d_resourceProvider; //!< Holds the pointer to th e ResourceProvider object given to us by the renderer or the System constru ctor. | ResourceProvider* d_resourceProvider; //!< Holds the pointer to th e ResourceProvider object given to us by the renderer or the System constru ctor. | |||
Font* d_defaultFont; //!< Holds a pointer to the | bool d_ourResourceProvider; | |||
default GUI font. | Font* d_defaultFont; //!< Holds a pointer to the | |||
default GUI font. | ||||
bool d_gui_redraw; //!< True if GUI should be r e-drawn, false if render should re-use last times queue. | bool d_gui_redraw; //!< True if GUI should be r e-drawn, false if render should re-use last times queue. | |||
Window* d_wndWithMouse; //!< Pointer to the window t hat currently contains the mouse. | Window* d_wndWithMouse; //!< Pointer to the window t hat currently contains the mouse. | |||
Window* d_activeSheet; //!< The active GUI sheet (r oot window) | Window* d_activeSheet; //!< The active GUI sheet (r oot window) | |||
Window* d_modalTarget; //!< Pointer to the window t hat is the current modal target. NULL is there is no modal target. | Window* d_modalTarget; //!< Pointer to the window t hat is the current modal target. NULL is there is no modal target. | |||
String d_strVersion; //!< CEGUI version | String d_strVersion; //!< CEGUI version | |||
uint d_sysKeys; //!< Current set of system keys pressed (in mk1 these were passed in, here we track these ourse lf). | uint d_sysKeys; //!< Current set of system keys pressed (in mk1 these were passed in, here we track these ourse lf). | |||
bool d_lshift; //!< Tracks state of left shift. | bool d_lshift; //!< Tracks state of left shift. | |||
skipping to change at line 975 | skipping to change at line 1097 | |||
float d_mouseScalingFactor; //!< Scaling applied to mouse movement inputs. | float d_mouseScalingFactor; //!< Scaling applied to mouse movement inputs. | |||
XMLParser* d_xmlParser; //!< XMLParser object we use to process xml files. | XMLParser* d_xmlParser; //!< XMLParser object we use to process xml files. | |||
bool d_ourXmlParser; //!< true when we created the xml parse r. | bool d_ourXmlParser; //!< true when we created the xml parse r. | |||
DynamicModule* d_parserModule; //! pointer to parser module. | DynamicModule* d_parserModule; //! pointer to parser module. | |||
Tooltip* d_defaultTooltip; //!< System default tooltip object. | Tooltip* d_defaultTooltip; //!< System default tooltip object. | |||
bool d_weOwnTooltip; //!< true if System created the custom Tooltip. | bool d_weOwnTooltip; //!< true if System created the custom Tooltip. | |||
//!< Holds the connection to Renderer::EventDisplaySizeChanged so we ca | ||||
n unsubscribe before we die. | ||||
Event::Connection d_rendererCon; | ||||
static String d_defaultXMLParserName; //!< Holds name of default XMLP arser | static String d_defaultXMLParserName; //!< Holds name of default XMLP arser | |||
//! Holds a pointer to the image codec to use. | ||||
ImageCodec* d_imageCodec; | ||||
/** Holds a pointer to the image codec module. If d_imageCodecModule is | ||||
0 we | ||||
* are not owner of the image codec object | ||||
*/ | ||||
DynamicModule* d_imageCodecModule; | ||||
//! Holds the name of the default codec to use. | ||||
static String d_defaultImageCodecName; | ||||
//! true when we created the CEGUI::Logger based object. | ||||
bool d_ourLogger; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUISystem_h_ | #endif // end of guard _CEGUISystem_h_ | |||
End of changes. 17 change blocks. | ||||
32 lines changed or deleted | 168 lines changed or added | |||
CEGUITGAImageCodec.h | CEGUITGAImageCodec.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITGAImageCodec_h_ | #ifndef _CEGUITGAImageCodec_h_ | |||
#define _CEGUITGAImageCodec_h_ | #define _CEGUITGAImageCodec_h_ | |||
#include "CEGUIImageCodec.h" | #include "../../CEGUIImageCodec.h" | |||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUITGAIMAGECODEC_EXPORTS | # ifdef CEGUITGAIMAGECODEC_EXPORTS | |||
# define CEGUITGAIMAGECODEC_API __declspec(dllexport) | # define CEGUITGAIMAGECODEC_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUITGAIMAGECODEC_API __declspec(dllimport) | # define CEGUITGAIMAGECODEC_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUITGAIMAGECODEC_API | # define CEGUITGAIMAGECODEC_API | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITabButton.h | CEGUITabButton.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITabButton_h_ | #ifndef _CEGUITabButton_h_ | |||
#define _CEGUITabButton_h_ | #define _CEGUITabButton_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "elements/CEGUIButtonBase.h" | #include "CEGUIButtonBase.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Base class for TabButtons. A TabButton based class is used internally as | Base class for TabButtons. A TabButton based class is used internally as | |||
the button that appears at the top of a TabControl widget to select the | the button that appears at the top of a TabControl widget to select the | |||
active tab pane. | active tab pane. | |||
*/ | */ | |||
skipping to change at line 78 | skipping to change at line 78 | |||
/*! | /*! | |||
\brief | \brief | |||
Destructor for TabButton class | Destructor for TabButton class | |||
*/ | */ | |||
virtual ~TabButton(void); | virtual ~TabButton(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether this tab button is selected or not | Set whether this tab button is selected or not | |||
*/ | */ | |||
virtual void setSelected(bool selected) { d_selected = selected; reques tRedraw(); } | virtual void setSelected(bool selected) { d_selected = selected; invali date(); } | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this tab button is selected or not | Return whether this tab button is selected or not | |||
*/ | */ | |||
bool isSelected(void) const { return d_selected; } | bool isSelected(void) const { return d_selected; } | |||
/*! | /*! | |||
\brief | \brief | |||
Set the target window which is the content pane which this button i s | Set the target window which is the content pane which this button i s | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUITabControl.h | CEGUITabControl.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITabControl_h_ | #ifndef _CEGUITabControl_h_ | |||
#define _CEGUITabControl_h_ | #define _CEGUITabControl_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUITabControlProperties.h" | #include "CEGUITabControlProperties.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
skipping to change at line 337 | skipping to change at line 337 | |||
/*! | /*! | |||
\brief | \brief | |||
Perform the actual rendering for this Window. | Perform the actual rendering for this Window. | |||
\param z | \param z | |||
float value specifying the base Z co-ordinate that should be used w hen rendering | float value specifying the base Z co-ordinate that should be used w hen rendering | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
virtual void drawSelf(float z) { /* do nothing; rendering handled by children */ } | virtual void drawSelf(const RenderingContext&) { /* do nothing; r endering handled by children */ } | |||
/*! | /*! | |||
\brief | \brief | |||
Add a TabButton for the specified child Window. | Add a TabButton for the specified child Window. | |||
*/ | */ | |||
virtual void addButtonForTabContent(Window* wnd); | virtual void addButtonForTabContent(Window* wnd); | |||
/*! | /*! | |||
\brief | \brief | |||
Remove the TabButton for the specified child Window. | Remove the TabButton for the specified child Window. | |||
*/ | */ | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
CEGUITabControlProperties.h | CEGUITabControlProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITabControlProperties_h_ | #ifndef _CEGUITabControlProperties_h_ | |||
#define _CEGUITabControlProperties_h_ | #define _CEGUITabControlProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of TabControlProperties namespace section | // Start of TabControlProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Listbox class | Namespace containing all classes that make up the properties interfa ce for the Listbox class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITextUtils.h | CEGUITextUtils.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUITextUtils.h | filename: CEGUITextUtils.h | |||
created: 30/5/2004 | created: 30/5/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Interface to a static class containing some utility | purpose: Interface to a static class containing some utility | |||
functions for text / string operations | functions for text / string operations | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
skipping to change at line 36 | skipping to change at line 36 | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITextUtils_h_ | #ifndef _CEGUITextUtils_h_ | |||
#define _CEGUITextUtils_h_ | #define _CEGUITextUtils_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include <vector> | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Text utility support class. This class is all static members. You do not create instances of this class. | Text utility support class. This class is all static members. You do not create instances of this class. | |||
*/ | */ | |||
class CEGUIEXPORT TextUtils | class CEGUIEXPORT TextUtils | |||
{ | { | |||
public: | public: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Constants | Constants | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
static const String DefaultWhitespace; //!< The def | static const String DefaultWhitespace; //!< The default set of whi | |||
ault set of whitespace | tespace | |||
static const String DefaultAlphanumerical; //!< default set of | static const String DefaultAlphanumerical; //!< default set of alphanu | |||
alphanumericals. | mericals. | |||
static const String DefaultWrapDelimiters; //!< The default set | static const String DefaultWrapDelimiters; //!< The default set of wor | |||
of word-wrap delimiters | d-wrap delimiters | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Methods | Methods | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
/*! | /*! | |||
\brief | \brief | |||
return a String containing the the next word in a String. | return a String containing the the next word in a String. | |||
This method returns a String object containing the the word, | This method returns a String object containing the the word, starti | |||
starting at index \a start_idx, of String \a str | ng at index \a start_idx, of String \a str | |||
as delimited by the code points specified in string \a delim | as delimited by the code points specified in string \a delimiters ( | |||
iters (or the ends of the input string). | or the ends of the input string). | |||
\param str | \param str | |||
String object containing the input data. | String object containing the input data. | |||
\param start_idx | \param start_idx | |||
index into \a str where the search for the next word is to b | index into \a str where the search for the next word is to begin. | |||
egin. Defaults to start of \a str. | Defaults to start of \a str. | |||
\param delimiters | \param delimiters | |||
String object containing the set of delimiter code points to | String object containing the set of delimiter code points to be use | |||
be used when determining the start and end | d when determining the start and end | |||
points of a word in string \a str. Defaults to whitespace. | points of a word in string \a str. Defaults to whitespace. | |||
\return | \return | |||
String object containing the next \a delimiters delimited wo | String object containing the next \a delimiters delimited word from | |||
rd from \a str, starting at index \a start_idx. | \a str, starting at index \a start_idx. | |||
*/ | */ | |||
static String getNextWord(const String& str, String::size_type sta | static String getNextWord(const String& str, String::size_type start_ | |||
rt_idx = 0, const String& delimiters = DefaultWhitespace); | idx = 0, const String& delimiters = DefaultWhitespace); | |||
/*! | /*! | |||
\brief | \brief | |||
Return the index of the first character of the word at \a id | Return the index of the first character of the word at \a idx. | |||
x. | ||||
/note | /note | |||
This currently uses DefaultWhitespace and DefaultAlphanumeri | This currently uses DefaultWhitespace and DefaultAlphanumerical to | |||
cal to determine groupings for what constitutes a 'word'. | determine groupings for what constitutes a 'word'. | |||
\param str | \param str | |||
String containing text. | String containing text. | |||
\param idx | \param idx | |||
Index into \a str where search for start of word is to begin | Index into \a str where search for start of word is to begin. | |||
. | ||||
\return | \return | |||
Index into \a str which marks the begining of the word at in | Index into \a str which marks the begining of the word at index \a | |||
dex \a idx. | idx. | |||
*/ | */ | |||
static String::size_type getWordStartIdx(const String& str, S | static String::size_type getWordStartIdx(const String& str, String:: | |||
tring::size_type idx); | size_type idx); | |||
/*! | /*! | |||
\brief | \brief | |||
Return the index of the first character of the word after th | Return the index of the first character of the word after the word | |||
e word at \a idx. | at \a idx. | |||
/note | /note | |||
This currently uses DefaultWhitespace and DefaultAlphanumeri | This currently uses DefaultWhitespace and DefaultAlphanumerical to | |||
cal to determine groupings for what constitutes a 'word'. | determine groupings for what constitutes a 'word'. | |||
\param str | \param str | |||
String containing text. | String containing text. | |||
\param idx | \param idx | |||
Index into \a str where search is to begin. | Index into \a str where search is to begin. | |||
\return | \return | |||
Index into \a str which marks the begining of the word at af | Index into \a str which marks the begining of the word at after the | |||
ter the word at index \a idx. | word at index \a idx. | |||
If \a idx is within the last word, then the return is the la | If \a idx is within the last word, then the return is the last inde | |||
st index in \a str. | x in \a str. | |||
*/ | */ | |||
static String::size_type getNextWordStartIdx(const String& st | static String::size_type getNextWordStartIdx(const String& str, Stri | |||
r, String::size_type idx); | ng::size_type idx); | |||
/*! | /*! | |||
\brief | \brief | |||
Trim all characters from the set specified in \a chars from | Trim all characters from the set specified in \a chars from the beg | |||
the begining of \a str. | ining of \a str. | |||
\param str | \param str | |||
String object to be trimmed. | String object to be trimmed. | |||
\param chars | \param chars | |||
String object containing the set of code points to be trimme | String object containing the set of code points to be trimmed. | |||
d. | */ | |||
*/ | static void trimLeadingChars(String& str, const String& chars); | |||
static void trimLeadingChars(String& str, const String& chars); | ||||
/*! | /*! | |||
\brief | \brief | |||
Trim all characters from the set specified in \a chars from | Trim all characters from the set specified in \a chars from the end | |||
the end of \a str. | of \a str. | |||
\param str | \param str | |||
String object to be trimmed. | String object to be trimmed. | |||
\param chars | \param chars | |||
String object containing the set of code points to be trimme | String object containing the set of code points to be trimmed. | |||
d. | */ | |||
*/ | static void trimTrailingChars(String& str, const String& chars); | |||
static void trimTrailingChars(String& str, const String& chars); | ||||
private: | private: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Data | Data | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
static String d_delimiters; //!< Current | static String d_delimiters; //!< Current set of delimit | |||
set of delimiters. | ers. | |||
static String d_whitespace; //!< Current | static String d_whitespace; //!< Current set of whitesp | |||
set of whitespace. | ace. | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Construction / Destruction | Construction / Destruction | |||
******************************************************************** | *********************************************************************** | |||
*****/ | **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Constructor and Destructor are private. This class has all | Constructor and Destructor are private. This class has all static | |||
static members. | members. | |||
*/ | */ | |||
TextUtils(void); | TextUtils(void); | |||
~TextUtils(void); | ~TextUtils(void); | |||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUITextUtils_h_ | #endif // end of guard _CEGUITextUtils_h_ | |||
End of changes. 30 change blocks. | ||||
124 lines changed or deleted | 121 lines changed or added | |||
CEGUITexture.h | CEGUITexture.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUITexture.h | filename: CEGUITexture.h | |||
created: 21/2/2004 | created: 21/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Defines abstract interface for texture objects. Tex | purpose: Defines abstract interface for texture objects. Texture | |||
ture | objects are created & destroyed by the Renderer. | |||
objects are created & destroyed by the Rende | ||||
rer. | ||||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 42 | skipping to change at line 42 | |||
#define _CEGUITexture_h_ | #define _CEGUITexture_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Abstract base class specifying the required interface for Texture ob jects. | Abstract base class specifying the required interface for Texture objec ts. | |||
Texture objects are created via the Renderer. The actual inner work | Texture objects are created via the Renderer. The actual inner working | |||
ings of any Texture object | s of | |||
are dependant upon the Renderer (and underlying API) in use. This b | any Texture object are dependant upon the Renderer (and underlying API) | |||
ase class defines the minimal | in | |||
set of functions that is required for the rest of the system to work | use. This base class defines the minimal set of functions that is requ | |||
. Texture objects are only | ired | |||
created through the Renderer object's texture creation functions. | for the rest of the system to work. Texture objects are only created | |||
through the Renderer object's texture creation functions. | ||||
*/ | */ | |||
class CEGUIEXPORT Texture | class CEGUIEXPORT Texture | |||
{ | { | |||
public: | public: | |||
/*! | /*! | |||
\brief | \brief | |||
Enum containing the list of supported pixel formats that can be pas | Enumerated type containing the supported pixel formats that can be | |||
sed to loadFromMemory | passed to loadFromMemory | |||
*/ | */ | |||
enum PixelFormat | enum PixelFormat | |||
{ | { | |||
//! Each pixel is 3 bytes. RGB in that order. | //! Each pixel is 3 bytes. RGB in that order. | |||
PF_RGB, | PF_RGB, | |||
//! Each pixel is 4 bytes. RGBA in that order. | //! Each pixel is 4 bytes. RGBA in that order. | |||
PF_RGBA | PF_RGBA | |||
}; | }; | |||
/******************************************************************* | ||||
****** | ||||
Abstract Interface | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Returns the current pixel width of the texture | ||||
\return | ||||
ushort value that is the current width of the texture in pix | ||||
els | ||||
*/ | ||||
virtual ushort getWidth(void) const = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Returns the original pixel width of the data loaded into the textur e. | Returns the current pixel size of the texture. | |||
\return | \return | |||
ushort value that is the original width, in pixels, of the data las | Reference to a Size object that describes the size of the texture i | |||
t | n | |||
loaded into the texture. | pixels. | |||
\note | ||||
for compatibility reason this method is optional the auto scale | ||||
issue mantis ticket # 0000045 is not fixed for renderer that do | ||||
not handle this. | ||||
*/ | */ | |||
virtual ushort getOriginalWidth(void) const { return getWidth(); } | virtual const Size& getSize() const = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Returns the current scale used for the width of the texture | Returns the original pixel size of the data loaded into the texture . | |||
\return | \return | |||
float value that denotes the horizontal scaling required to | reference to a Size object that describes the original size, in pix | |||
accurately map pixel positions to texture co-ords. | els, | |||
of the data loaded into the texture. | ||||
*/ | */ | |||
virtual float getXScale(void) const { return 1.0f / static_cast<float>( | virtual const Size& getOriginalDataSize() const = 0; | |||
getOriginalWidth()); } | ||||
/*! | ||||
\brief | ||||
Returns the current pixel height of the texture | ||||
\return | ||||
ushort value that is the current height of the texture in pi | ||||
xels | ||||
*/ | ||||
virtual ushort getHeight(void) const = 0; | ||||
/*! | /*! | |||
\brief | \brief | |||
Returns the original pixel height of the data loaded into the textu | Returns pixel to texel scale values that should be used for convert | |||
re. | ing | |||
pixel values to texture co-ords. | ||||
\return | \return | |||
ushort value that is the original height, in pixels, of the data la | Reference to a Vector2 object that describes the scaling values req | |||
st | uired | |||
loaded into the texture. | to accurately map pixel positions to texture co-ordinates. | |||
\note for compatibility reason this method is optional the auto scale | ||||
issue mantis ticket # 0000045 is not fixed for renderer that do | ||||
not handle this. | ||||
*/ | */ | |||
virtual ushort getOriginalHeight(void) const { return getHeight(); } | virtual const Vector2& getTexelScaling() const = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Returns the current scale used for the height of the texture | Loads the specified image file into the texture. The texture is re | |||
sized | ||||
\return | as required to hold the image. | |||
float value that denotes the vertical scaling required to | ||||
accurately map pixel positions to texture co-ords. | ||||
*/ | ||||
virtual float getYScale(void) const { return 1.0f / static_cast<float>( | ||||
getOriginalHeight()); } | ||||
/*! | ||||
\brief | ||||
Loads the specified image file into the texture. The textur | ||||
e is resized as required to hold the image. | ||||
\param filename | \param filename | |||
The filename of the image file that is to be loaded into the | The filename of the image file that is to be loaded into the textur | |||
texture | e | |||
\param resourceGroup | \param resourceGroup | |||
Resource group identifier to be passed to the resource provider whe | Resource group identifier to be passed to the resource provider whe | |||
n loading the image file. | n | |||
loading the image file. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
virtual void loadFromFile(const String& filename, const String& r | ||||
esourceGroup) = 0; | ||||
/*! | ||||
\brief | ||||
Loads (copies) an image in memory into the texture. The tex | ||||
ture is resized as required to hold the image. | ||||
\param buffPtr | ||||
Pointer to the buffer containing the image data | ||||
\param buffWidth | \return | |||
Width of the buffer (in pixels as specified by \a pixelForma | Nothing. | |||
t ) | */ | |||
virtual void loadFromFile(const String& filename, | ||||
const String& resourceGroup) = 0; | ||||
\param buffHeight | /*! | |||
Height of the buffer (in pixels as specified by \a pixelForm | \brief | |||
at ) | Loads (copies) an image in memory into the texture. The texture is | |||
resized as required to hold the image. | ||||
\param pixelFormat | \param buffer | |||
PixelFormat value describing the format contained in \a buffPtr | Pointer to the buffer containing the image data. | |||
\return | \param buffer_size | |||
Nothing. | Size of the buffer (in pixels as specified by \a pixelFormat) | |||
*/ | ||||
virtual void loadFromMemory(const void* buffPtr, uint buffWidth, | ||||
uint buffHeight, PixelFormat pixelFormat) = 0; | ||||
/*! | \param pixel_format | |||
\brief | PixelFormat value describing the format contained in \a buffPtr. | |||
Return a pointer to the Renderer object that created and own | ||||
s this Texture | ||||
\return | \return | |||
Pointer to the Renderer object that owns the Texture | Nothing. | |||
*/ | */ | |||
Renderer* getRenderer(void) const {return d_ow | virtual void loadFromMemory(const void* buffer, | |||
ner;} | const Size& buffer_size, | |||
PixelFormat pixel_format) = 0; | ||||
protected: | /*! | |||
/******************************************************************* | \brief | |||
****** | Save / dump the content of the texture to a memory buffer. The dum | |||
Construction and Destruction | ped | |||
******************************************************************** | pixel format is always RGBA (4 bytes per pixel). | |||
*****/ | ||||
/*! | ||||
\brief | ||||
Constructor for Texture base class. This is never called by | ||||
client code. | ||||
*/ | ||||
Texture(Renderer* owner) : d_owner(owner) {} | ||||
/*! | \param buffer | |||
\brief | Pointer to the buffer that is to receive the image data. You must | |||
Destructor for Texture base class. This is never called by | make | |||
client code. | sure that this buffer is large enough to hold the dumped texture da | |||
*/ | ta, | |||
virtual ~Texture(void) {} | the required pixel dimensions can be established by calling getSize | |||
. | ||||
*/ | ||||
virtual void saveToMemory(void* buffer) = 0; | ||||
private: | /*! | |||
Renderer* d_owner; //<! Renderer object that created an | \brief | |||
d owns this texture | Destructor for Texture base class. | |||
*/ | ||||
virtual ~Texture() {} | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUITexture_h_ | #endif // end of guard _CEGUITexture_h_ | |||
End of changes. 29 change blocks. | ||||
143 lines changed or deleted | 83 lines changed or added | |||
CEGUIThumb.h | CEGUIThumb.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIThumb_h_ | #ifndef _CEGUIThumb_h_ | |||
#define _CEGUIThumb_h_ | #define _CEGUIThumb_h_ | |||
#include "CEGUIPushButton.h" | #include "CEGUIPushButton.h" | |||
#include "elements/CEGUIThumbProperties.h" | #include "CEGUIThumbProperties.h" | |||
#include <utility> | #include <utility> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUIThumbProperties.h | CEGUIThumbProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIThumbProperties_h_ | #ifndef _CEGUIThumbProperties_h_ | |||
#define _CEGUIThumbProperties_h_ | #define _CEGUIThumbProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of ThumbProperties namespace section | // Start of ThumbProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Thumb class | Namespace containing all classes that make up the properties interfa ce for the Thumb class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITinyXMLParser.h | CEGUITinyXMLParser.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITinyXMLParser_h_ | #ifndef _CEGUITinyXMLParser_h_ | |||
#define _CEGUITinyXMLParser_h_ | #define _CEGUITinyXMLParser_h_ | |||
#include "CEGUIXMLParser.h" | #include "../../CEGUIXMLParser.h" | |||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUITINYXMLPARSER_EXPORTS | # ifdef CEGUITINYXMLPARSER_EXPORTS | |||
# define CEGUITINYXMLPARSER_API __declspec(dllexport) | # define CEGUITINYXMLPARSER_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUITINYXMLPARSER_API __declspec(dllimport) | # define CEGUITINYXMLPARSER_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUITINYXMLPARSER_API | # define CEGUITINYXMLPARSER_API | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITitlebar.h | CEGUITitlebar.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITitlebar_h_ | #ifndef _CEGUITitlebar_h_ | |||
#define _CEGUITitlebar_h_ | #define _CEGUITitlebar_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUITitlebarProperties.h" | #include "CEGUITitlebarProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
skipping to change at line 113 | skipping to change at line 113 | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
New event handlers for title bar | New event handlers for title bar | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Event handler called when the 'draggable' state for the titl e bar is changed. | Event handler called when the 'draggable' state for the titl e bar is changed. | |||
Note that this is for 'internal' use at the moment and as su ch does not add or | Note that this is for 'internal' use at the moment and as su ch does not add or | |||
fire a public Event that can be subscribed to. | fire a public Event that can be subscribed to. | |||
*/ | */ | |||
virtual void onDraggingModeChanged(WindowEventArgs& e) {} | virtual void onDraggingModeChanged(WindowEventArgs&) {} | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Functions | Implementation Functions | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the given clas s name at some point in the inheritance hierarchy. | Return whether this window was inherited from the given clas s name at some point in the inheritance hierarchy. | |||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
CEGUITitlebarProperties.h | CEGUITitlebarProperties.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITitlebarProperties_h_ | #ifndef _CEGUITitlebarProperties_h_ | |||
#define _CEGUITitlebarProperties_h_ | #define _CEGUITitlebarProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of TitlebarProperties namespace section | // Start of TitlebarProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Titlebar class | Namespace containing all classes that make up the properties interfa ce for the Titlebar class | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITooltip.h | CEGUITooltip.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITooltip_h_ | #ifndef _CEGUITooltip_h_ | |||
#define _CEGUITooltip_h_ | #define _CEGUITooltip_h_ | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "elements/CEGUITooltipProperties.h" | #include "CEGUITooltipProperties.h" | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUITooltipProperties.h | CEGUITooltipProperties.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUITooltipProperties_h_ | #ifndef _CEGUITooltipProperties_h_ | |||
#define _CEGUITooltipProperties_h_ | #define _CEGUITooltipProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of TooltipProperties namespace section | // Start of TooltipProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa ce for the Tooltip class | Namespace containing all classes that make up the properties interfa ce for the Tooltip class | |||
*/ | */ | |||
namespace TooltipProperties | namespace TooltipProperties | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CEGUITree.h | CEGUITree.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUITree.h | filename: CEGUITree.h | |||
created: 5-13-07 | created: 5-13-07 | |||
author: Jonathan Welch (Based on Code by David Durant) | author: Jonathan Welch (Based on Code by David Durant) | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
* included in all copies or substantial portions of the Software. | * included in all copies or substantial portions of the Software. | |||
* | * | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
*************************************************************************** | ************************************************************************** | |||
/ | */ | |||
#ifndef _CEGUITree_h_ | #ifndef _CEGUITree_h_ | |||
#define _CEGUITree_h_ | #define _CEGUITree_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIWindow.h" | #include "../CEGUIWindow.h" | |||
#include "CEGUIWindowManager.h" | #include "../CEGUIWindowManager.h" | |||
#include "elements/CEGUITreeItem.h" | #include "CEGUITreeItem.h" | |||
#include "elements/CEGUITreeProperties.h" | #include "CEGUITreeProperties.h" | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
class ImagerySection; // forward declaration | ||||
/*! | /*! | |||
\brief | \brief | |||
EventArgs based class that is used for objects passed to input event | EventArgs based class that is used for objects passed to input event | |||
handlers | handlers concerning Tree events. | |||
concerning Tree events. | */ | |||
*/ | ||||
class CEGUIEXPORT TreeEventArgs : public WindowEventArgs | class CEGUIEXPORT TreeEventArgs : public WindowEventArgs | |||
{ | { | |||
public: | public: | |||
TreeEventArgs(Window* wnd) : WindowEventArgs(wnd) { treeItem = 0; } | TreeEventArgs(Window* wnd) : WindowEventArgs(wnd) | |||
TreeItem *treeItem; | { treeItem = 0; } | |||
}; | ||||
TreeItem *treeItem; | ||||
}; | ||||
/*! | /*! | |||
\brief | \brief | |||
Base class for standard Tree widget. | Base class for standard Tree widget. | |||
*/ | ||||
\deprecated | ||||
The CEGUI::Tree, CEGUI::TreeItem and any other associated classes are | ||||
deprecated and thier use should be minimised - preferably eliminated - | ||||
where possible. It is extremely unfortunate that this widget was ever | ||||
added | ||||
to CEGUI since its design and implementation are poor and do not meet | ||||
established standards for the CEGUI project. | ||||
\par | ||||
While no alternative currently exists, a superior, replacement tree wid | ||||
get | ||||
will be provided prior to the final removal of the current implementati | ||||
on. | ||||
*/ | ||||
class CEGUIEXPORT Tree : public Window | class CEGUIEXPORT Tree : public Window | |||
{ | { | |||
friend class TreeItem; | friend class TreeItem; | |||
typedef std::vector<TreeItem*> LBItemList; | typedef std::vector<TreeItem*> LBItemList; | |||
public: | public: | |||
static const String EventNamespace; //!< | //! Namespace for global events | |||
Namespace for global events | static const String EventNamespace; | |||
static const String WidgetTypeName; | static const String WidgetTypeName; | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Constants | Constants | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
// event names | // event names | |||
static const String EventListContentsChanged; //!< Event t | //! Event triggered when the contents of the tree is changed. | |||
riggered when the contents of the list is changed. | static const String EventListContentsChanged; | |||
static const String EventSelectionChanged; //!< | //! Event triggered when there is a change to the currently selected it | |||
Event triggered when there is a change to the currently selected item(s). | em(s). | |||
static const String EventSortModeChanged; | static const String EventSelectionChanged; | |||
//!< Event triggered when the sort mode setting changes. | //! Event triggered when the sort mode setting changes. | |||
static const String EventMultiselectModeChanged; //!< Event t | static const String EventSortModeChanged; | |||
riggered when the multi-select mode setting changes. | //! Event triggered when the multi-select mode setting changes. | |||
static const String EventVertScrollbarModeChanged; //!< Event t | static const String EventMultiselectModeChanged; | |||
riggered when the vertical scroll bar 'force' setting changes. | //! Event triggered when the vertical scroll bar 'force' setting change | |||
static const String EventHorzScrollbarModeChanged; //!< Event t | s. | |||
riggered when the horizontal scroll bar 'force' setting changes. | static const String EventVertScrollbarModeChanged; | |||
static const String EventBranchOpened; //!< Event triggered | //! Event triggered when the horizontal scroll bar 'force' setting chan | |||
when a branch of the tree is opened by the user. | ges. | |||
static const String EventBranchClosed; //!< Event triggered | static const String EventHorzScrollbarModeChanged; | |||
when a branch of the tree is closed by the user. | //! Event triggered when a branch of the tree is opened by the user. | |||
static const String EventBranchOpened; | ||||
//! Event triggered when a branch of the tree is closed by the user. | ||||
static const String EventBranchClosed; | ||||
//Render the actual tree | //Render the actual tree | |||
void doTreeRender() { populateRenderCache(); } | void doTreeRender() | |||
//UpdateScrollbars | { populateGeometryBuffer(); } | |||
void doScrollbars() { configureScrollbars(); } | ||||
/******************************************************************* | ||||
****** | ||||
Accessor Methods | ||||
******************************************************************** | ||||
*****/ | ||||
/*! | ||||
\brief | ||||
Return number of items attached to the list box | ||||
\return | //UpdateScrollbars | |||
the number of items currently attached to this list box. | void doScrollbars() | |||
*/ | { configureScrollbars(); } | |||
size_t getItemCount(void) const {return d_listItems. | ||||
size();} | ||||
/*! | /********************************************************************** | |||
\brief | *** | |||
Return the number of selected items in the list box. | Accessor Methods | |||
********************************************************************** | ||||
***/ | ||||
/*! | ||||
\brief | ||||
Return number of items attached to the tree | ||||
\return | \return | |||
Total number of attached items that are in the selected stat | the number of items currently attached to this tree. | |||
e. | */ | |||
*/ | size_t getItemCount(void) const | |||
size_t getSelectedCount(void) const; | { return d_listItems.size(); } | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the first selected item. | Return the number of selected items in the tree. | |||
\return | \return | |||
Pointer to a TreeItem based object that is the first selecte | Total number of attached items that are in the selected state. | |||
d item in the list. will return NULL if | */ | |||
no item is selected. | size_t getSelectedCount(void) const; | |||
*/ | ||||
TreeItem* getFirstSelectedItem(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the first selected item. | Return a pointer to the first selected item. | |||
\return | \return | |||
Pointer to a TreeItem based object that is the last item sel | Pointer to a TreeItem based object that is the first selected item | |||
ected by the user, not necessarily the | in | |||
last selected in the list. Will return NULL if no item is selected. | the tree. will return 0 if no item is selected. | |||
*/ | */ | |||
TreeItem* getLastSelectedItem(void) const { return d_lastSelected; } | TreeItem* getFirstSelectedItem(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the next selected item after item \a sta | Return a pointer to the first selected item. | |||
rt_item | ||||
\param start_item | \return | |||
Pointer to the TreeItem where the search for the next select | Pointer to a TreeItem based object that is the last item selected b | |||
ed item is to begin. If this | y the | |||
parameter is NULL, the search will begin with the first item | user, not necessarily the last selected in the tree. Will return 0 | |||
in the list box. | if | |||
no item is selected. | ||||
*/ | ||||
TreeItem* getLastSelectedItem(void) const | ||||
{ return d_lastSelected; } | ||||
\return | /*! | |||
Pointer to a TreeItem based object that is the next selected | \brief | |||
item in the list after | Return a pointer to the next selected item after item \a start_item | |||
the item specified by \a start_item. Will return NULL if no | ||||
further items were selected. | ||||
\exception InvalidRequestException thrown if \a start_item is n | \param start_item | |||
ot attached to this list box. | Pointer to the TreeItem where the search for the next selected ite | |||
*/ | m is | |||
TreeItem* getNextSelected(const TreeItem* start_item) const; | to begin. If this parameter is 0, the search will begin with the | |||
first | ||||
item in the tree. | ||||
TreeItem* getNextSelectedItemFromList(const LBItemList &itemList, cons | \return | |||
t TreeItem* start_item, bool foundStartItem) const; | Pointer to a TreeItem based object that is the next selected item | |||
in | ||||
the tree after the item specified by \a start_item. Will return 0 | ||||
if | ||||
no further items were selected. | ||||
/*! | \exception InvalidRequestException thrown if \a start_item is n | |||
\brief | ot attached | |||
return whether list sorting is enabled | to this tree. | |||
*/ | ||||
TreeItem* getNextSelected(const TreeItem* start_item) const; | ||||
\return | TreeItem* getNextSelectedItemFromList(const LBItemList &itemList, | |||
true if the list is sorted, false if the list is not sorted | const TreeItem* start_item, | |||
*/ | bool& foundStartItem) const; | |||
bool isSortEnabled(void) const {return d_sorted;} | ||||
void setItemRenderArea(Rect& r) | /*! | |||
{ | \brief | |||
d_itemArea = r; | return whether tree sorting is enabled | |||
} | ||||
Scrollbar* getVertScrollbar() { return d_vertScrollbar; } | \return | |||
Scrollbar* getHorzScrollbar() { return d_horzScrollbar; } | - true if the tree is sorted | |||
- false if the tree is not sorted | ||||
*/ | ||||
bool isSortEnabled(void) const | ||||
{ return d_sorted; } | ||||
/*! | void setItemRenderArea(Rect& r) | |||
\brief | { d_itemArea = r; } | |||
return whether multi-select is enabled | ||||
\return | Scrollbar* getVertScrollbar() | |||
true if multi-select is enabled, false if multi-select is no | { return d_vertScrollbar; } | |||
t enabled. | ||||
*/ | ||||
bool isMultiselectEnabled(void) const {return d_multiselec | ||||
t;} | ||||
bool isItemTooltipsEnabled(void) const {return d_itemToolti | Scrollbar* getHorzScrollbar() | |||
ps;} | { return d_horzScrollbar; } | |||
/*! | /*! | |||
\brief | \brief | |||
Search the list for an item with the specified text | return whether multi-select is enabled | |||
\param text | \return | |||
String object containing the text to be searched for. | true if multi-select is enabled, false if multi-select is not enabl | |||
ed. | ||||
*/ | ||||
bool isMultiselectEnabled(void) const | ||||
{ return d_multiselect; } | ||||
\param start_item | bool isItemTooltipsEnabled(void) const | |||
TreeItem where the search is to begin, the search will not i | { return d_itemTooltips; } | |||
nclude \a item. If \a item is | ||||
NULL, the search will begin from the first item in the list. | ||||
\return | /*! | |||
Pointer to the first TreeItem in the list after \a item that | \brief | |||
has text matching \a text. If | Search the tree for an item with the specified text | |||
no item matches the criteria NULL is returned. | ||||
\exception InvalidRequestException thrown if \a item is not att | \param text | |||
ached to this list box. | String object containing the text to be searched for. | |||
*/ | ||||
TreeItem* findFirstItemWithText(const String& text); | ||||
TreeItem* findNextItemWithText(const String& text, const TreeI | ||||
tem* start_item); | ||||
TreeItem* findItemWithTextFromList(const LBItemList &itemList, const S | ||||
tring& text, const TreeItem* start_item, bool foundStartItem); | ||||
/*! | \param start_item | |||
\brief | TreeItem where the search is to begin, the search will not include | |||
Search the list for an item with the specified text | \a | |||
item. If \a item is 0, the search will begin from the first item i | ||||
n | ||||
the tree. | ||||
\param text | \return | |||
String object containing the text to be searched for. | Pointer to the first TreeItem in the tree after \a item that has te | |||
xt | ||||
matching \a text. If no item matches the criteria, 0 is returned. | ||||
\param start_item | \exception InvalidRequestException thrown if \a item is not att | |||
TreeItem where the search is to begin, the search will not i | ached to | |||
nclude \a item. If \a item is | this tree. | |||
NULL, the search will begin from the first item in the list. | */ | |||
TreeItem* findFirstItemWithText(const String& text); | ||||
\return | TreeItem* findNextItemWithText(const String& text, | |||
Pointer to the first TreeItem in the list after \a item that | const TreeItem* start_item); | |||
has text matching \a text. If | ||||
no item matches the criteria NULL is returned. | ||||
\exception InvalidRequestException thrown if \a item is not att | TreeItem* findItemWithTextFromList(const LBItemList &itemList, | |||
ached to this list box. | const String& text, | |||
*/ | const TreeItem* start_item, | |||
TreeItem* findFirstItemWithID(uint searchID); | bool foundStartItem); | |||
TreeItem* findNextItemWithID(uint searchID, const TreeItem* st | ||||
art_item); | ||||
TreeItem* findItemWithIDFromList(const LBItemList &itemList, uint sear | ||||
chID, const TreeItem* start_item, bool foundStartItem); | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether the specified TreeItem is in the List | Search the tree for an item with the specified text | |||
\return | \param text | |||
true if TreeItem \a item is in the list, false if TreeItem \ | String object containing the text to be searched for. | |||
a item is not in the list. | ||||
*/ | ||||
bool isTreeItemInList(const TreeItem* item) const; | ||||
/*! | \param start_item | |||
\brief | TreeItem where the search is to begin, the search will not include | |||
Return whether the vertical scroll bar is always shown. | \a item. If \a item is 0, the search will begin from the first ite | |||
m in | ||||
the tree. | ||||
\return | \return | |||
- true if the scroll bar will always be shown even if it is | Pointer to the first TreeItem in the tree after \a item that has te | |||
not required. | xt | |||
- false if the scroll bar will only be shown when it is requ | matching \a text. If no item matches the criteria 0 is returned. | |||
ired. | ||||
*/ | ||||
bool isVertScrollbarAlwaysShown(void) const; | ||||
/*! | \exception InvalidRequestException thrown if \a item is not att | |||
\brief | ached to | |||
Return whether the horizontal scroll bar is always shown. | this tree. | |||
*/ | ||||
TreeItem* findFirstItemWithID(uint searchID); | ||||
TreeItem* findNextItemWithID(uint searchID, const TreeItem* start_item) | ||||
; | ||||
TreeItem* findItemWithIDFromList(const LBItemList &itemList, uint searc | ||||
hID, | ||||
const TreeItem* start_item, | ||||
bool foundStartItem); | ||||
\return | /*! | |||
- true if the scroll bar will always be shown even if it is | \brief | |||
not required. | Return whether the specified TreeItem is in the tree | |||
- false if the scroll bar will only be shown when it is requ | ||||
ired. | ||||
*/ | ||||
bool isHorzScrollbarAlwaysShown(void) const; | ||||
/******************************************************************* | \return | |||
****** | - true if TreeItem \a item is in the tree | |||
Manipulator Methods | - false if TreeItem \a item is not in the tree. | |||
******************************************************************** | */ | |||
*****/ | bool isTreeItemInList(const TreeItem* item) const; | |||
/*! | ||||
\brief | ||||
Initialise the Window based object ready for use. | ||||
\note | /*! | |||
This must be called for every window created. Normally this | \brief | |||
is handled automatically by the WindowFactory for each Window type. | Return whether the vertical scroll bar is always shown. | |||
\return | \return | |||
Nothing | - true if the scroll bar will always be shown even if it is not re | |||
*/ | quired. | |||
virtual void initialise(void); | - false if the scroll bar will only be shown when it is required. | |||
*/ | ||||
bool isVertScrollbarAlwaysShown(void) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Remove all items from the list. | Return whether the horizontal scroll bar is always shown. | |||
Note that this will cause 'AutoDelete' items to be deleted. | \return | |||
*/ | - true if the scroll bar will always be shown even if it is not re | |||
void resetList(void); | quired. | |||
- false if the scroll bar will only be shown when it is required. | ||||
*/ | ||||
bool isHorzScrollbarAlwaysShown(void) const; | ||||
/*! | /********************************************************************** | |||
\brief | *** | |||
Add the given TreeItem to the list. | Manipulator Methods | |||
********************************************************************** | ||||
***/ | ||||
/*! | ||||
\brief | ||||
Initialise the Window based object ready for use. | ||||
\param item | \note | |||
Pointer to the TreeItem to be added to the list. Note that | This must be called for every window created. Normally this is han | |||
it is the passed object that is added to the | dled | |||
list, a copy is not made. If this parameter is NULL, nothin | automatically by the WindowFactory for each Window type. | |||
g happens. | ||||
\return | \return | |||
Nothing. | Nothing | |||
*/ | */ | |||
void addItem(TreeItem* item); | virtual void initialise(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Insert an item into the list box after a specified item alre | Remove all items from the tree. | |||
ady in the list. | ||||
Note that if the list is sorted, the item may not end up in | Note that this will cause 'AutoDelete' items to be deleted. | |||
the requested position. | */ | |||
void resetList(void); | ||||
\param item | /*! | |||
Pointer to the TreeItem to be inserted. Note that it is the | \brief | |||
passed object that is added to the | Add the given TreeItem to the tree. | |||
list, a copy is not made. If this parameter is NULL, nothin | ||||
g happens. | ||||
\param position | \param item | |||
Pointer to a TreeItem that \a item is to be inserted after. | Pointer to the TreeItem to be added to the tree. Note that it is | |||
If this parameter is NULL, the item is | the | |||
inserted at the start of the list. | passed object that is added to the tree, a copy is not made. If t | |||
his | ||||
parameter is NULL, nothing happens. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | ||||
void addItem(TreeItem* item); | ||||
\exception InvalidRequestException thrown if no TreeItem \a pos | /*! | |||
ition is attached to this list box. | \brief | |||
*/ | Insert an item into the tree after a specified item already in the | |||
void insertItem(TreeItem* item, const TreeItem* position); | tree. | |||
/*! | Note that if the tree is sorted, the item may not end up in the | |||
\brief | requested position. | |||
Removes the given item from the list box. If the item is ha | ||||
s the auto delete state set, the item will be deleted. | ||||
\param item | \param item | |||
Pointer to the TreeItem that is to be removed. If \a item i | Pointer to the TreeItem to be inserted. Note that it is the passe | |||
s not attached to this list box then nothing | d | |||
will happen. | object that is added to the tree, a copy is not made. If this | |||
parameter is 0, nothing happens. | ||||
\return | \param position | |||
Nothing. | Pointer to a TreeItem that \a item is to be inserted after. If th | |||
*/ | is | |||
void removeItem(const TreeItem* item); | parameter is 0, the item is inserted at the start of the tree. | |||
/*! | \return | |||
\brief | Nothing. | |||
Clear the selected state for all items. | ||||
\return | \exception InvalidRequestException thrown if no TreeItem \a pos | |||
Nothing. | ition is | |||
*/ | attached to this tree. | |||
void clearAllSelections(void); | */ | |||
bool clearAllSelectionsFromList(const LBItemList &itemList); | void insertItem(TreeItem* item, const TreeItem* position); | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether the list should be sorted. | Removes the given item from the tree. If the item is has the auto | |||
delete state set, the item will be deleted. | ||||
\param setting | \param item | |||
true if the list should be sorted, false if the list should | Pointer to the TreeItem that is to be removed. If \a item is not | |||
not be sorted. | attached to this tree then nothing will happen. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setSortingEnabled(bool setting); | void removeItem(const TreeItem* item); | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether the list should allow multiple selections or jus | Clear the selected state for all items. | |||
t a single selection | ||||
\param setting | \return | |||
true if the widget should allow multiple items to be selecte | Nothing. | |||
d, false if the widget should only allow | */ | |||
a single selection. | void clearAllSelections(void); | |||
bool clearAllSelectionsFromList(const LBItemList &itemList); | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the tree should be sorted. | |||
void setMultiselectEnabled(bool setting); | ||||
/*! | \param setting | |||
\brief | - true if the tree should be sorted | |||
Set whether the vertical scroll bar should always be shown. | - false if the tree should not be sorted. | |||
\param setting | \return | |||
true if the vertical scroll bar should be shown even when it | Nothing. | |||
is not required. false if the vertical | */ | |||
scroll bar should only be shown when it is required. | void setSortingEnabled(bool setting); | |||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the tree should allow multiple selections or just a sin | |||
void setShowVertScrollbar(bool setting); | gle | |||
selection. | ||||
/*! | \param setting | |||
\brief | - true if the widget should allow multiple items to be selected | |||
Set whether the horizontal scroll bar should always be shown | - false if the widget should only allow a single selection. | |||
. | ||||
\param setting | \return | |||
true if the horizontal scroll bar should be shown even when | Nothing. | |||
it is not required. false if the horizontal | */ | |||
scroll bar should only be shown when it is required. | void setMultiselectEnabled(bool setting); | |||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set whether the vertical scroll bar should always be shown. | |||
void setShowHorzScrollbar(bool setting); | ||||
void setItemTooltipsEnabled(bool setting); | \param setting | |||
/*! | - true if the vertical scroll bar should be shown even when it is | |||
\brief | not | |||
Set the select state of an attached TreeItem. | required. | |||
- false if the vertical scroll bar should only be shown when it is | ||||
required. | ||||
This is the recommended way of selecting and deselecting ite | \return | |||
ms attached to a list box as it respects the | Nothing. | |||
multi-select mode setting. It is possible to modify the set | */ | |||
ting on TreeItems directly, but that approach | void setShowVertScrollbar(bool setting); | |||
does not respect the settings of the list box. | ||||
\param item | /*! | |||
The TreeItem to be affected. This item must be attached to | \brief | |||
the list box. | Set whether the horizontal scroll bar should always be shown. | |||
\param state | \param setting | |||
true to select the item, false to de-select the item. | - true if the horizontal scroll bar should be shown even when it i | |||
s not | ||||
required. | ||||
- false if the horizontal scroll bar should only be shown when it | ||||
is | ||||
required. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | ||||
void setShowHorzScrollbar(bool setting); | ||||
\exception InvalidRequestException thrown if \a item is not att | void setItemTooltipsEnabled(bool setting); | |||
ached to this list box. | ||||
*/ | ||||
void setItemSelectState(TreeItem* item, bool state); | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the select state of an attached TreeItem. | Set the select state of an attached TreeItem. | |||
This is the recommended way of selecting and deselecting ite | This is the recommended way of selecting and deselecting items atta | |||
ms attached to a list box as it respects the | ched | |||
multi-select mode setting. It is possible to modify the set | to a tree as it respects the multi-select mode setting. It is | |||
ting on TreeItems directly, but that approach | possible to modify the setting on TreeItems directly, but that appr | |||
does not respect the settings of the list box. | oach | |||
does not respect the settings of the tree. | ||||
\param item_index | \param item | |||
The zero based index of the TreeItem to be affected. This m | The TreeItem to be affected. | |||
ust be a valid index (0 <= index < getItemCount()) | This item must be attached to the tree. | |||
\param state | \param state | |||
true to select the item, false to de-select the item. | - true to select the item. | |||
- false to de-select the item. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
\exception InvalidRequestException thrown if \a item_index is o | \exception InvalidRequestException thrown if \a item is not att | |||
ut of range for the list box | ached to | |||
*/ | this tree. | |||
void setItemSelectState(size_t item_index, bool state); | */ | |||
void setItemSelectState(TreeItem* item, bool state); | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the select state of an attached TreeItem. | ||||
This is the recommended way of selecting and deselecting items atta | ||||
ched | ||||
to a tree as it respects the multi-select mode setting. It is | ||||
possible to modify the setting on TreeItems directly, but that appr | ||||
oach | ||||
does not respect the settings of the tree. | ||||
\param item_index | ||||
The zero based index of the TreeItem to be affected. | ||||
This must be a valid index (0 <= index < getItemCount()) | ||||
\param state | ||||
- true to select the item. | ||||
- false to de-select the item. | ||||
\return | ||||
Nothing. | ||||
\exception InvalidRequestException thrown if \a item_index is o | ||||
ut of range | ||||
for the tree | ||||
*/ | ||||
void setItemSelectState(size_t item_index, bool state); | ||||
/*! | ||||
\brief | ||||
Set the LookNFeel that shoule be used for this window. | Set the LookNFeel that shoule be used for this window. | |||
\param look | \param look | |||
String object holding the name of the look to be assigned to the wi ndow. | String object holding the name of the look to be assigned to the wi ndow. | |||
\return | \return | |||
Nothing. | Nothing. | |||
\exception UnknownObjectException | \exception UnknownObjectException | |||
thrown if the look'n'feel specified by \a look does not exist. | thrown if the look'n'feel specified by \a look does not exist. | |||
\note | \note | |||
Once a look'n'feel has been assigned it is locked - as in cannot be | Once a look'n'feel has been assigned it is locked - as in cannot be | |||
changed. | changed. | |||
*/ | */ | |||
virtual void setLookNFeel(const String& look); | virtual void setLookNFeel(const String& look); | |||
/*! | /*! | |||
\brief | \brief | |||
Causes the list box to update it's internal state after chan | Causes the tree to update it's internal state after changes have | |||
ges have been made to one or more | been made to one or more attached TreeItem objects. | |||
attached TreeItem objects. | ||||
Client code must call this whenever it has made any changes | Client code must call this whenever it has made any changes to Tree | |||
to TreeItem objects already attached to the | Item | |||
list box. If you are just adding items, or removed items to | objects already attached to the tree. If you are just adding items | |||
update them prior to re-adding them, there is | , | |||
no need to call this method. | or removed items to update them prior to re-adding them, there is n | |||
o | ||||
need to call this method. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void handleUpdatedItemData(void); | void handleUpdatedItemData(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Ensure the item at the specified index is visible within the | Ensure the item at the specified index is visible within the tree. | |||
list box. | ||||
\param item | \param item | |||
Pointer to the TreeItem to be made visible in the list box. | Pointer to the TreeItem to be made visible in the tree. | |||
\return | \return | |||
Nothing. | Nothing. | |||
\exception InvalidRequestException thrown if \a item is not att | \exception InvalidRequestException thrown if \a item is not att | |||
ached to this list box. | ached to | |||
*/ | this tree. | |||
void ensureItemIsVisible(const TreeItem* item); | */ | |||
void ensureItemIsVisible(const TreeItem* item); | ||||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Constructor for Tree base class. | Constructor for Tree base class. | |||
*/ | */ | |||
Tree(const String& type, const String& name); | Tree(const String& type, const String& name); | |||
/*! | /*! | |||
\brief | \brief | |||
Destructor for Tree base class. | Destructor for Tree base class. | |||
*/ | */ | |||
virtual ~Tree(void); | virtual ~Tree(void); | |||
protected: | protected: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Abstract Implementation Functions (must be provided by deriv | Abstract Implementation Functions (must be provided by derived clas | |||
ed class) | s) | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return a Rect object describing, in un-clipped pixels, the w | Return a Rect object describing, in un-clipped pixels, the window | |||
indow relative area | relative area that is to be used for rendering tree items. | |||
that is to be used for rendering list items. | ||||
\return | \return | |||
Rect object describing the area of the Window to be used for | Rect object describing the area of the Window to be used for render | |||
rendering | ing | |||
list box items. | tree items. | |||
*/ | */ | |||
virtual Rect getTreeRenderArea(void) const | virtual Rect getTreeRenderArea(void) const | |||
{ | { return d_itemArea; } | |||
return d_itemArea; | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
create and return a pointer to a Scrollbar widget for use as | create and return a pointer to a Scrollbar widget for use as vertic | |||
vertical scroll bar | al | |||
scroll bar. | ||||
\param name | \param name | |||
String holding the name to be given to the created widget compone | String holding the name to be given to the created widget component | |||
nt. | . | |||
\return | \return | |||
Pointer to a Scrollbar to be used for scrolling the list ver | Pointer to a Scrollbar to be used for scrolling the tree vertically | |||
tically. | . | |||
*/ | */ | |||
virtual Scrollbar* createVertScrollbar(const String& name) cons | virtual Scrollbar* createVertScrollbar(const String& name) const | |||
t | { return (Scrollbar*)(WindowManager::getSingleton().getWindow(name) | |||
{ | ); } | |||
return (Scrollbar*)(WindowManager::getSingleton().getWindow( | ||||
name)); | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
create and return a pointer to a Scrollbar widget for use as | create and return a pointer to a Scrollbar widget for use as horizo | |||
horizontal scroll bar | ntal | |||
scroll bar. | ||||
\param name | \param name | |||
String holding the name to be given to the created widget compone | String holding the name to be given to the created widget component | |||
nt. | . | |||
\return | \return | |||
Pointer to a Scrollbar to be used for scrolling the list hor | Pointer to a Scrollbar to be used for scrolling the tree horizontal | |||
izontally. | ly. | |||
*/ | */ | |||
virtual Scrollbar* createHorzScrollbar(const String& name) cons | virtual Scrollbar* createHorzScrollbar(const String& name) const | |||
t | { return (Scrollbar*)(WindowManager::getSingleton().getWindow(name) | |||
{ | ); } | |||
return (Scrollbar*)(WindowManager::getSingleton().getWindow( | ||||
name)); | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
Perform caching of the widget control frame and other 'stati | Perform caching of the widget control frame and other 'static' are | |||
c' areas. This | as. | |||
method should not render the actual items. Note that the it | This method should not render the actual items. Note that the ite | |||
ems are typically | ms | |||
rendered to layer 3, other layers can be used for rendering | are typically rendered to layer 3, other layers can be used for | |||
imagery behind and | rendering imagery behind and infront of the items. | |||
infront of the items. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
virtual void cacheTreeBaseImagery() | virtual void cacheTreeBaseImagery() | |||
{ | {} | |||
} | /********************************************************************** | |||
*** | ||||
Implementation Functions | ||||
********************************************************************** | ||||
***/ | ||||
/*! | ||||
\brief | ||||
Checks if a tree item is visible (searches sub-items) | ||||
*/ | ||||
bool containsOpenItemRecursive(const LBItemList& itemList, TreeItem* it | ||||
em); | ||||
/******************************************************************* | /*! | |||
****** | \brief | |||
Implementation Functions | Add tree specific events | |||
******************************************************************** | */ | |||
*****/ | void addTreeEvents(void); | |||
/*! | ||||
\brief | ||||
Add list box specific events | ||||
*/ | ||||
void addTreeEvents(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
display required integrated scroll bars according to current | display required integrated scroll bars according to current state | |||
state of the list box and update their values. | of | |||
*/ | the tree and update their values. | |||
void configureScrollbars(void); | */ | |||
void configureScrollbars(void); | ||||
/*! | /*! | |||
\brief | \brief | |||
select all strings between positions \a start and \a end. ( | select all strings between positions \a start and \a end. (inclusi | |||
inclusive) | ve) | |||
including \a end. | including \a end. | |||
*/ | */ | |||
void selectRange(size_t start, size_t end); | void selectRange(size_t start, size_t end); | |||
/*! | /*! | |||
\brief | \brief | |||
Return the sum of all item heights | Return the sum of all item heights | |||
*/ | */ | |||
float getTotalItemsHeight(void) const; | float getTotalItemsHeight(void) const; | |||
void getTotalItemsInListHeight(const LBItemList &itemList, float *heigh | void getTotalItemsInListHeight(const LBItemList &itemList, | |||
tSum) const; | float *heightSum) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the width of the widest item | Return the width of the widest item | |||
*/ | */ | |||
float getWidestItemWidth(void) const; | float getWidestItemWidth(void) const; | |||
void getWidestItemWidthInList(const LBItemList &itemList, int itemDepth | void getWidestItemWidthInList(const LBItemList &itemList, int itemDepth | |||
, float *widest) const; | , | |||
float *widest) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Clear the selected state for all items (implementation) | Clear the selected state for all items (implementation) | |||
\return | \return | |||
true if treeItem was found in the search, false if it was no | - true if treeItem was found in the search. | |||
t. | - false if it was not. | |||
*/ | */ | |||
bool getHeightToItemInList(const LBItemList &itemList, const TreeItem *t | bool getHeightToItemInList(const LBItemList &itemList, | |||
reeItem, int itemDepth, float *height) const; | const TreeItem *treeItem, | |||
int itemDepth, | ||||
float *height) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Clear the selected state for all items (implementation) | Clear the selected state for all items (implementation) | |||
\return | \return | |||
true if some selections were cleared, false nothing was chan | - true if some selections were cleared | |||
ged. | - false nothing was changed. | |||
*/ | */ | |||
bool clearAllSelections_impl(void); | bool clearAllSelections_impl(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Return the TreeItem under the given window local pixel co-or | Return the TreeItem under the given window local pixel co-ordinate. | |||
dinate. | ||||
\return | \return | |||
TreeItem that is under window pixel co-ordinate \a pt, or NU | TreeItem that is under window pixel co-ordinate \a pt, or 0 if no | |||
LL if no | item is under that position. | |||
item is under that position. | */ | |||
*/ | TreeItem* getItemAtPoint(const Point& pt) const; | |||
TreeItem* getItemAtPoint(const Point& pt) const; | TreeItem* getItemFromListAtPoint(const LBItemList &itemList, float *bot | |||
TreeItem* getItemFromListAtPoint(const LBItemList &itemList, float *bo | tomY, | |||
ttomY, const Point& pt) const; | const Point& pt) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Remove all items from the list. | Remove all items from the tree. | |||
\note | \note | |||
Note that this will cause 'AutoDelete' items to be deleted. | Note that this will cause 'AutoDelete' items to be deleted. | |||
\return | \return | |||
- true if the list contents were changed. | - true if the tree contents were changed. | |||
- false if the list contents were not changed (list already | - false if the tree contents were not changed (tree already empty) | |||
empty). | . | |||
*/ | */ | |||
bool resetList_impl(void); | bool resetList_impl(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the given clas | Return whether this window was inherited from the given class name | |||
s name at some point in the inheritance heirarchy. | at | |||
some point in the inheritance heirarchy. | ||||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name. false | true if this window was inherited from \a class_name. false if not. | |||
if not. | */ | |||
*/ | virtual bool testClassName_impl(const String& class_name) const | |||
virtual bool testClassName_impl(const String& class_name) const | { | |||
{ | if (class_name==(const utf8*)"Tree") | |||
if (class_name==(const utf8*)"Tree") return true; | return true; | |||
return Window::testClassName_impl(class_name); | ||||
} | ||||
/*! | return Window::testClassName_impl(class_name); | |||
\brief | } | |||
Internal handler that is triggered when the user interacts with t | ||||
he scrollbars. | /*! | |||
*/ | \brief | |||
Internal handler that is triggered when the user interacts with the | ||||
scrollbars. | ||||
*/ | ||||
bool handle_scrollChange(const EventArgs& args); | bool handle_scrollChange(const EventArgs& args); | |||
// overridden from Window base class. | // overridden from Window base class. | |||
virtual void populateRenderCache(); | virtual void populateGeometryBuffer(); | |||
void drawItemList(LBItemList &itemList, Rect &itemsArea, float widest, | void drawItemList(LBItemList& itemList, Rect& itemsArea, float widest, | |||
Vector3 &itemPos, RenderCache& cache, float alpha); | Vector2& itemPos, GeometryBuffer& geometry, float al | |||
pha); | ||||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
New event handlers | New event handlers | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the list contents are changed | Handler called internally when the tree contents are changed | |||
*/ | */ | |||
virtual void onListContentsChanged(WindowEventArgs& e); | virtual void onListContentsChanged(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the currently selected item o | Handler called internally when the currently selected item or items | |||
r items changes. | changes. | |||
*/ | */ | |||
virtual void onSelectionChanged(TreeEventArgs& e); | virtual void onSelectionChanged(TreeEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the sort mode setting changes | Handler called internally when the sort mode setting changes. | |||
. | */ | |||
*/ | virtual void onSortModeChanged(WindowEventArgs& e); | |||
virtual void onSortModeChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the multi-select mode setting | Handler called internally when the multi-select mode setting change | |||
changes. | s. | |||
*/ | */ | |||
virtual void onMultiselectModeChanged(WindowEventArgs& e); | virtual void onMultiselectModeChanged(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the forced display of the ver | Handler called internally when the forced display of the vertical s | |||
tical scroll bar setting changes. | croll | |||
*/ | bar setting changes. | |||
virtual void onVertScrollbarModeChanged(WindowEventArgs& e); | */ | |||
virtual void onVertScrollbarModeChanged(WindowEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the forced display of the hor | Handler called internally when the forced display of the horizontal | |||
izontal scroll bar setting changes. | scroll bar setting changes. | |||
*/ | */ | |||
virtual void onHorzScrollbarModeChanged(WindowEventArgs& e); | virtual void onHorzScrollbarModeChanged(WindowEventArgs& e); | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the user opens a branch of th | Handler called internally when the user opens a branch of the tree. | |||
e tree. | */ | |||
*/ | virtual void onBranchOpened(TreeEventArgs& e); | |||
virtual void onBranchOpened(TreeEventArgs& e); | ||||
/*! | /*! | |||
\brief | \brief | |||
Handler called internally when the user closes a branch of t | Handler called internally when the user closes a branch of the tree | |||
he tree. | . | |||
*/ | */ | |||
virtual void onBranchClosed(TreeEventArgs& e); | virtual void onBranchClosed(TreeEventArgs& e); | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Overridden Event handlers | Overridden Event handlers | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
virtual void onSized(WindowEventArgs& e); | virtual void onSized(WindowEventArgs& e); | |||
virtual void onMouseButtonDown(MouseEventArgs& e); | virtual void onMouseButtonDown(MouseEventArgs& e); | |||
virtual void onMouseWheel(MouseEventArgs& e); | virtual void onMouseWheel(MouseEventArgs& e); | |||
virtual void onMouseMove(MouseEventArgs& e); | virtual void onMouseMove(MouseEventArgs& e); | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Implementation Data | Implementation Data | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
bool d_sorted; //!< true if list | //! true if tree is sorted | |||
is sorted | bool d_sorted; | |||
bool d_multiselect; //!< true if multi-select | //! true if multi-select is enabled | |||
is enabled | bool d_multiselect; | |||
bool d_forceVertScroll; //!< true if vertical scroll | //! true if vertical scrollbar should always be displayed | |||
bar should always be displayed | bool d_forceVertScroll; | |||
bool d_forceHorzScroll; //!< true if horizontal scro | //! true if horizontal scrollbar should always be displayed | |||
llbar should always be displayed | bool d_forceHorzScroll; | |||
bool d_itemTooltips; //!< true if each item shoul | //! true if each item should have an individual tooltip | |||
d have an individual tooltip | bool d_itemTooltips; | |||
Scrollbar* d_vertScrollbar; //!< vertical scroll-bar wid | //! vertical scroll-bar widget | |||
get | Scrollbar* d_vertScrollbar; | |||
Scrollbar* d_horzScrollbar; //!< horizontal scroll-bar w | //! horizontal scroll-bar widget | |||
idget | Scrollbar* d_horzScrollbar; | |||
LBItemList d_listItems; //!< list of items in the li | //! list of items in the tree. | |||
st box. | LBItemList d_listItems; | |||
TreeItem* d_lastSelected; //!< holds pointer to the last selec | //! holds pointer to the last selected item (used in range selections) | |||
ted item (used in range selections) | TreeItem* d_lastSelected; | |||
ImagerySection *openButtonImagery; | ImagerySection* d_openButtonImagery; | |||
ImagerySection *closeButtonImagery; | ImagerySection* d_closeButtonImagery; | |||
private: | private: | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Static Properties for this class | Static Properties for this class | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
static TreeProperties::Sort d_so | static TreeProperties::Sort d_so | |||
rtProperty; | rtProperty; | |||
static TreeProperties::MultiSelect d_multiSelec | static TreeProperties::MultiSelect d_multiSelectPropert | |||
tProperty; | y; | |||
static TreeProperties::ForceVertScrollbar d_forceVertProperty; | static TreeProperties::ForceVertScrollbar d_forceVertProperty; | |||
static TreeProperties::ForceHorzScrollbar d_forceHorzProperty; | static TreeProperties::ForceHorzScrollbar d_forceHorzProperty; | |||
static TreeProperties::ItemTooltips d_itemToolti | static TreeProperties::ItemTooltips d_itemToolti | |||
psProperty; | psProperty; | |||
/******************************************************************* | /********************************************************************** | |||
****** | *** | |||
Private methods | Private methods | |||
******************************************************************** | ********************************************************************** | |||
*****/ | ***/ | |||
void addTreeProperties(void); | void addTreeProperties(void); | |||
Rect d_itemArea; | Rect d_itemArea; | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Helper function used in sorting to compare two list box item text st | Helper function used in sorting to compare two tree item text strings | |||
rings | via the TreeItem pointers and return if \a a is less than \a b. | |||
via the TreeItem pointers and return if \a a is less than \a b. | */ | |||
*/ | ||||
bool lbi_less(const TreeItem* a, const TreeItem* b); | bool lbi_less(const TreeItem* a, const TreeItem* b); | |||
/*! | /*! | |||
\brief | \brief | |||
Helper function used in sorting to compare two list box item text st | Helper function used in sorting to compare two tree item text strings | |||
rings | via the TreeItem pointers and return if \a a is greater than \a b. | |||
via the TreeItem pointers and return if \a a is greater than \a b. | */ | |||
*/ | ||||
bool lbi_greater(const TreeItem* a, const TreeItem* b); | bool lbi_greater(const TreeItem* a, const TreeItem* b); | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUITree_h_ | #endif // end of guard _CEGUITree_h_ | |||
End of changes. 149 change blocks. | ||||
722 lines changed or deleted | 772 lines changed or added | |||
CEGUITreeItem.h | CEGUITreeItem.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUITreeItem.h | filename: CEGUITreeItem.h | |||
created: 5-13-07 | created: 5-13-07 | |||
author: Jonathan Welch (Based on Code by David Durant) | author: Jonathan Welch (Based on Code by David Durant) | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
* included in all copies or substantial portions of the Software. | * included in all copies or substantial portions of the Software. | |||
* | * | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
*************************************************************************** | ************************************************************************** | |||
/ | */ | |||
#ifndef _CEGUITreeItem_h_ | #ifndef _CEGUITreeItem_h_ | |||
#define _CEGUITreeItem_h_ | #define _CEGUITreeItem_h_ | |||
#include "CEGUIBase.h" | #include "../CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "../CEGUIString.h" | |||
#include "CEGUIColourRect.h" | #include "../CEGUIColourRect.h" | |||
#include "CEGUIRenderCache.h" | #include "../CEGUIBasicRenderedStringParser.h" | |||
#if defined(_MSC_VER) | ||||
# pragma warning(push) | ||||
# pragma warning(disable : 4251) | ||||
#endif | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Base class for list box items | Base class for tree items | |||
*/ | ||||
\deprecated | ||||
The CEGUI::Tree, CEGUI::TreeItem and any other associated classes are | ||||
deprecated and thier use should be minimised - preferably eliminated - | ||||
where possible. It is extremely unfortunate that this widget was ever | ||||
added | ||||
to CEGUI since its design and implementation are poor and do not meet | ||||
established standards for the CEGUI project. | ||||
\par | ||||
While no alternative currently exists, a superior, replacement tree wid | ||||
get | ||||
will be provided prior to the final removal of the current implementati | ||||
on. | ||||
*/ | ||||
class CEGUIEXPORT TreeItem | class CEGUIEXPORT TreeItem | |||
{ | { | |||
public: | public: | |||
typedef std::vector<TreeItem*> LBItemList; | typedef std::vector<TreeItem*> LBItemList; | |||
/*********************************************************************** | /********************************************************************** | |||
** | *** | |||
Constants | Constants | |||
************************************************************************ | ********************************************************************** | |||
*/ | ***/ | |||
static const colour DefaultTextColour; //!< Default text colour | //! Default text colour. | |||
. | static const colour DefaultTextColour; | |||
static const colour DefaultSelectionColour; //!< Default selection b | //! Default selection brush colour. | |||
rush colour. | static const colour DefaultSelectionColour; | |||
/*********************************************************************** | /********************************************************************** | |||
** | *** | |||
Construction and Destruction | Construction and Destruction | |||
************************************************************************ | ********************************************************************** | |||
*/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
base class constructor | base class constructor | |||
*/ | */ | |||
TreeItem(const String& text, uint item_id = 0, void* item_data = 0, bool | TreeItem(const String& text, uint item_id = 0, void* item_data = 0, | |||
disabled = false, bool auto_delete = true); | bool disabled = false, bool auto_delete = true); | |||
/*! | /*! | |||
\brief | \brief | |||
base class destructor | base class destructor | |||
*/ | */ | |||
virtual ~TreeItem(void) {} | virtual ~TreeItem(void) {} | |||
/*********************************************************************** | /********************************************************************** | |||
** | *** | |||
Accessors | Accessors | |||
************************************************************************ | ********************************************************************** | |||
*/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the font being used by this ListboxTextItem | Return a pointer to the font being used by this TreeItem | |||
This method will try a number of places to find a font to be used. I | This method will try a number of places to find a font to be used. | |||
f no font can be | If | |||
found, NULL is returned. | no font can be found, NULL is returned. | |||
\return | \return | |||
Font to be used for rendering this item | Font to be used for rendering this item | |||
*/ | */ | |||
Font* getFont(void) const; | Font* getFont(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return the current colours used for text rendering. | Return the current colours used for text rendering. | |||
\return | \return | |||
ColourRect object describing the currently set colours | ColourRect object describing the currently set colours | |||
*/ | */ | |||
ColourRect getTextColours(void) const {return d_textCols;} | ColourRect getTextColours(void) const | |||
{ return d_textCols; } | ||||
/*********************************************************************** | /********************************************************************** | |||
** | *** | |||
Manipulator methods | Manipulator methods | |||
************************************************************************ | ********************************************************************** | |||
*/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Set the font to be used by this ListboxTextItem | Set the font to be used by this TreeItem | |||
\param font | \param font | |||
Font to be used for rendering this item | Font to be used for rendering this item | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setFont(Font* font) {d_font = font;} | void setFont(Font* font); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the font to be used by this ListboxTextItem | Set the font to be used by this TreeItem | |||
\param font_name | \param font_name | |||
String object containing the name of the Font to be used for renderin | String object containing the name of the Font to be used for render | |||
g this item | ing | |||
this item | ||||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setFont(const String& font_name); | void setFont(const String& font_name); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the colours used for text rendering. | Set the colours used for text rendering. | |||
\param cols | \param cols | |||
ColourRect object describing the colours to be used. | ColourRect object describing the colours to be used. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setTextColours(const ColourRect& cols) {d_textCols = cols;} | void setTextColours(const ColourRect& cols) | |||
{ d_textCols = cols; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the colours used for text rendering. | Set the colours used for text rendering. | |||
\param top_left_colour | \param top_left_colour | |||
Colour (as ARGB value) to be applied to the top-left corner of each t | Colour (as ARGB value) to be applied to the top-left corner of each | |||
ext glyph rendered. | text | |||
glyph rendered. | ||||
\param top_right_colour | \param top_right_colour | |||
Colour (as ARGB value) to be applied to the top-right corner of each | Colour (as ARGB value) to be applied to the top-right corner of eac | |||
text glyph rendered. | h | |||
text glyph rendered. | ||||
\param bottom_left_colour | \param bottom_left_colour | |||
Colour (as ARGB value) to be applied to the bottom-left corner of eac | Colour (as ARGB value) to be applied to the bottom-left corner of e | |||
h text glyph rendered. | ach | |||
text glyph rendered. | ||||
\param bottom_right_colour | \param bottom_right_colour | |||
Colour (as ARGB value) to be applied to the bottom-right corner of ea | Colour (as ARGB value) to be applied to the bottom-right corner of | |||
ch text glyph rendered. | each | |||
text glyph rendered. | ||||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setTextColours(colour top_left_colour, colour top_right_colour, co | void setTextColours(colour top_left_colour, colour top_right_colour, | |||
lour bottom_left_colour, colour bottom_right_colour); | colour bottom_left_colour, colour bottom_right_colo | |||
ur); | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the colours used for text rendering. | Set the colours used for text rendering. | |||
\param col | \param col | |||
colour value to be used when rendering. | colour value to be used when rendering. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setTextColours(colour col) {setTextColours(col, col, col, col); | void setTextColours(colour col) | |||
} | { setTextColours(col, col, col, col); } | |||
/*! | /*! | |||
\brief | \brief | |||
return the text string set for this list box item. | return the text string set for this tree item. | |||
Note that even if the item does not render text, the text string can | Note that even if the item does not render text, the text string ca | |||
still be useful, since it | n | |||
is used for sorting list box items. | still be useful, since it is used for sorting tree items. | |||
\return | \return | |||
String object containing the current text for the list box item. | String object containing the current text for the tree item. | |||
*/ | */ | |||
const String& getText(void) const {return d_itemText;} | const String& getText() const {return d_textLogical;} | |||
const String& getTooltipText(void) const {return d_tooltipText;} | ||||
/*! | //! return text string with \e visual ordering of glyphs. | |||
\brief | const String& getTextVisual() const; | |||
Return the current ID assigned to this list box item. | ||||
Note that the system does not make use of this value, client code can | /*! | |||
assign any meaning it | \brief | |||
wishes to the ID. | Return the text string currently set to be used as the tooltip text | |||
for | ||||
this item. | ||||
\return | \return | |||
ID code currently assigned to this list box item | String object containing the current tooltip text as sued by this i | |||
*/ | tem. | |||
uint getID(void) const {return d_itemID;} | */ | |||
const String& getTooltipText(void) const | ||||
{ return d_tooltipText; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the pointer to any client assigned user data attached to this | Return the current ID assigned to this tree item. | |||
lis box item. | ||||
Note that the system does not make use of this data, client code can | Note that the system does not make use of this value, client code c | |||
assign any meaning it | an | |||
wishes to the attached data. | assign any meaning it wishes to the ID. | |||
\return | \return | |||
Pointer to the currently assigned user data. | ID code currently assigned to this tree item | |||
*/ | */ | |||
void* getUserData(void) const {return d_itemData;} | uint getID(void) const | |||
{ return d_itemID; } | ||||
/*! | /*! | |||
\brief | \brief | |||
return whether this item is selected. | Return the pointer to any client assigned user data attached to thi | |||
s | ||||
tree item. | ||||
\return | Note that the system does not make use of this data, client code ca | |||
true if the item is selected, false if the item is not selected. | n | |||
*/ | assign any meaning it wishes to the attached data. | |||
bool isSelected(void) const {return d_selected;} | ||||
/*! | \return | |||
\brief | Pointer to the currently assigned user data. | |||
return whether this item is disabled. | */ | |||
void* getUserData(void) const | ||||
{ return d_itemData; } | ||||
\return | /*! | |||
true if the item is disabled, false if the item is enabled. | \brief | |||
*/ | return whether this item is selected. | |||
bool isDisabled(void) const {return d_disabled;} | ||||
/*! | \return | |||
\brief | - true if the item is selected. | |||
return whether this item will be automatically deleted when the list | - false if the item is not selected. | |||
box it is attached to | */ | |||
is destroyed, or when the item is removed from the list box. | bool isSelected(void) const | |||
{ return d_selected; } | ||||
\return | /*! | |||
true if the item object will be deleted by the system when the list b | \brief | |||
ox it is attached to is | return whether this item is disabled. | |||
destroyed, or when the item is removed from the list. false if clien | ||||
t code must destroy the | ||||
item after it is removed from the list. | ||||
*/ | ||||
bool isAutoDeleted(void) const {return d_autoDelete;} | ||||
/*! | \return | |||
\brief | - true if the item is disabled. | |||
Get the owner window for this TreeItem. | - false if the item is enabled. | |||
*/ | ||||
bool isDisabled(void) const | ||||
{ return d_disabled; } | ||||
The owner of a TreeItem is typically set by the list box widgets when | /*! | |||
an item is added or inserted. | \brief | |||
return whether this item will be automatically deleted when it is | ||||
removed from the tree or when the the tree it is attached to is | ||||
destroyed. | ||||
\return | \return | |||
Ponter to the window that is considered the owner of this TreeItem. | - true if the item object will be deleted by the system when it is | |||
*/ | removed from the tree, or when the tree it is attached to is | |||
// const Window* getOwnerWindow(const Window* owner) {return d_owner; | destroyed. | |||
} | - false if client code must destroy the item after it is removed fr | |||
const Window* getOwnerWindow(void) {return d_owner;} | om | |||
the tree. | ||||
*/ | ||||
bool isAutoDeleted(void) const | ||||
{ return d_autoDelete; } | ||||
/*! | /*! | |||
\brief | \brief | |||
Return the current colours used for selection highlighting. | Get the owner window for this TreeItem. | |||
\return | The owner of a TreeItem is typically set by the tree widget when an | |||
ColourRect object describing the currently set colours | item is added or inserted. | |||
*/ | ||||
ColourRect getSelectionColours(void) const {return d_selectCols;} | ||||
/*! | \return | |||
\brief | Ponter to the window that is considered the owner of this TreeItem. | |||
Return the current selection highlighting brush. | */ | |||
const Window* getOwnerWindow(void) | ||||
{ return d_owner; } | ||||
\return | /*! | |||
Pointer to the Image object currently used for selection highlighting | \brief | |||
. | Return the current colours used for selection highlighting. | |||
*/ | ||||
const Image* getSelectionBrushImage(void) const {return d_selectBr | ||||
ush;} | ||||
/*********************************************************************** | \return | |||
** | ColourRect object describing the currently set colours. | |||
Manipulators | */ | |||
************************************************************************ | ColourRect getSelectionColours(void) const | |||
*/ | { return d_selectCols; } | |||
/*! | ||||
\brief | ||||
set the text string for this list box item. | ||||
Note that even if the item does not render text, the text string can | /*! | |||
still be useful, since it | \brief | |||
is used for sorting list box items. | Return the current selection highlighting brush. | |||
\param text | \return | |||
String object containing the text to set for the list box item. | Pointer to the Image object currently used for selection highlighti | |||
ng. | ||||
*/ | ||||
const Image* getSelectionBrushImage(void) const | ||||
{ return d_selectBrush; } | ||||
\return | /********************************************************************** | |||
Nothing. | *** | |||
*/ | Manipulators | |||
void setText(const String& text) {d_itemText = text;} | ********************************************************************** | |||
***/ | ||||
/*! | ||||
\brief | ||||
set the text string for this tree item. | ||||
void setTooltipText(const String& text) {d_tooltipText = text;} | Note that even if the item does not render text, the text string ca | |||
n | ||||
still be useful, since it is used for sorting tree items. | ||||
/*! | \param text | |||
\brief | String object containing the text to set for the tree item. | |||
Set the ID assigned to this list box item. | ||||
Note that the system does not make use of this value, client code can | \return | |||
assign any meaning it | Nothing. | |||
wishes to the ID. | */ | |||
void setText(const String& text); | ||||
\param item_id | /*! | |||
ID code to be assigned to this list box item | \brief | |||
Set the tooltip text to be used for this item. | ||||
\return | \param text | |||
Nothing. | String object holding the text to be used in the tooltip displayed | |||
*/ | for | |||
void setID(uint item_id) {d_itemID = item_id;} | this item. | |||
/*! | \return | |||
\brief | Nothing. | |||
Set the client assigned user data attached to this lis box item. | */ | |||
void setTooltipText(const String& text) | ||||
{ d_tooltipText = text; } | ||||
Note that the system does not make use of this data, client code can | /*! | |||
assign any meaning it | \brief | |||
wishes to the attached data. | Set the ID assigned to this tree item. | |||
\param item_data | Note that the system does not make use of this value, client code c | |||
Pointer to the user data to attach to this list item. | an | |||
assign any meaning it wishes to the ID. | ||||
\return | \param item_id | |||
Nothing. | ID code to be assigned to this tree item | |||
*/ | ||||
void setUserData(void* item_data) {d_itemData = item_data;} | ||||
/*! | \return | |||
\brief | Nothing. | |||
set whether this item is selected. | */ | |||
void setID(uint item_id) | ||||
{ d_itemID = item_id; } | ||||
\param setting | /*! | |||
true if the item is selected, false if the item is not selected. | \brief | |||
Set the client assigned user data attached to this lis box item. | ||||
\return | Note that the system does not make use of this data, client code c | |||
Nothing. | an | |||
*/ | assign any meaning it wishes to the attached data. | |||
void setSelected(bool setting) {d_selected = setting;} | ||||
/*! | \param item_data | |||
\brief | Pointer to the user data to attach to this tree item. | |||
set whether this item is disabled. | ||||
\param setting | \return | |||
true if the item is disabled, false if the item is enabled. | Nothing. | |||
*/ | ||||
void setUserData(void* item_data) | ||||
{ d_itemData = item_data; } | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the selected state for the item. | |||
void setDisabled(bool setting) {d_disabled = setting;} | ||||
/*! | \param setting | |||
\brief | - true if the item is selected. | |||
Set whether this item will be automatically deleted when the list box | - false if the item is not selected. | |||
it is attached to | ||||
is destroyed, or when the item is removed from the list box. | ||||
\param setting | \return | |||
true if the item object should be deleted by the system when the list | Nothing. | |||
box it is attached to is | */ | |||
destroyed, or when the item is removed from the list. false if clien | void setSelected(bool setting) | |||
t code will destroy the | { d_selected = setting; } | |||
item after it is removed from the list. | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the disabled state for the item. | |||
void setAutoDeleted(bool setting) {d_autoDelete = setting;} | ||||
/*! | \param setting | |||
\brief | - true if the item should be disabled. | |||
Set the owner window for this TreeItem. This is called by all the li | - false if the item should be enabled. | |||
st box widgets when | ||||
an item is added or inserted. | ||||
\param owner | \return | |||
Ponter to the window that should be considered the owner of this Tree | Nothing. | |||
Item. | */ | |||
void setDisabled(bool setting) | ||||
{ d_disabled = setting; } | ||||
\return | /*! | |||
Nothing | \brief | |||
*/ | Set whether this item will be automatically deleted when it is rem | |||
void setOwnerWindow(const Window* owner) {d_owner = owner;} | oved | |||
from the tree, or when the tree it is attached to is destroyed. | ||||
/*! | \param setting | |||
\brief | - true if the item object should be deleted by the system when the | |||
Set the colours used for selection highlighting. | it | |||
is removed from the tree, or when the tree it is attached to is | ||||
destroyed. | ||||
- false if client code will destroy the item after it is removed fr | ||||
om | ||||
the tree. | ||||
\param cols | \return | |||
ColourRect object describing the colours to be used. | Nothing. | |||
*/ | ||||
void setAutoDeleted(bool setting) | ||||
{ d_autoDelete = setting; } | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the owner window for this TreeItem. This is called by the tre | |||
void setSelectionColours(const ColourRect& cols) {d_selectCols = co | e | |||
ls;} | widget when an item is added or inserted. | |||
/*! | \param owner | |||
\brief | Ponter to the window that should be considered the owner of this | |||
Set the colours used for selection highlighting. | TreeItem. | |||
\param top_left_colour | \return | |||
Colour (as ARGB value) to be applied to the top-left corner of the se | Nothing | |||
lection area. | */ | |||
void setOwnerWindow(const Window* owner) | ||||
{ d_owner = owner; } | ||||
\param top_right_colour | /*! | |||
Colour (as ARGB value) to be applied to the top-right corner of the s | \brief | |||
election area. | Set the colours used for selection highlighting. | |||
\param bottom_left_colour | \param cols | |||
Colour (as ARGB value) to be applied to the bottom-left corner of the | ColourRect object describing the colours to be used. | |||
selection area. | ||||
\param bottom_right_colour | \return | |||
Colour (as ARGB value) to be applied to the bottom-right corner of th | Nothing. | |||
e selection area. | */ | |||
void setSelectionColours(const ColourRect& cols) | ||||
{ d_selectCols = cols; } | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the colours used for selection highlighting. | |||
void setSelectionColours(colour top_left_colour, colour top_right_colou | ||||
r, colour bottom_left_colour, colour bottom_right_colour); | ||||
/*! | \param top_left_colour | |||
\brief | Colour (as ARGB value) to be applied to the top-left corner of the | |||
Set the colours used for selection highlighting. | selection area. | |||
\param col | \param top_right_colour | |||
colour value to be used when rendering. | Colour (as ARGB value) to be applied to the top-right corner of the | |||
selection area. | ||||
\return | \param bottom_left_colour | |||
Nothing. | Colour (as ARGB value) to be applied to the bottom-left corner of t | |||
*/ | he | |||
void setSelectionColours(colour col) {setSelectionColours(col, col, | selection area. | |||
col, col);} | ||||
/*! | \param bottom_right_colour | |||
\brief | Colour (as ARGB value) to be applied to the bottom-right corner of | |||
Set the selection highlighting brush image. | the | |||
selection area. | ||||
\param image | \return | |||
Pointer to the Image object to be used for selection highlighting. | Nothing. | |||
*/ | ||||
void setSelectionColours(colour top_left_colour, | ||||
colour top_right_colour, | ||||
colour bottom_left_colour, | ||||
colour bottom_right_colour); | ||||
\return | /*! | |||
Nothing. | \brief | |||
*/ | Set the colours used for selection highlighting. | |||
void setSelectionBrushImage(const Image* image) {d_selectBrush = i | ||||
mage;} | ||||
/*! | \param col | |||
\brief | colour value to be used when rendering. | |||
Set the selection highlighting brush image. | ||||
\param imageset | \return | |||
Name of the imagest containing the image to be used. | Nothing. | |||
*/ | ||||
void setSelectionColours(colour col) | ||||
{ setSelectionColours(col, col, col, col); } | ||||
\param image | /*! | |||
Name of the image to be used | \brief | |||
Set the selection highlighting brush image. | ||||
\return | \param image | |||
Nothing. | Pointer to the Image object to be used for selection highlighting. | |||
*/ | ||||
void setSelectionBrushImage(const String& imageset, const String& image | ||||
); | ||||
/*! | \return | |||
\brief | Nothing. | |||
Tell the treeItem where its button is located. | */ | |||
Calculated and set in Tree.cpp. | void setSelectionBrushImage(const Image* image) | |||
{ d_selectBrush = image; } | ||||
\param buttonOffset | /*! | |||
Location of the button in screenspace. | \brief | |||
*/ | Set the selection highlighting brush image. | |||
void setButtonLocation(Rect &buttonOffset) { d_buttonLocation = buttonO | ||||
ffset; } | ||||
Rect &getButtonLocation(void) { return d_buttonLocation; } | \param imageset | |||
bool getIsOpen(void) { return d_isOpen; } | Name of the imagest containing the image to be used. | |||
void toggleIsOpen(void) { d_isOpen = !d_isOpen; } | ||||
TreeItem *getTreeItemFromIndex(size_t itemIndex); | ||||
size_t getItemCount(void) const {return d_listItems.size();} | ||||
LBItemList &getItemList(void) { return d_listItems; } | ||||
void addItem(TreeItem* item); | ||||
void setIcon(const Image &theIcon) { d_iconImage = (Image *)&theIcon; } | ||||
/*********************************************************************** | \param image | |||
** | Name of the image to be used. | |||
Abstract portion of interface | ||||
************************************************************************ | ||||
*/ | ||||
/*! | ||||
\brief | ||||
Return the rendered pixel size of this list box item. | ||||
\return | \return | |||
Size object describing the size of the list box item in pixels. | Nothing. | |||
*/ | */ | |||
virtual Size getPixelSize(void) const; | void setSelectionBrushImage(const String& imageset, const String& image | |||
); | ||||
/*! | /*! | |||
\brief | \brief | |||
Draw the list box item in its current state | Tell the treeItem where its button is located. | |||
Calculated and set in Tree.cpp. | ||||
\param position | \param buttonOffset | |||
Vecor3 object describing the upper-left corner of area that should be | Location of the button in screenspace. | |||
rendered in to for the draw operation. | */ | |||
void setButtonLocation(Rect &buttonOffset) | ||||
{ d_buttonLocation = buttonOffset; } | ||||
\param alpha | Rect &getButtonLocation(void) | |||
Alpha value to be used when rendering the item (between 0.0f and 1.0f | { return d_buttonLocation; } | |||
). | ||||
\param clipper | bool getIsOpen(void) | |||
Rect object describing the clipping rectangle for the draw operation. | { return d_isOpen; } | |||
\return | void toggleIsOpen(void) | |||
Nothing. | { d_isOpen = !d_isOpen; } | |||
*/ | ||||
virtual void draw(const Vector3& position, float alpha, const Rect& cl | ||||
ipper) const; | ||||
virtual void draw(RenderCache& cache,const Rect& targetRect, float z Base, float alpha, const Rect* clipper) const; | TreeItem *getTreeItemFromIndex(size_t itemIndex); | |||
/*********************************************************************** | size_t getItemCount(void) const | |||
** | { return d_listItems.size(); } | |||
Operators | ||||
************************************************************************ | ||||
*/ | ||||
/*! | ||||
\brief | ||||
Less-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator<(const TreeItem& rhs) const {return d_itemT | ||||
ext < rhs.getText();} | ||||
/*! | LBItemList &getItemList(void) | |||
\brief | { return d_listItems; } | |||
Greater-than operator, compares item texts. | ||||
*/ | void addItem(TreeItem* item); | |||
virtual bool operator>(const TreeItem& rhs) const {return d_itemT | void removeItem(const TreeItem* item); | |||
ext > rhs.getText();} | ||||
void setIcon(const Image &theIcon) | ||||
{ d_iconImage = (Image *) & theIcon; } | ||||
/********************************************************************** | ||||
*** | ||||
Abstract portion of interface | ||||
********************************************************************** | ||||
***/ | ||||
/*! | ||||
\brief | ||||
Return the rendered pixel size of this tree item. | ||||
\return | ||||
Size object describing the size of the tree item in pixels. | ||||
*/ | ||||
virtual Size getPixelSize(void) const; | ||||
/*! | ||||
\brief | ||||
Draw the tree item in its current state | ||||
\param position | ||||
Vector2 object describing the upper-left corner of area that should | ||||
be | ||||
rendered in to for the draw operation. | ||||
\param alpha | ||||
Alpha value to be used when rendering the item (between 0.0f and 1. | ||||
0f). | ||||
\param clipper | ||||
Rect object describing the clipping rectangle for the draw operatio | ||||
n. | ||||
\return | ||||
Nothing. | ||||
*/ | ||||
virtual void draw(GeometryBuffer& buffer, const Rect& targetRect, | ||||
float alpha, const Rect* clipper) const; | ||||
/********************************************************************** | ||||
*** | ||||
Operators | ||||
********************************************************************** | ||||
***/ | ||||
/*! | ||||
\brief | ||||
Less-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator<(const TreeItem& rhs) const | ||||
{ return getText() < rhs.getText(); } | ||||
/*! | ||||
\brief | ||||
Greater-than operator, compares item texts. | ||||
*/ | ||||
virtual bool operator>(const TreeItem& rhs) const | ||||
{ return getText() > rhs.getText(); } | ||||
protected: | protected: | |||
/*********************************************************************** | /********************************************************************** | |||
** | *** | |||
Implementation methods | Implementation methods | |||
************************************************************************ | ********************************************************************** | |||
*/ | ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Return a ColourRect object describing the colours in \a cols after ha | Return a ColourRect object describing the colours in \a cols after | |||
ving their alpha | having their alpha component modulated by the value \a alpha. | |||
component modulated by the value \a alpha. | */ | |||
*/ | ColourRect getModulateAlphaColourRect(const ColourRect& cols, | |||
ColourRect getModulateAlphaColourRect(const ColourRect& cols, float alph | float alpha) const; | |||
a) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Return a colour value describing the colour specified by \a col after | Return a colour value describing the colour specified by \a col af | |||
having its alpha | ter | |||
component modulated by the value \a alpha. | having its alpha component modulated by the value \a alpha. | |||
*/ | */ | |||
colour calculateModulatedAlphaColour(colour col, float alpha) const; | colour calculateModulatedAlphaColour(colour col, float alpha) const; | |||
/*********************************************************************** | //! parse the text visual string into a RenderString representation. | |||
** | void parseTextString() const; | |||
Implementation Data | ||||
************************************************************************ | /********************************************************************** | |||
*/ | *** | |||
String d_itemText; //!< Text for this list box item. If not render | Implementation Data | |||
ed, this is still used for list sorting. | ********************************************************************** | |||
String d_tooltipText; //!< Text for the individual tooltip of this ite | ***/ | |||
m | //! Text for this tree item. If not rendered, still used for sorting. | |||
uint d_itemID; //!< ID code assigned by client code. This has | String d_textLogical; //!< text rendered by th | |||
no meaning within the GUI system. | is component. | |||
void * d_itemData; //!< Pointer to some client code data. This has | //! pointer to bidirection support object | |||
no meaning within the GUI system. | BiDiVisualMapping* d_bidiVisualMapping; | |||
bool d_selected; //!< true if this item is selected. false if th | //! whether bidi visual mapping has been updated since last text change | |||
e item is not selected. | . | |||
bool d_disabled; //!< true if this item is disabled. false if th | mutable bool d_bidiDataValid; | |||
e item is not disabled. | //! Text for the individual tooltip of this item. | |||
bool d_autoDelete; //!< true if the system should destroy this item | String d_tooltipText; | |||
, false if client code will destroy the item. | //! ID code assigned by client code. | |||
Rect d_buttonLocation; //!< | uint d_itemID; | |||
const Window * d_owner; //!< Pointer to the window that owns this item. | //! Pointer to some client code data. | |||
ColourRect d_selectCols; //!< Colours used for selection highlig | void* d_itemData; | |||
hting. | //! true if item is selected. false if item is not selected. | |||
const Image * d_selectBrush; //!< Image used for rendering selection | bool d_selected; | |||
. | //! true if item is disabled. false if item is not disabled. | |||
ColourRect d_textCols; //!< Colours used for rendering the tex | bool d_disabled; | |||
t. | //! true if the system will destroy this item, false if client code wil | |||
Font * d_font; //!< Font used for rendering text. | l. | |||
Image * d_iconImage; //!< Icon to be displayed with this tre | bool d_autoDelete; | |||
eItem | //! Location of the 'expand' button for the item. | |||
LBItemList d_listItems; //!< list of items in this item's tree | Rect d_buttonLocation; | |||
branch. | //! Pointer to the window that owns this item. | |||
bool d_isOpen; //!< true if the this item's tree branc | const Window* d_owner; | |||
h is opened | //! Colours used for selection highlighting. | |||
}; | ColourRect d_selectCols; | |||
//! Image used for rendering selection. | ||||
const Image* d_selectBrush; | ||||
//! Colours used for rendering the text. | ||||
ColourRect d_textCols; | ||||
//! Font used for rendering text. | ||||
Font* d_font; | ||||
//! Image for the icon to be displayed with this TreeItem. | ||||
Image* d_iconImage; | ||||
//! list of items in this item's tree branch. | ||||
LBItemList d_listItems; | ||||
//! true if the this item's tree branch is opened. | ||||
bool d_isOpen; | ||||
//! Parser used to produce a final RenderedString from the standard Str | ||||
ing. | ||||
static BasicRenderedStringParser d_stringParser; | ||||
//! RenderedString drawn by this item. | ||||
mutable RenderedString d_renderedString; | ||||
//! boolean used to track when item state changes (and needs re-parse) | ||||
mutable bool d_renderedStringValid; | ||||
}; | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | ||||
# pragma warning(pop) | ||||
#endif | ||||
#endif // end of guard _CEGUITreeItem_h_ | #endif // end of guard _CEGUITreeItem_h_ | |||
End of changes. 115 change blocks. | ||||
498 lines changed or deleted | 612 lines changed or added | |||
CEGUITreeProperties.h | CEGUITreeProperties.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUITreeProperties.h | filename: CEGUITreeProperties.h | |||
created: 5-13-07 | created: 5-13-07 | |||
author: Jonathan Welch (Based on Code by David Durant) | author: Jonathan Welch (Based on Code by David Durant) | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
*************************************************************************** / | *************************************************************************** / | |||
#ifndef _CEGUITreeProperties_h_ | #ifndef _CEGUITreeProperties_h_ | |||
#define _CEGUITreeProperties_h_ | #define _CEGUITreeProperties_h_ | |||
#include "CEGUIProperty.h" | #include "../CEGUIProperty.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
// Start of TreeProperties namespace section | // Start of TreeProperties namespace section | |||
/*! | /*! | |||
\brief | \brief | |||
Namespace containing all classes that make up the properties interfa | Namespace containing classes that make up the properties interface s | |||
ce for the Listbox class | pecific | |||
to the Tree class. | ||||
*/ | */ | |||
namespace TreeProperties | namespace TreeProperties | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the sort setting of the list box. | Property to access the sort setting of the Tree. | |||
\par Usage: | \par Usage: | |||
- Name: Sort | - Name: Sort | |||
- Format: "[text]" | - Format: "[text]" | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate the list items should be sorted. | - "True" to indicate the tree items should be sorted. | |||
- "False" to indicate the list items should not be sorted. | - "False" to indicate the tree items should not be sorted. | |||
*/ | */ | |||
class Sort : public Property | class Sort : public Property | |||
{ | { | |||
public: | public: | |||
Sort() : Property( | Sort() : Property( | |||
"Sort", | "Sort", | |||
"Property to get/set the sort setting of the list box. Valu | "Property to get/set the sort setting of the tree. " | |||
e is either \"True\" or \"False\".", | "Value is either \"True\" or \"False\".", | |||
"False") | "False") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the multi-select setting of the list box. | Property to access the multi-select setting of the tree. | |||
\par Usage: | \par Usage: | |||
- Name: MultiSelect | - Name: MultiSelect | |||
- Format: "[text]" | - Format: "[text]" | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate that multiple items may be selected. | - "True" to indicate that multiple items may be selected. | |||
- "False" to indicate that only a single item may be selecte d. | - "False" to indicate that only a single item may be selecte d. | |||
*/ | */ | |||
class MultiSelect : public Property | class MultiSelect : public Property | |||
{ | { | |||
public: | public: | |||
MultiSelect() : Property( | MultiSelect() : Property( | |||
"MultiSelect", | "MultiSelect", | |||
"Property to get/set the multi-select setting of the list bo | "Property to get/set the multi-select setting of the tree. | |||
x. Value is either \"True\" or \"False\".", | " | |||
"Value is either \"True\" or \"False\".", | ||||
"False") | "False") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the 'always show' setting for the vertical scroll | Property to access the 'always show' setting for the vertical scroll | |||
bar of the list box. | bar of | |||
the tree. | ||||
\par Usage: | \par Usage: | |||
- Name: ForceVertScrollbar | - Name: ForceVertScrollbar | |||
- Format: "[text]" | - Format: "[text]" | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate that the vertical scroll bar will alway s be shown. | - "True" to indicate that the vertical scroll bar will alway s be shown. | |||
- "False" to indicate that the vertical scroll bar will only | - "False" to indicate that the vertical scroll bar will only | |||
be shown when it is needed. | be shown | |||
when it is needed. | ||||
*/ | */ | |||
class ForceVertScrollbar : public Property | class ForceVertScrollbar : public Property | |||
{ | { | |||
public: | public: | |||
ForceVertScrollbar() : Property( | ForceVertScrollbar() : Property( | |||
"ForceVertScrollbar", | "ForceVertScrollbar", | |||
"Property to get/set the 'always show' setting for the verti | "Property to get/set the 'always show' setting for the verti | |||
cal scroll bar of the list box. Value is either \"True\" or \"False\".", | cal scroll " | |||
"bar of the tree. Value is either \"True\" or \"False\".", | ||||
"False") | "False") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the 'always show' setting for the horizontal scro | Property to access the 'always show' setting for the horizontal scro | |||
ll bar of the list box. | ll bar | |||
of the tree. | ||||
\par Usage: | \par Usage: | |||
- Name: ForceHorzScrollbar | - Name: ForceHorzScrollbar | |||
- Format: "[text]" | - Format: "[text]" | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate that the horizontal scroll bar will alw | - "True" to indicate that the horizontal scroll bar will alw | |||
ays be shown. | ays be | |||
- "False" to indicate that the horizontal scroll bar will on | shown. | |||
ly be shown when it is needed. | - "False" to indicate that the horizontal scroll bar will on | |||
ly be shown | ||||
when it is needed. | ||||
*/ | */ | |||
class ForceHorzScrollbar : public Property | class ForceHorzScrollbar : public Property | |||
{ | { | |||
public: | public: | |||
ForceHorzScrollbar() : Property( | ForceHorzScrollbar() : Property( | |||
"ForceHorzScrollbar", | "ForceHorzScrollbar", | |||
"Property to get/set the 'always show' setting for the horiz | "Property to get/set the 'always show' setting for the horiz | |||
ontal scroll bar of the list box. Value is either \"True\" or \"False\".", | ontal " | |||
"scroll bar of the tree. Value is either \"True\" or \"False\".", | ||||
"False") | "False") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access the show item tooltips setting of the list box. | Property to access the show item tooltips setting of the tree. | |||
\par Usage: | \par Usage: | |||
- Name: ItemTooltips | - Name: ItemTooltips | |||
- Format: "[text]" | - Format: "[text]" | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate that the tooltip of the list box will be set by the it | - "True" to indicate that the tooltip of the tree will be set by th | |||
em below the mouse pointer | e | |||
- "False" to indicate that the list box has a static tooltip. | item below the mouse pointer | |||
- "False" to indicate that the tree has a static tooltip. | ||||
*/ | */ | |||
class ItemTooltips : public Property | class ItemTooltips : public Property | |||
{ | { | |||
public: | public: | |||
ItemTooltips() : Property( | ItemTooltips() : Property( | |||
"ItemTooltips", | "ItemTooltips", | |||
"Property to access the show item tooltips setting of the li | "Property to access the show item tooltips setting of the tr | |||
st box. Value is either \"True\" or \"False\".", | ee. " | |||
"Value is either \"True\" or \"False\".", | ||||
"False") | "False") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
} // End of TreeProperties namespace section | } // End of TreeProperties namespace section | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
End of changes. 19 change blocks. | ||||
39 lines changed or deleted | 50 lines changed or added | |||
CEGUIVector.h | CEGUIVector.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUISize.h" | #include "CEGUISize.h" | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Class used as a two dimensional vector (aka a Point) | Class used as a two dimensional vector (aka a Point) | |||
*/ | */ | |||
class CEGUIEXPORT Vector2 | class CEGUIEXPORT Vector2 | |||
{ | { | |||
public: | public: | |||
Vector2(void) {} | Vector2(void) {} | |||
Vector2(float x, float y) : d_x(x), d_y(y) {} | Vector2(float x, float y) : d_x(x), d_y(y) {} | |||
Vector2& operator*=(const Vector2& vec) | Vector2& operator*=(const Vector2& vec) | |||
{ | { | |||
d_x *= vec.d_x; | d_x *= vec.d_x; | |||
d_y *= vec.d_y; | d_y *= vec.d_y; | |||
return *this; | return *this; | |||
} | } | |||
Vector2& operator/=(const Vector2& vec) | Vector2& operator/=(const Vector2& vec) | |||
{ | { | |||
d_x /= vec.d_x; | d_x /= vec.d_x; | |||
d_y /= vec.d_y; | d_y /= vec.d_y; | |||
return *this; | return *this; | |||
} | } | |||
Vector2& operator+=(const Vector2& vec) | Vector2& operator+=(const Vector2& vec) | |||
{ | { | |||
d_x += vec.d_x; | d_x += vec.d_x; | |||
d_y += vec.d_y; | d_y += vec.d_y; | |||
return *this; | return *this; | |||
} | } | |||
Vector2& operator-=(const Vector2& vec) | Vector2& operator-=(const Vector2& vec) | |||
{ | { | |||
d_x -= vec.d_x; | d_x -= vec.d_x; | |||
d_y -= vec.d_y; | d_y -= vec.d_y; | |||
return *this; | return *this; | |||
} | } | |||
Vector2 operator+(const Vector2& vec) const | Vector2 operator+(const Vector2& vec) const | |||
{ | { | |||
return Vector2(d_x + vec.d_x, d_y + vec.d_y); | return Vector2(d_x + vec.d_x, d_y + vec.d_y); | |||
} | } | |||
Vector2 operator-(const Vector2& vec) const | Vector2 operator-(const Vector2& vec) const | |||
{ | { | |||
return Vector2(d_x - vec.d_x, d_y - vec.d_y); | return Vector2(d_x - vec.d_x, d_y - vec.d_y); | |||
} | } | |||
Vector2 operator*(const Vector2& vec) const | Vector2 operator*(const Vector2& vec) const | |||
{ | { | |||
return Vector2(d_x * vec.d_x, d_y * vec.d_y); | return Vector2(d_x * vec.d_x, d_y * vec.d_y); | |||
} | } | |||
bool operator==(const Vector2& vec) const | bool operator==(const Vector2& vec) const | |||
{ | { | |||
return ((d_x == vec.d_x) && (d_y == vec.d_y)); | return ((d_x == vec.d_x) && (d_y == vec.d_y)); | |||
} | } | |||
bool operator!=(const Vector2& vec) const | bool operator!=(const Vector2& vec) const | |||
{ | { | |||
return !(operator==(vec)); | return !(operator==(vec)); | |||
} | } | |||
Size asSize() const { return Size(d_x, d_y); } | Size asSize() const { return Size(d_x, d_y); } | |||
float d_x, d_y; | float d_x, d_y; | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Point class | Point class | |||
*/ | */ | |||
typedef Vector2 Point; | typedef Vector2 Point; | |||
/*! | /*! | |||
\brief | \brief | |||
Class used as a three dimensional vector | Class used as a three dimensional vector | |||
*/ | */ | |||
class CEGUIEXPORT Vector3 | class CEGUIEXPORT Vector3 | |||
{ | { | |||
public: | public: | |||
Vector3(void) {} | Vector3(void) {} | |||
Vector3(float x, float y, float z) : d_x(x), d_y(y), d_z(z) {} | Vector3(float x, float y, float z) : d_x(x), d_y(y), d_z(z) {} | |||
float d_x, d_y, d_z; | bool operator==(const Vector3& vec) const | |||
{ | ||||
return ((d_x == vec.d_x) && (d_y == vec.d_y) && (d_z == vec.d_z)); | ||||
} | ||||
bool operator!=(const Vector3& vec) const | ||||
{ | ||||
return !(operator==(vec)); | ||||
} | ||||
float d_x, d_y, d_z; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIVector_h_ | #endif // end of guard _CEGUIVector_h_ | |||
End of changes. 21 change blocks. | ||||
54 lines changed or deleted | 64 lines changed or added | |||
CEGUIVersion.h | CEGUIVersion.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
This file contains CEGUI version defines | This file contains CEGUI version defines | |||
*************************************************************************/ | *************************************************************************/ | |||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | |||
#ifndef _CEGUIVersion_h_ | #ifndef _CEGUIVersion_h_ | |||
#define _CEGUIVersion_h_ | #define _CEGUIVersion_h_ | |||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | |||
// Define CEGUI version | // Define CEGUI version | |||
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// | |||
#define CEGUI_VERSION_MAJOR 0 | #define CEGUI_VERSION_MAJOR 0 | |||
#define CEGUI_VERSION_MINOR 6 | #define CEGUI_VERSION_MINOR 7 | |||
#define CEGUI_VERSION_PATCH 1 | #define CEGUI_VERSION_PATCH 0 | |||
#endif // end of guard _CEGUIVersion_h_ | #endif // end of guard _CEGUIVersion_h_ | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
CEGUIWindow.h | CEGUIWindow.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUIVector.h" | #include "CEGUIVector.h" | |||
#include "CEGUIRect.h" | #include "CEGUIRect.h" | |||
#include "CEGUISize.h" | #include "CEGUISize.h" | |||
#include "CEGUIEventSet.h" | #include "CEGUIEventSet.h" | |||
#include "CEGUIPropertySet.h" | #include "CEGUIPropertySet.h" | |||
#include "CEGUISystem.h" | #include "CEGUISystem.h" | |||
#include "CEGUIInputEvent.h" | #include "CEGUIInputEvent.h" | |||
#include "CEGUIWindowProperties.h" | #include "CEGUIWindowProperties.h" | |||
#include "CEGUIUDim.h" | #include "CEGUIUDim.h" | |||
#include "CEGUIRenderCache.h" | ||||
#include "CEGUIWindowRenderer.h" | #include "CEGUIWindowRenderer.h" | |||
#include "CEGUITextUtils.h" | ||||
#include "CEGUIBasicRenderedStringParser.h" | ||||
#include <vector> | #include <vector> | |||
#include <set> | #include <set> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
skipping to change at line 122 | skipping to change at line 123 | |||
The base class provides the common functionality required by all UI obj ects, | The base class provides the common functionality required by all UI obj ects, | |||
and specifies the minimal interface required to be implemented by deriv ed | and specifies the minimal interface required to be implemented by deriv ed | |||
classes. | classes. | |||
*/ | */ | |||
class CEGUIEXPORT Window : public PropertySet, public EventSet | class CEGUIEXPORT Window : public PropertySet, public EventSet | |||
{ | { | |||
public: | public: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Event name constants | Event name constants | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
//!< Namespace for global events | //! Namespace for global events | |||
static const String EventNamespace; | static const String EventNamespace; | |||
// generated internally by Window | // generated internally by Window | |||
static const String EventWindowUpdated; //!< Event to signal the win | //! Signal the time based update of window. | |||
dow is being updated. Used by lua system! | static const String EventWindowUpdated; | |||
//! Parent of this Window has been re-sized. | //! Parent of this Window has been re-sized. | |||
static const String EventParentSized; | static const String EventParentSized; | |||
//! Window size has changed | //! Window size has changed | |||
static const String EventSized; | static const String EventSized; | |||
//! Window position has changed | //! Window position has changed | |||
static const String EventMoved; | static const String EventMoved; | |||
//! Text string for the Window has changed | //! Text string for the Window has changed | |||
static const String EventTextChanged; | static const String EventTextChanged; | |||
//!Font object for the Window has been changed | //!Font object for the Window has been changed | |||
static const String EventFontChanged; | static const String EventFontChanged; | |||
skipping to change at line 191 | skipping to change at line 193 | |||
//! A DragContainer was dropped on this Window. | //! A DragContainer was dropped on this Window. | |||
static const String EventDragDropItemDropped; | static const String EventDragDropItemDropped; | |||
//! The vertical alignment of the window has changed. | //! The vertical alignment of the window has changed. | |||
static const String EventVerticalAlignmentChanged; | static const String EventVerticalAlignmentChanged; | |||
//! The vertical alignment of the window has changed. | //! The vertical alignment of the window has changed. | |||
static const String EventHorizontalAlignmentChanged; | static const String EventHorizontalAlignmentChanged; | |||
//! The a new window renderer was attached. | //! The a new window renderer was attached. | |||
static const String EventWindowRendererAttached; | static const String EventWindowRendererAttached; | |||
//! The currently assigned window renderer was detached. | //! The currently assigned window renderer was detached. | |||
static const String EventWindowRendererDetached; | static const String EventWindowRendererDetached; | |||
//! Window rotation factor(s) changed | ||||
static const String EventRotated; | ||||
//! Window non-client setting was changed | ||||
static const String EventNonClientChanged; | ||||
// generated externally (inputs) | // generated externally (inputs) | |||
//! Mouse cursor has entered the Window. | //! Mouse cursor has entered the Window. | |||
static const String EventMouseEnters; | static const String EventMouseEnters; | |||
//! Mouse cursor has left the Window. | //! Mouse cursor has left the Window. | |||
static const String EventMouseLeaves; | static const String EventMouseLeaves; | |||
//! Mouse cursor was moved within the area of the Window. | //! Mouse cursor was moved within the area of the Window. | |||
static const String EventMouseMove; | static const String EventMouseMove; | |||
//! Mouse wheel was scrolled within the Window. | //! Mouse wheel was scrolled within the Window. | |||
static const String EventMouseWheel; | static const String EventMouseWheel; | |||
skipping to change at line 226 | skipping to change at line 232 | |||
static const String EventCharacterKey; | static const String EventCharacterKey; | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Child Widget name suffix constants | Child Widget name suffix constants | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
//! Widget name suffix for automatically created tooltip widgets. | //! Widget name suffix for automatically created tooltip widgets. | |||
static const String TooltipNameSuffix; | static const String TooltipNameSuffix; | |||
//! Something that all generated widgets will have in their names. | //! Something that all generated widgets will have in their names. | |||
static const String AutoWidgetNameSuffix; | static const String AutoWidgetNameSuffix; | |||
/********************************************************************** | ||||
*** | ||||
Construction and Destruction | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | /*! | |||
\brief | \brief | |||
Constructor for Window base class | Constructor for Window base class | |||
\param type | \param type | |||
String object holding Window type (usually provided by WindowFactor y). | String object holding Window type (usually provided by WindowFactor y). | |||
\param name | \param name | |||
String object holding unique name for the Window. | String object holding unique name for the Window. | |||
*/ | */ | |||
Window(const String& type, const String& name); | Window(const String& type, const String& name); | |||
/*! | /*! | |||
\brief | \brief | |||
Destructor for Window base class | Destructor for Window base class | |||
*/ | */ | |||
virtual ~Window(void); | virtual ~Window(void); | |||
/********************************************************************** | ||||
*** | ||||
Accessor functions | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | /*! | |||
\brief | \brief | |||
return a String object holding the type name for this Window. | return a String object holding the type name for this Window. | |||
\return | \return | |||
String object holding the Window type. | String object holding the Window type. | |||
*/ | */ | |||
const String& getType(void) const; | const String& getType(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a String object holding the name of this Window. | return a String object holding the name of this Window. | |||
\return | \return | |||
String object holding the unique Window name. | String object holding the unique Window name. | |||
*/ | */ | |||
const String& getName(void) const {return d_name;} | const String& getName(void) const {return d_name;} | |||
/** | ||||
* Return a string to the window prefix | ||||
* \return String object holding the prefix of this window | ||||
*/ | ||||
const String& getPrefix(void) const {return d_windowPrefix;} | ||||
/*! | /*! | |||
\brief | \brief | |||
returns whether or not this Window is set to be destroyed when its | returns whether or not this Window is set to be destroyed when its | |||
parent window is destroyed. | parent window is destroyed. | |||
\return | \return | |||
- true if the Window will be destroyed when its parent is destroyed . | - true if the Window will be destroyed when its parent is destroyed . | |||
- false if the Window will remain when its parent is destroyed. | - false if the Window will remain when its parent is destroyed. | |||
*/ | */ | |||
bool isDestroyedByParent(void) const {return d_destroyedByParent; } | bool isDestroyedByParent(void) const {return d_destroyedByParent; } | |||
skipping to change at line 465 | skipping to change at line 459 | |||
\return | \return | |||
Pointer to the Window object attached to this window that has the n ame | Pointer to the Window object attached to this window that has the n ame | |||
\a name. | \a name. | |||
\exception UnknownObjectException | \exception UnknownObjectException | |||
thrown if no window named \a name is attached to this Window. | thrown if no window named \a name is attached to this Window. | |||
*/ | */ | |||
Window* getChild(const String& name) const; | Window* getChild(const String& name) const; | |||
Window* recursiveChildSearch(const String& name) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return a pointer to the first attached child window with the specif ied | return a pointer to the first attached child window with the specif ied | |||
ID value. | ID value. | |||
This function will throw an exception if no child object with the g iven | This function will throw an exception if no child object with the g iven | |||
ID is attached. This decision was made (over returning NULL if no | ID is attached. This decision was made (over returning NULL if no | |||
window was found) so that client code can assume that if the call | window was found) so that client code can assume that if the call | |||
returns it has a valid window pointer. We provide the isChild() | returns it has a valid window pointer. We provide the isChild() | |||
functions for checking if a given window is attached. | functions for checking if a given window is attached. | |||
skipping to change at line 493 | skipping to change at line 485 | |||
the ID code \a ID. | the ID code \a ID. | |||
\exception UnknownObjectException | \exception UnknownObjectException | |||
thrown if no window with the ID code \a ID is attached to this Wind ow. | thrown if no window with the ID code \a ID is attached to this Wind ow. | |||
*/ | */ | |||
Window* getChild(uint ID) const; | Window* getChild(uint ID) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a pointer to the first attached child window with the specif ied | return a pointer to the first attached child window with the specif ied | |||
name. Children are traversed recursively. | ||||
Contrary to the non recursive version of this function, this one wi | ||||
ll | ||||
not throw an exception, but return 0 in case no child was found. | ||||
\note | ||||
WARNING! This function can be very expensive and should only be use | ||||
d | ||||
when you have no other option available. If you decide to use it an | ||||
yway, | ||||
make sure the window hierarchy from the entry point is small. | ||||
\param name | ||||
String object holding the name of the child window for which a poin | ||||
ter | ||||
is to be returned. | ||||
\return | ||||
Pointer to the Window object attached to this window that has the n | ||||
ame | ||||
\a name. | ||||
If no child is found with the name \a name, 0 is returned. | ||||
*/ | ||||
Window* getChildRecursive(const String& name) const; | ||||
/*! | ||||
\brief | ||||
return a pointer to the first attached child window with the specif | ||||
ied | ||||
ID value. Children are traversed recursively. | ID value. Children are traversed recursively. | |||
Contrary to the non recursive version of this function, this one wi ll | Contrary to the non recursive version of this function, this one wi ll | |||
not throw an exception, but return 0 in case no child was found. | not throw an exception, but return 0 in case no child was found. | |||
\note | \note | |||
WARNING! This function can be very expensive and should only be use d | WARNING! This function can be very expensive and should only be use d | |||
when you have no other option available. If you decide to use it an yway, | when you have no other option available. If you decide to use it an yway, | |||
make sure the window hierarchy from the entry point is small. | make sure the window hierarchy from the entry point is small. | |||
skipping to change at line 609 | skipping to change at line 626 | |||
*/ | */ | |||
Font* getFont(bool useDefault = true) const; | Font* getFont(bool useDefault = true) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return the current text for the Window | return the current text for the Window | |||
\return | \return | |||
The String object that holds the current text for this Window. | The String object that holds the current text for this Window. | |||
*/ | */ | |||
const String& getText(void) const {return d_text;} | const String& getText(void) const {return d_textLogical;} | |||
//! return text string with \e visual ordering of glyphs. | ||||
const String& getTextVisual() const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return true if the Window inherits alpha from its parent(s). | return true if the Window inherits alpha from its parent(s). | |||
\return | \return | |||
- true if the Window inherits alpha from its parent(s) | - true if the Window inherits alpha from its parent(s) | |||
- false if the alpha for this Window is independant from its parent s. | - false if the alpha for this Window is independant from its parent s. | |||
*/ | */ | |||
bool inheritsAlpha(void) const {return d_inheritsAlpha;} | bool inheritsAlpha(void) const {return d_inheritsAlpha;} | |||
skipping to change at line 653 | skipping to change at line 673 | |||
window, taking into account inheritance of parent window(s) alpha. | window, taking into account inheritance of parent window(s) alpha. | |||
\return | \return | |||
the effective alpha that will be applied to this Window when render ing. | the effective alpha that will be applied to this Window when render ing. | |||
The value returned Will be between 0.0f and 1.0f. | The value returned Will be between 0.0f and 1.0f. | |||
*/ | */ | |||
float getEffectiveAlpha(void) const; | float getEffectiveAlpha(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a Rect object describing the Window area in screen space. | Return a Rect that describes the unclipped outer rect area of the W | |||
indow | ||||
\return | in screen pixels. | |||
Rect object that describes the area covered by the Window. The val | */ | |||
ues | Rect getUnclippedOuterRect() const; | |||
in the returned Rect are in screen pixels. The returned Rect is cl | ||||
ipped | ||||
as appropriate and depending upon the 'ClippedByParent' setting. | ||||
\note | /*! | |||
This has now been made virtual to ease some customisations that req | \brief | |||
uire | Return a Rect that describes the unclipped inner rect area of the W | |||
more specialised clipping requirements. | indow | |||
in screen pixels. | ||||
*/ | */ | |||
Rect getPixelRect(void) const; | Rect getUnclippedInnerRect() const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a Rect object describing the Window area in screen space. | Return a Rect that describes the unclipped area covered by the Wind ow. | |||
\return | This function can return either the inner or outer area dependant u | |||
Rect object that describes the area covered by the Window. The val | pon | |||
ues | the boolean values passed in. | |||
in the returned Rect are in screen pixels. The returned Rect is cl | ||||
ipped | \param inner | |||
as appropriate and depending upon the 'ClippedByParent' setting. | - true if the inner rect area should be returned. | |||
- false if the outer rect area should be returned. | ||||
*/ | ||||
Rect getUnclippedRect(const bool inner) const; | ||||
/*! | ||||
\brief | ||||
Return a Rect that describes the rendering clipping rect based upon | ||||
the | ||||
outer rect area of the window. | ||||
\note | \note | |||
This has now been made virtual to ease some customisations that req | The area returned by this function gives you the correct clipping r | |||
uire | ect | |||
more specialised clipping requirements. | for rendering within the Window's outer rect area. The area descri | |||
bed | ||||
may or may not correspond to the final visual clipping actually see | ||||
n on | ||||
the display; this is intentional and neccessary due to the way that | ||||
imagery is cached under some configurations. | ||||
*/ | */ | |||
virtual Rect getPixelRect_impl(void) const; | Rect getOuterRectClipper() const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a Rect object describing the clipped inner area for this win | Return a Rect that describes the rendering clipping rect based upon | |||
dow. | the | |||
inner rect area of the window. | ||||
\return | \note | |||
Rect object that describes, in appropriately clipped screen pixel | The area returned by this function gives you the correct clipping r | |||
co-ordinates, the window object's inner rect area. | ect | |||
for rendering within the Window's inner rect area. The area descri | ||||
bed | ||||
may or may not correspond to the final visual clipping actually see | ||||
n on | ||||
the display; this is intentional and neccessary due to the way that | ||||
imagery is cached under some configurations. | ||||
*/ | */ | |||
Rect getInnerRect(void) const; | Rect getInnerRectClipper() const; | |||
/*! | /*! | |||
\brief | \brief | |||
return a Rect object describing the Window area unclipped, in scree | Return a Rect that describes the rendering clipping rect for the Wi | |||
n | ndow. | |||
space. | ||||
\return | This function can return the clipping rect for either the inner or | |||
Rect object that describes the area covered by the Window. The val | outer | |||
ues | area dependant upon the boolean values passed in. | |||
in the returned Rect are in screen pixels. The returned rect is fu | ||||
lly | \note | |||
unclipped. | The areas returned by this function gives you the correct clipping | |||
rects | ||||
for rendering within the Window's areas. The area described may or | ||||
may | ||||
not correspond to the final visual clipping actually seen on the | ||||
display; this is intentional and neccessary due to the way that ima | ||||
gery | ||||
is cached under some configurations. | ||||
\param non_client | ||||
- true to return the non-client clipping area (based on outer rect) | ||||
. | ||||
- false to return the client clipping area (based on inner rect). | ||||
*/ | */ | |||
Rect getUnclippedPixelRect(void) const; | Rect getClipRect(const bool non_client = false) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a Rect object that describes, unclipped, the inner rectangle | Return the Rect that descibes the clipped screen area that is used | |||
for | for | |||
this window. The inner rectangle is typically an area that exclude | determining whether this window has been hit by a certain point. | |||
s | ||||
some frame or other rendering that should not be touched by subsequ | ||||
ent | ||||
rendering. | ||||
\return | The area returned by this function may also be useful for certain | |||
Rect object that describes, in unclipped screen pixel co-ordinates, | calculations that require the clipped Window area as seen on the di | |||
the | splay | |||
window object's inner rect area. | as opposed to what is used for rendering (since the actual renderin | |||
g | ||||
clipper rects should not to be used if reliable results are desired | ||||
). | ||||
*/ | */ | |||
Rect getUnclippedInnerRect(void) const; | Rect getHitTestRect() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a Rect object that describes, unclipped, the inner rectangle for | Return a Rect object that describes, unclipped, the inner rectangle for | |||
this window. The inner rectangle is typically an area that exclude s | this window. The inner rectangle is typically an area that exclude s | |||
some frame or other rendering that should not be touched by subsequ ent | some frame or other rendering that should not be touched by subsequ ent | |||
rendering. | rendering. | |||
\return | \return | |||
Rect object that describes, in unclipped screen pixel co-ordinates, the | Rect object that describes, in unclipped screen pixel co-ordinates, the | |||
skipping to change at line 759 | skipping to change at line 801 | |||
/*! | /*! | |||
\brief | \brief | |||
return true if an ancestor window has captured inputs. | return true if an ancestor window has captured inputs. | |||
\return | \return | |||
- true if input is captured by a Window that is some ancestor (pare nt, | - true if input is captured by a Window that is some ancestor (pare nt, | |||
parent of parent, etc) of this Window. | parent of parent, etc) of this Window. | |||
- false if no ancestor of this window has captured input. | - false if no ancestor of this window has captured input. | |||
*/ | */ | |||
bool isCapturedByAncestor(void) const | bool isCapturedByAncestor(void) const | |||
{return isAncestor(getCaptureWindow());} | {return isAncestor(getCaptureWindow());} | |||
/*! | /*! | |||
\brief | \brief | |||
return true if a child window has captured inputs. | return true if a child window has captured inputs. | |||
\return | \return | |||
- true if input is captured by a Window that is a child of this Win dow. | - true if input is captured by a Window that is a child of this Win dow. | |||
- false if no child of this window has not captured input. | - false if no child of this window has not captured input. | |||
*/ | */ | |||
bool isCapturedByChild(void) const {return isChild(getCaptureWindow()) ;} | bool isCapturedByChild(void) const {return isChild(getCaptureWindow()) ;} | |||
/*! | /*! | |||
\brief | \brief | |||
check if the given pixel position would hit this window. | check if the given pixel position would hit this window. | |||
\param position | \param position | |||
Vector2 object describing the position to check. The position | Vector2 object describing the position to check. The position | |||
describes a pixel offset from the top-left corner of the display. | describes a pixel offset from the top-left corner of the display. | |||
\param allow_disabled | ||||
- true specifies that the window may be 'hit' if it is disabled. | ||||
- false specifies that the window may only be hit if it is enabled. | ||||
\return | \return | |||
- true if \a position hits this Window. | - true if \a position hits this Window. | |||
- false if \a position does not hit this window. | - false if \a position does not hit this window. | |||
*/ | */ | |||
virtual bool isHit(const Vector2& position) const; | virtual bool isHit(const Vector2& position, | |||
const bool allow_disabled = false) const; | ||||
/*! | /*! | |||
\brief | \brief | |||
return the child Window that is hit by the given pixel position | return the child Window that is hit by the given pixel position | |||
\param position | \param position | |||
Vector2 object describing the position to check. The position | Vector2 object describing the position to check. The position | |||
describes a pixel offset from the top-left corner of the display. | describes a pixel offset from the top-left corner of the display. | |||
\return | \return | |||
skipping to change at line 808 | skipping to change at line 855 | |||
/*! | /*! | |||
\brief | \brief | |||
return the child Window that is 'hit' by the given position, and is | return the child Window that is 'hit' by the given position, and is | |||
allowed to handle mouse events. | allowed to handle mouse events. | |||
\param position | \param position | |||
Vector2 object describing the position to check. The position | Vector2 object describing the position to check. The position | |||
describes a pixel offset from the top-left corner of the display. | describes a pixel offset from the top-left corner of the display. | |||
\param allow_disabled | ||||
- true specifies that a disabled window may be returned as the targ | ||||
et. | ||||
- false specifies that only enabled windows may be returned. | ||||
\return | \return | |||
Pointer to the child Window that was hit according to the location | Pointer to the child Window that was hit according to the location | |||
\a position, or 0 if no child of this window was hit. | \a position, or 0 if no child of this window was hit. | |||
*/ | */ | |||
Window* getTargetChildAtPosition(const Vector2& position) const; | Window* getTargetChildAtPosition(const Vector2& position, | |||
const bool allow_disabled = false) con | ||||
st; | ||||
/*! | /*! | |||
\brief | \brief | |||
return the parent of this Window. | return the parent of this Window. | |||
\return | \return | |||
Pointer to the Window object that is the parent of this Window. | Pointer to the Window object that is the parent of this Window. | |||
This value can be NULL, in which case the Window is a GUI sheet / r oot. | This value can be NULL, in which case the Window is a GUI sheet / r oot. | |||
*/ | */ | |||
Window* getParent(void) const {return d_parent;} | Window* getParent(void) const {return d_parent;} | |||
skipping to change at line 882 | skipping to change at line 934 | |||
loses input capture. | loses input capture. | |||
- false if the window will set the capture window to NULL when it l oses | - false if the window will set the capture window to NULL when it l oses | |||
input capture (this is the default behaviour). | input capture (this is the default behaviour). | |||
*/ | */ | |||
bool restoresOldCapture(void) const {return d_restoreOldCapture;} | bool restoresOldCapture(void) const {return d_restoreOldCapture;} | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether z-order changes are enabled or disabled for this Win dow. | Return whether z-order changes are enabled or disabled for this Win dow. | |||
\note | ||||
This is distinguished from the is/setRiseOnClickEnabled setting in | ||||
that | ||||
if rise on click is disabled it only affects the users ability to a | ||||
ffect | ||||
the z order of the Window by clicking the mouse; is still possible | ||||
to | ||||
programatically alter the Window z-order by calling the moveToFront | ||||
or | ||||
moveToBack member functions. Whereas if z ordering is disabled the | ||||
functions moveToFront and moveToBack are also precluded from affect | ||||
ing | ||||
the Window z position. | ||||
\return | \return | |||
- true if z-order changes are enabled for this window. | - true if z-order changes are enabled for this window. | |||
moveToFront/moveToBack work normally as expected. | moveToFront/moveToBack work normally as expected. | |||
- false: z-order changes are disabled for this window. | - false: z-order changes are disabled for this window. | |||
moveToFront/moveToBack are ignored for this window. | moveToFront/moveToBack are ignored for this window. | |||
*/ | */ | |||
bool isZOrderingEnabled(void) const; | bool isZOrderingEnabled(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
skipping to change at line 1006 | skipping to change at line 1067 | |||
- false if the window does not inherit tooltip text from its parent | - false if the window does not inherit tooltip text from its parent | |||
(and shows no tooltip when no text is set). | (and shows no tooltip when no text is set). | |||
*/ | */ | |||
bool inheritsTooltipText(void) const; | bool inheritsTooltipText(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window will rise to the top of the z-order when | Return whether this window will rise to the top of the z-order when | |||
clicked with the left mouse button. | clicked with the left mouse button. | |||
\note | ||||
This is distinguished from the is/setZOrderingEnabled setting in th | ||||
at | ||||
if rise on click is disabled it only affects the users ability to a | ||||
ffect | ||||
the z order of the Window by clicking the mouse; is still possible | ||||
to | ||||
programatically alter the Window z-order by calling the moveToFront | ||||
or | ||||
moveToBack member functions. Whereas if z ordering is disabled the | ||||
functions moveToFront and moveToBack are also precluded from affect | ||||
ing | ||||
the Window z position. | ||||
\return | \return | |||
- true if the window will come to the top of other windows when the left | - true if the window will come to the top of other windows when the left | |||
mouse button is pushed within its area. | mouse button is pushed within its area. | |||
- false if the window does not change z-order position when the lef t | - false if the window does not change z-order position when the lef t | |||
mouse button is pushed within its area. | mouse button is pushed within its area. | |||
*/ | */ | |||
bool isRiseOnClickEnabled(void) const { return d_riseOnClick; } | bool isRiseOnClickEnabled(void) const { return d_riseOnClick; } | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the given class name at | Return whether this window was inherited from the given class name at | |||
some point in the inheritance hierarchy. | some point in the inheritance hierarchy. | |||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name. false if not. | true if this window was inherited from \a class_name. false if not. | |||
*/ | */ | |||
bool testClassName(const String& class_name) const | bool testClassName(const String& class_name) const | |||
{return testClassName_impl(class_name);} | {return testClassName_impl(class_name);} | |||
/*! | /*! | |||
\brief | \brief | |||
Get the vertical alignment. | Get the vertical alignment. | |||
Returns the vertical alignment for the window. This setting affect s how | Returns the vertical alignment for the window. This setting affect s how | |||
the windows position is interpreted relative to its parent. | the windows position is interpreted relative to its parent. | |||
\return | \return | |||
One of the VerticalAlignment enumerated values. | One of the VerticalAlignment enumerated values. | |||
skipping to change at line 1054 | skipping to change at line 1124 | |||
Returns the horizontal alignment for the window. This setting affe cts | Returns the horizontal alignment for the window. This setting affe cts | |||
how the windows position is interpreted relative to its parent. | how the windows position is interpreted relative to its parent. | |||
\return | \return | |||
One of the HorizontalAlignment enumerated values. | One of the HorizontalAlignment enumerated values. | |||
*/ | */ | |||
HorizontalAlignment getHorizontalAlignment() const {return d_horzAlign ;} | HorizontalAlignment getHorizontalAlignment() const {return d_horzAlign ;} | |||
/*! | /*! | |||
\brief | \brief | |||
Return the RenderCache object for this Window. | Return the GeometryBuffer object for this Window. | |||
\return | \return | |||
Reference to the RenderCache object for this Window. | Reference to the GeometryBuffer object for this Window. | |||
*/ | */ | |||
RenderCache& getRenderCache() { return d_renderCache; } | GeometryBuffer& getGeometryBuffer(); | |||
/*! | /*! | |||
\brief | \brief | |||
Get the name of the LookNFeel assigned to this window. | Get the name of the LookNFeel assigned to this window. | |||
\return | \return | |||
String object holding the name of the look assigned to this window. | String object holding the name of the look assigned to this window. | |||
Returns the empty string if no look is assigned. | Returns the empty string if no look is assigned. | |||
*/ | */ | |||
const String& getLookNFeel() const; | const String& getLookNFeel() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Get whether or not this Window is the modal target. | Get whether or not this Window is the modal target. | |||
\return | \return | |||
Returns true if this Window is the modal target, otherwise false. | Returns true if this Window is the modal target, otherwise false. | |||
*/ | */ | |||
bool getModalState(void) const | bool getModalState(void) const | |||
{return (System::getSingleton().getModalTarget() == this);} | {return(System::getSingleton().getModalTarget() == this);} | |||
/*! | /*! | |||
\brief | \brief | |||
Returns a named user string. | Returns a named user string. | |||
\param name | \param name | |||
String object holding the name of the string to be returned. | String object holding the name of the string to be returned. | |||
\return | \return | |||
String object holding the data stored for the requested user string . | String object holding the data stored for the requested user string . | |||
skipping to change at line 1243 | skipping to change at line 1313 | |||
\brief | \brief | |||
Returns whether this Window object will receive events generated by | Returns whether this Window object will receive events generated by | |||
the drag and drop support in the system. | the drag and drop support in the system. | |||
\return | \return | |||
- true if the Window is enabled as a drag and drop target. | - true if the Window is enabled as a drag and drop target. | |||
- false if the window is not enabled as a drag and drop target. | - false if the window is not enabled as a drag and drop target. | |||
*/ | */ | |||
bool isDragDropTarget() const; | bool isDragDropTarget() const; | |||
/********************************************************************** | /*! | |||
*** | \brief | |||
Manipulator functions | Fill in the RenderingContext \a ctx with details of the RenderingSu | |||
*********************************************************************** | rface | |||
**/ | where this Window object should normally do it's rendering. | |||
*/ | ||||
void getRenderingContext(RenderingContext& ctx) const; | ||||
//! implementation of the default getRenderingContext logic. | ||||
virtual void getRenderingContext_impl(RenderingContext& ctx) const; | ||||
/*! | ||||
\brief | ||||
return the RenderingSurface currently set for this window. May ret | ||||
urn | ||||
0. | ||||
*/ | ||||
RenderingSurface* getRenderingSurface() const; | ||||
/*! | ||||
\brief | ||||
return the RenderingSurface that will be used by this window as the | ||||
target for rendering. | ||||
*/ | ||||
RenderingSurface& getTargetRenderingSurface() const; | ||||
/*! | ||||
\brief | ||||
Returns whether \e automatic use of an imagery caching RenderingSur | ||||
face | ||||
(i.e. a RenderingWindow) is enabled for this window. The reason we | ||||
emphasise 'automatic' is because the client may manually set a | ||||
RenderingSurface that does exactly the same job. | ||||
\return | ||||
- true if automatic use of a caching RenderingSurface is enabled. | ||||
- false if automatic use of a caching RenderTarget is not enabled. | ||||
*/ | ||||
bool isUsingAutoRenderingSurface() const; | ||||
/*! | ||||
\brief | ||||
Returns the window at the root of the hierarchy starting at this | ||||
Window. The root window is defined as the first window back up the | ||||
hierarchy that has no parent window. | ||||
\return | ||||
A pointer to the root window of the hierarchy that this window is | ||||
attched to. | ||||
*/ | ||||
const Window* getRootWindow() const; | ||||
Window* getRootWindow(); | ||||
//! return the rotations set for this window. | ||||
const Vector3& getRotation() const; | ||||
/*! | ||||
\brief | ||||
Return whether the Window is a non-client window. | ||||
A non-client window is clipped, positioned and sized according to t | ||||
he | ||||
parent window's full area as opposed to just the inner rect area us | ||||
ed | ||||
for normal client windows. | ||||
\return | ||||
- true if the window should is clipped, positioned and sized accord | ||||
ing | ||||
to the full area rectangle of it's parent. | ||||
- false if the window is be clipped, positioned and sized according | ||||
to the inner rect area of it's parent. | ||||
*/ | ||||
bool isNonClientWindow() const; | ||||
/*! | /*! | |||
\brief | \brief | |||
Renames the window. | Renames the window. | |||
\param new_name | \param new_name | |||
String object holding the new name for the window. | String object holding the new name for the window. | |||
\exception AlreadyExistsException | \exception AlreadyExistsException | |||
thrown if a Window named \a new_name already exists in the system. | thrown if a Window named \a new_name already exists in the system. | |||
*/ | */ | |||
skipping to change at line 1425 | skipping to change at line 1561 | |||
\param ID | \param ID | |||
Client assigned ID code for this Window. The GUI system assigns no | Client assigned ID code for this Window. The GUI system assigns no | |||
meaning to any IDs, they are a device purely for client code usage. | meaning to any IDs, they are a device purely for client code usage. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setID(uint ID); | void setID(uint ID); | |||
/** | ||||
* Sets the unique prefix for this window. | ||||
* \param prefix String object holding the prefix to be used on this | ||||
window. | ||||
*/ | ||||
void setPrefix(String prefix) { d_windowPrefix = prefix;} | ||||
/*! | /*! | |||
\brief | \brief | |||
Set the current text string for the Window. | Set the current text string for the Window. | |||
\param text | \param text | |||
String object containing the text that is to be set as the Window t ext. | String object containing the text that is to be set as the Window t ext. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
skipping to change at line 1686 | skipping to change at line 1816 | |||
- true if the Window should use inherited alpha. | - true if the Window should use inherited alpha. | |||
- false if the Window should have an independant alpha value. | - false if the Window should have an independant alpha value. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void setInheritsAlpha(bool setting); | void setInheritsAlpha(bool setting); | |||
/*! | /*! | |||
\brief | \brief | |||
Signal the System object to redraw (at least) this Window on the ne | Invalidate this window causing at least this window to be redrawn d | |||
xt | uring | |||
render cycle. | the next rendering pass. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void requestRedraw(void) const; | void invalidate(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Set the mouse cursor image to be used when the mouse enters this wi ndow. | Set the mouse cursor image to be used when the mouse enters this wi ndow. | |||
\param image | \param image | |||
Pointer to the Image object to use as the mouse cursor image when t he | Pointer to the Image object to use as the mouse cursor image when t he | |||
mouse enters the area for this Window. | mouse enters the area for this Window. | |||
\return | \return | |||
skipping to change at line 1718 | skipping to change at line 1848 | |||
\brief | \brief | |||
Set the mouse cursor image to be used when the mouse enters this wi ndow. | Set the mouse cursor image to be used when the mouse enters this wi ndow. | |||
\param image | \param image | |||
One of the MouseCursorImage enumerated values. | One of the MouseCursorImage enumerated values. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setMouseCursor(MouseCursorImage image) | void setMouseCursor(MouseCursorImage image) | |||
{d_mouseCursor = (const Image*)image;} | {d_mouseCursor = (const Image*)image;} | |||
/*! | /*! | |||
\brief | \brief | |||
Set the mouse cursor image to be used when the mouse enters this wi ndow. | Set the mouse cursor image to be used when the mouse enters this wi ndow. | |||
\param imageset | \param imageset | |||
String object that contains the name of the Imageset that contains the | String object that contains the name of the Imageset that contains the | |||
image to be used. | image to be used. | |||
\param image_name | \param image_name | |||
skipping to change at line 1761 | skipping to change at line 1891 | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setUserData(void* user_data) {d_userData = user_data;} | void setUserData(void* user_data) {d_userData = user_data;} | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether z-order changes are enabled or disabled for this Window . | Set whether z-order changes are enabled or disabled for this Window . | |||
\note | ||||
This is distinguished from the is/setRiseOnClickEnabled setting in | ||||
that | ||||
if rise on click is disabled it only affects the users ability to a | ||||
ffect | ||||
the z order of the Window by clicking the mouse; is still possible | ||||
to | ||||
programatically alter the Window z-order by calling the moveToFront | ||||
or | ||||
moveToBack member functions. Whereas if z ordering is disabled the | ||||
functions moveToFront and moveToBack are also precluded from affect | ||||
ing | ||||
the Window z position. | ||||
\param setting | \param setting | |||
- true if z-order changes are enabled for this window. | - true if z-order changes are enabled for this window. | |||
moveToFront/moveToBack work normally as expected. | moveToFront/moveToBack work normally as expected. | |||
- false: z-order changes are disabled for this window. | - false: z-order changes are disabled for this window. | |||
moveToFront/moveToBack are ignored for this window. | moveToFront/moveToBack are ignored for this window. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setZOrderingEnabled(bool setting); | void setZOrderingEnabled(bool setting); | |||
skipping to change at line 1946 | skipping to change at line 2085 | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setInheritsTooltipText(bool setting); | void setInheritsTooltipText(bool setting); | |||
/*! | /*! | |||
\brief | \brief | |||
Set whether this window will rise to the top of the z-order when cl icked | Set whether this window will rise to the top of the z-order when cl icked | |||
with the left mouse button. | with the left mouse button. | |||
\note | ||||
This is distinguished from the is/setZOrderingEnabled setting in th | ||||
at | ||||
if rise on click is disabled it only affects the users ability to a | ||||
ffect | ||||
the z order of the Window by clicking the mouse; is still possible | ||||
to | ||||
programatically alter the Window z-order by calling the moveToFront | ||||
or | ||||
moveToBack member functions. Whereas if z ordering is disabled the | ||||
functions moveToFront and moveToBack are also precluded from affect | ||||
ing | ||||
the Window z position. | ||||
\param setting | \param setting | |||
- true if the window should come to the top of other windows when t he | - true if the window should come to the top of other windows when t he | |||
left mouse button is pushed within its area. | left mouse button is pushed within its area. | |||
- false if the window should not change z-order position when the l eft | - false if the window should not change z-order position when the l eft | |||
mouse button is pushed within its area. | mouse button is pushed within its area. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; } | void setRiseOnClickEnabled(bool setting) { d_riseOnClick = setting; } | |||
skipping to change at line 2427 | skipping to change at line 2575 | |||
const UVector2& getMinSize() const; | const UVector2& getMinSize() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Causes the Window object to render itself and all of it's attached | Causes the Window object to render itself and all of it's attached | |||
children | children | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void render(void); | void render(); | |||
/*! | /*! | |||
\brief | \brief | |||
Cause window to update itself and any attached children. Client co de | Cause window to update itself and any attached children. Client co de | |||
does not need to call this method; to ensure full, and proper updat es, | does not need to call this method; to ensure full, and proper updat es, | |||
call the injectTimePulse methodname method provided by the System c lass. | call the injectTimePulse methodname method provided by the System c lass. | |||
\note | \note | |||
The update order is such that 'this' window is updated prior to any | The update order is such that 'this' window is updated prior to any | |||
child windows, this is so that child windows that access the parent in | child windows, this is so that child windows that access the parent in | |||
skipping to change at line 2469 | skipping to change at line 2617 | |||
virtual void writeXMLToStream(XMLSerializer& xml_stream) const; | virtual void writeXMLToStream(XMLSerializer& xml_stream) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Sets the internal 'initialising' flag to true. | Sets the internal 'initialising' flag to true. | |||
This can be use to optimize initialisation of some widgets, and is called | This can be use to optimize initialisation of some widgets, and is called | |||
automatically by the layout XML handler when it has created a windo w. | automatically by the layout XML handler when it has created a windo w. | |||
That is just after the window has been created, but before any chil dren or | That is just after the window has been created, but before any chil dren or | |||
properties are read. | properties are read. | |||
*/ | */ | |||
virtual void beginInitialisation(void) {d_initialising=true;} | virtual void beginInitialisation(void) {d_initialising = true;} | |||
/*! | /*! | |||
\brief | \brief | |||
Sets the internal 'initialising' flag to false. | Sets the internal 'initialising' flag to false. | |||
This is called automatically by the layout XML handler when it is d one | This is called automatically by the layout XML handler when it is d one | |||
creating a window. That is after all properties and children have b een | creating a window. That is after all properties and children have b een | |||
loaded and just before the next sibling gets created. | loaded and just before the next sibling gets created. | |||
*/ | */ | |||
virtual void endInitialisation(void) {d_initialising=false;} | virtual void endInitialisation(void) {d_initialising = false;} | |||
/*! | /*! | |||
\brief | \brief | |||
Sets whether this window should ignore mouse events and pass them | Sets whether this window should ignore mouse events and pass them | |||
through to any windows behind it. In effect making the window | through to any windows behind it. In effect making the window | |||
transparent to the mouse. | transparent to the mouse. | |||
\param setting | \param setting | |||
true if mouse pass through is enabled. | true if mouse pass through is enabled. | |||
false if mouse pass through is not enabled. | false if mouse pass through is not enabled. | |||
skipping to change at line 2534 | skipping to change at line 2682 | |||
String getWindowRendererName(void) const; | String getWindowRendererName(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Sets whether this window is allowed to write XML | Sets whether this window is allowed to write XML | |||
*/ | */ | |||
void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;} | void setWritingXMLAllowed(bool allow) {d_allowWriteXML = allow;} | |||
/*! | /*! | |||
\brief | \brief | |||
Recursively inform all children that the screen area has changed, a | Inform the window, and optionally all children, that screen area | |||
nd needs to be re-cached | rectangles have changed. | |||
\param recursive | ||||
- true to recursively call notifyScreenAreaChanged on attached chil | ||||
d | ||||
Window objects. | ||||
- false to just process \e this Window. | ||||
*/ | */ | |||
void notifyScreenAreaChanged(void); | void notifyScreenAreaChanged(bool recursive = true); | |||
/*! | /*! | |||
\brief | \brief | |||
Changes the widget's falagard type, thus changing its look'n'feel a nd optionally its | Changes the widget's falagard type, thus changing its look'n'feel a nd optionally its | |||
renderer in the process. | renderer in the process. | |||
\param type | \param type | |||
New look'n'feel of the widget | New look'n'feel of the widget | |||
\param type | \param type | |||
skipping to change at line 2562 | skipping to change at line 2716 | |||
\brief | \brief | |||
Specifies whether this Window object will receive events generated by | Specifies whether this Window object will receive events generated by | |||
the drag and drop support in the system. | the drag and drop support in the system. | |||
\param setting | \param setting | |||
- true to enable the Window as a drag and drop target. | - true to enable the Window as a drag and drop target. | |||
- false to disable the Window as a drag and drop target. | - false to disable the Window as a drag and drop target. | |||
*/ | */ | |||
void setDragDropTarget(bool setting); | void setDragDropTarget(bool setting); | |||
/*! | ||||
\brief | ||||
Set the RenderingSurface to be associated with this Window, or 0 if | ||||
none is required. | ||||
\par | ||||
If this function is called, and the option for automatic use of an | ||||
imagery caching RenderingSurface is enabled, any automatically crea | ||||
ted | ||||
RenderingSurface will be released, and the affore mentioned option | ||||
will | ||||
be disabled. | ||||
\par | ||||
If after having set a custom RenderingSurface you then subsequently | ||||
enable the automatic use of an imagery caching RenderingSurface by | ||||
calling setUsingAutoRenderingSurface, the previously set | ||||
RenderingSurface will be disassociated from the Window. Note that | ||||
the | ||||
previous RenderingSurface is not destroyed or cleaned up at all - t | ||||
his | ||||
is the job of whoever created that object initially. | ||||
\param target | ||||
Pointer to the RenderingSurface object to be associated with the wi | ||||
ndow. | ||||
*/ | ||||
void setRenderingSurface(RenderingSurface* surface); | ||||
/*! | ||||
\brief | ||||
Invalidate the chain of rendering surfaces from this window backwar | ||||
ds to | ||||
ensure they get properly redrawn - but doing the minimum amount of | ||||
work | ||||
possibe - next render. | ||||
*/ | ||||
void invalidateRenderingSurface(); | ||||
/*! | ||||
\brief | ||||
Sets whether \e automatic use of an imagery caching RenderingSurfac | ||||
e | ||||
(i.e. a RenderingWindow) is enabled for this window. The reason we | ||||
emphasise 'atutomatic' is because the client may manually set a | ||||
RenderingSurface that does exactlythe same job. | ||||
\par | ||||
Note that this setting really only controls whether the Window | ||||
automatically creates and manages the RenderingSurface, as opposed | ||||
to | ||||
the \e use of the RenderingSurface. If a RenderingSurfaceis set fo | ||||
r the | ||||
Window it will be used regardless of this setting. | ||||
\par | ||||
Enabling this option will cause the Window to attempt to create a | ||||
suitable RenderingSurface (which will actually be a RenderingWindow | ||||
). | ||||
If there is an existing RenderingSurface assocated with this Window | ||||
, it | ||||
will be removed as the Window's RenderingSurface | ||||
<em>but not destroyed</em>; whoever created the RenderingSurface in | ||||
the | ||||
first place should take care of its destruction. | ||||
\par | ||||
Disabling this option will cause any automatically created | ||||
RenderingSurface to be released. | ||||
\par | ||||
It is possible that the renderer in use may not support facilities | ||||
for | ||||
RenderingSurfaces that are suitable for full imagery caching. If t | ||||
his | ||||
is the case, then calling getRenderingSurface after enabling this o | ||||
ption | ||||
will return 0. In these cases this option will still show as being | ||||
'enabled', this is because Window \e settings should not be influen | ||||
ced | ||||
by capabilities the renderer in use; for example, this enables corr | ||||
ect | ||||
XML layouts to be written from a Window on a system that does not | ||||
support such RenderingSurfaces, so that the layout will function as | ||||
preferred on systems that do. | ||||
\par | ||||
If this option is enabled, and the client subsequently assigns a | ||||
different RenderingSurface to the Window, the existing automaticall | ||||
y | ||||
created RenderingSurface will be released and this setting will be | ||||
disabled. | ||||
\param setting | ||||
- true to enable automatic use of an imagery caching RenderingSurfa | ||||
ce. | ||||
- false to disable automatic use of an imagery caching RenderingSur | ||||
face. | ||||
*/ | ||||
void setUsingAutoRenderingSurface(bool setting); | ||||
//! set the rotations for this window. | ||||
void setRotation(const Vector3& rotation); | ||||
/*! | ||||
\brief | ||||
Set whether the Window is a non-client window. | ||||
A non-client window is clipped, positioned and sized according to t | ||||
he | ||||
parent window's full area as opposed to just the inner rect area us | ||||
ed | ||||
for normal client windows. | ||||
\param setting | ||||
- true if the window should be clipped, positioned and sized accord | ||||
ing | ||||
to the full area rectangle of it's parent. | ||||
- false if the window should be clipped, positioned and sized accor | ||||
ding | ||||
to the inner rect area of it's parent. | ||||
*/ | ||||
void setNonClientWindow(const bool setting); | ||||
//! Return the parsed RenderedString object for this window. | ||||
const RenderedString& getRenderedString() const; | ||||
//! Return a pointer to any custom RenderedStringParser set, or 0 if no | ||||
ne. | ||||
RenderedStringParser* getCustomRenderedStringParser() const; | ||||
//! Set a custom RenderedStringParser, or 0 to remove an existing one. | ||||
void setCustomRenderedStringParser(RenderedStringParser* parser); | ||||
//! return the active RenderedStringParser to be used | ||||
virtual RenderedStringParser& getRenderedStringParser() const; | ||||
//! return Vector2 \a pos after being fully unprojected for this Window | ||||
. | ||||
Vector2 getUnprojectedPosition(const Vector2& pos) const; | ||||
//! return the pointer to the BiDiVisualMapping for this window, if any | ||||
. | ||||
const BiDiVisualMapping* getBiDiVisualMapping() const | ||||
{return d_bidiVisualMapping;} | ||||
protected: | protected: | |||
/********************************************************************** | // friend classes for construction / initialisation purposes (for now) | |||
*** | ||||
System object can trigger events directly | ||||
*********************************************************************** | ||||
**/ | ||||
friend class System; | friend class System; | |||
friend class WindowManager; | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Event trigger methods | Event trigger methods | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called when the window's size changes. | Handler called when the window's size changes. | |||
\param e | \param e | |||
WindowEventArgs object whose 'window' pointer field is set to the w indow | WindowEventArgs object whose 'window' pointer field is set to the w indow | |||
skipping to change at line 3057 | skipping to change at line 3318 | |||
\brief | \brief | |||
Handler called when the currently attached window renderer object i s detached. | Handler called when the currently attached window renderer object i s detached. | |||
\param e | \param e | |||
WindowEventArgs object initialised as follows: | WindowEventArgs object initialised as follows: | |||
- window field is set to point to the Window object that just got l ost its | - window field is set to point to the Window object that just got l ost its | |||
window renderer. (typically 'this'). | window renderer. (typically 'this'). | |||
*/ | */ | |||
virtual void onWindowRendererDetached(WindowEventArgs& e); | virtual void onWindowRendererDetached(WindowEventArgs& e); | |||
/*! | ||||
\brief | ||||
Handler called when the window's rotation factor is changed. | ||||
\param e | ||||
WindowEventArgs object whose 'window' pointer field is set to the w | ||||
indow | ||||
that triggered the event. For this event the trigger window is alw | ||||
ays | ||||
'this'. | ||||
*/ | ||||
virtual void onRotated(WindowEventArgs& e); | ||||
/*! | ||||
\brief | ||||
Handler called when the window's non-client setting, affecting it's | ||||
position and size relative to it's parent is changed. | ||||
\param e | ||||
WindowEventArgs object whose 'window' pointer field is set to the w | ||||
indow | ||||
that triggered the event. For this event the trigger window is alw | ||||
ays | ||||
'this'. | ||||
*/ | ||||
virtual void onNonClientChanged(WindowEventArgs& e); | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation Functions | Implementation Functions | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Perform actual update processing for this Window. | Perform actual update processing for this Window. | |||
\param elapsed | \param elapsed | |||
float value indicating the number of seconds elapsed since the last | float value indicating the number of seconds elapsed since the last | |||
update call. | update call. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
virtual void updateSelf(float elapsed); | virtual void updateSelf(float elapsed); | |||
/*! | /*! | |||
\brief | \brief | |||
Perform the actual rendering for this Window. | Perform the actual rendering for this Window. | |||
\param z | \param ctx | |||
float value specifying the base Z co-ordinate that should be used w | RenderingContext holding the details of the RenderingSurface to be | |||
hen | used for the Window rendering operations. | |||
rendering | ||||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
virtual void drawSelf(float z); | virtual void drawSelf(const RenderingContext& ctx); | |||
/*! | ||||
\brief | ||||
Perform drawing operations concerned with generating and buffering | ||||
window geometry. | ||||
\note | ||||
This function is a sub-function of drawSelf; it is provided to make | ||||
it | ||||
easier to override drawSelf without needing to duplicate large sect | ||||
ions | ||||
of the code from the default implementation. | ||||
*/ | ||||
void bufferGeometry(const RenderingContext& ctx); | ||||
/*! | ||||
\brief | ||||
Perform drawing operations concerned with positioning, clipping and | ||||
queueing of window geometry to RenderingSurfaces. | ||||
\note | ||||
This function is a sub-function of drawSelf and is provided to make | ||||
it | ||||
easier to override drawSelf without needing to duplicate large sect | ||||
ions | ||||
of the code from the default implementation. | ||||
*/ | ||||
void queueGeometry(const RenderingContext& ctx); | ||||
/*! | /*! | |||
\brief | \brief | |||
Update the rendering cache. | Update the rendering cache. | |||
Populates the Window's RenderCache with imagery to be sent to the | Populates the Window's GeometryBuffer ready for rendering. | |||
renderer. | ||||
*/ | */ | |||
virtual void populateRenderCache() {} | virtual void populateGeometryBuffer() {} | |||
/*! | /*! | |||
\brief | \brief | |||
Return whether this window was inherited from the given class name at | Return whether this window was inherited from the given class name at | |||
some point in the inheritance hierarchy. | some point in the inheritance hierarchy. | |||
\param class_name | \param class_name | |||
The class name that is to be checked. | The class name that is to be checked. | |||
\return | \return | |||
true if this window was inherited from \a class_name. false if not. | true if this window was inherited from \a class_name. false if not. | |||
*/ | */ | |||
virtual bool testClassName_impl(const String& class_name) const | virtual bool testClassName_impl(const String& class_name) const | |||
{ | { | |||
if (class_name=="Window") return true; | if (class_name == "Window") return true; | |||
return false; | return false; | |||
} | } | |||
/*! | /*! | |||
\brief | \brief | |||
Set the parent window for this window object. | Set the parent window for this window object. | |||
\param parent | \param parent | |||
Pointer to a Window object that is to be assigned as the parent to this | Pointer to a Window object that is to be assigned as the parent to this | |||
Window. | Window. | |||
skipping to change at line 3170 | skipping to change at line 3477 | |||
*/ | */ | |||
bool isPropertyAtDefault(const Property* property) const; | bool isPropertyAtDefault(const Property* property) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Recursively inform all children that the clipping has changed and s creen rects | Recursively inform all children that the clipping has changed and s creen rects | |||
needs to be recached. | needs to be recached. | |||
*/ | */ | |||
void notifyClippingChanged(void); | void notifyClippingChanged(void); | |||
/********************************************************************** | //! helper to create and setup the auto RenderingWindow surface | |||
*** | void allocateRenderingWindow(); | |||
Implementation Data | ||||
*********************************************************************** | ||||
**/ | ||||
// child stuff | ||||
typedef std::vector<Window*> ChildList; | ||||
//! The list of child Window objects attached to this. | ||||
ChildList d_children; | ||||
//! Child window objects arranged in rendering order. | ||||
ChildList d_drawList; | ||||
// general data | ||||
//! Window that has captured inputs | ||||
static Window* d_captureWindow; | ||||
//! The Window that previously had capture (used for restoreOldCapture | ||||
mode) | ||||
Window* d_oldCapture; | ||||
//! Holds pointer to the parent window. | ||||
Window* d_parent; | ||||
//! Holds pointer to the Window objects current Font. | ||||
Font* d_font; | ||||
//! Holds the text / label / caption for this Window. | ||||
String d_text; | ||||
//! User ID assigned to this Window | ||||
uint d_ID; | ||||
//! Alpha transparency setting for the Window | ||||
float d_alpha; | ||||
//! This Window objects area as defined by a URect. | ||||
URect d_area; | ||||
//! Current constrained pixel size of the window. | ||||
Size d_pixelSize; | ||||
//! Holds pointer to the Window objects current mouse cursor image. | ||||
const Image* d_mouseCursor; | ||||
// user data | ||||
typedef std::map<String, String, String::FastLessCompare> UserStringM | ||||
ap; | ||||
//! Holds a collection of named user string values. | ||||
UserStringMap d_userStrings; | ||||
//! Holds pointer to some user assigned data. | ||||
void* d_userData; | ||||
// positional alignments | ||||
//! Specifies the base for horizontal alignment. | ||||
HorizontalAlignment d_horzAlign; | ||||
//! Specifies the base for vertical alignment. | ||||
VerticalAlignment d_vertAlign; | ||||
// maximum and minimum sizes | ||||
//! current minimum size for the window. | ||||
UVector2 d_minSize; | ||||
//! current maximum size for the window. | ||||
UVector2 d_maxSize; | ||||
// settings | ||||
//! true when Window is enabled | ||||
bool d_enabled; | ||||
/*! | ||||
\brief | ||||
true when Window is visible (that is it will be rendered, but may b | ||||
e | ||||
obscured so no necesarily really visible) | ||||
*/ | ||||
bool d_visible; | ||||
//! true when Window is the active Window (receiving inputs). | ||||
bool d_active; | ||||
//! true when Window will be clipped by parent Window area Rect. | ||||
bool d_clippedByParent; | ||||
//! true when Window will be auto-destroyed by parent. | ||||
bool d_destroyedByParent; | ||||
//! true if Window will be drawn on top of all other Windows | ||||
bool d_alwaysOnTop; | ||||
//! true if the Window inherits alpha from the parent Window | ||||
bool d_inheritsAlpha; | ||||
/*! | ||||
\brief | ||||
true if the Window restores capture to the previous window when it | ||||
releases capture. | ||||
*/ | ||||
bool d_restoreOldCapture; | ||||
//! true if the Window responds to z-order change requests. | ||||
bool d_zOrderingEnabled; | ||||
//! true if the Window wishes to hear about multi-click mouse events. | ||||
bool d_wantsMultiClicks; | ||||
/*! | ||||
\brief | ||||
true if unhandled captured inputs should be distributed to child | ||||
windows. | ||||
*/ | ||||
bool d_distCapturedInputs; | ||||
/*! | ||||
\brief | ||||
True if the window should come to the front of the z order in respo | ||||
nse | ||||
to a left mouse button down event. | ||||
*/ | ||||
bool d_riseOnClick; | ||||
// mouse button autorepeat data | ||||
/*! | ||||
\brief | ||||
true if button will auto-repeat mouse button down events while mous | ||||
e | ||||
button is held down. | ||||
*/ | ||||
bool d_autoRepeat; | ||||
//! seconds before first repeat event is fired | ||||
float d_repeatDelay; | ||||
//! secons between further repeats after delay has expired. | ||||
float d_repeatRate; | ||||
//! implements repeating - is true after delay has elapsed, | ||||
bool d_repeating; | ||||
//! implements repeating - tracks time elapsed. | ||||
float d_repeatElapsed; | ||||
/*! | ||||
\brief | ||||
Button we're tracking (implication of this is that we only support | ||||
one | ||||
button at a time). | ||||
*/ | ||||
MouseButton d_repeatButton; | ||||
//! true if window will receive drag and drop related notifications | ||||
bool d_dragDropTarget; | ||||
// Tooltip stuff | ||||
//! Text string used as tip for this window. | ||||
String d_tooltipText; | ||||
//! Possible custom Tooltip for this window. | ||||
Tooltip* d_customTip; | ||||
//! true if this Window created the custom Tooltip. | ||||
bool d_weOwnTip; | ||||
/*! | ||||
\brief | ||||
true if the Window inherits tooltip text from its parent (when none | ||||
set | ||||
for itself). | ||||
*/ | ||||
bool d_inheritsTipText; | ||||
// rendering | ||||
//! Object which acts as a cache for Images to be drawn by this Window. | ||||
RenderCache d_renderCache; | ||||
//! true if window image cache needs to be regenerated. | ||||
mutable bool d_needsRedraw; | ||||
// Look'N'Feel stuff | ||||
//! Name of the Look assigned to this window (if any). | ||||
String d_lookName; | ||||
//! The WindowRenderer module that implements the Look'N'Feel specifica | ||||
tion | ||||
WindowRenderer* d_windowRenderer; | ||||
//! true when this window is currently being initialised (creating chil | ||||
dren etc) | ||||
bool d_initialising; | ||||
//! true when this window is being destroyed. | ||||
bool d_destructionStarted; | ||||
// Event pass through | ||||
/*! | ||||
\brief | ||||
true if this window can never be "hit" by the cursor. | ||||
false for normal mouse event handling. | ||||
*/ | ||||
bool d_mousePassThroughEnabled; | ||||
//! true when this window is an auto-window (it's name contains __auto_ | ||||
) | ||||
bool d_autoWindow; | ||||
/*! | ||||
\brief | ||||
std::set used to determine whether a window should write a property | ||||
to XML or not. | ||||
if the property name is present the property will not be written | ||||
*/ | ||||
typedef std::set<String, String::FastLessCompare> BannedXMLPropertySet; | ||||
BannedXMLPropertySet d_bannedXMLProperties; | ||||
//! true if this window is allowed to write XML, false if not | ||||
bool d_allowWriteXML; | ||||
//! current unclipped screen rect in pixels | //! helper to clean up the auto RenderingWindow surface | |||
mutable Rect d_screenUnclippedRect; | void releaseRenderingWindow(); | |||
mutable bool d_screenUnclippedRectValid; | ||||
//! current unclipped inner screen rect in pixels | ||||
mutable Rect d_screenUnclippedInnerRect; | ||||
mutable bool d_screenUnclippedInnerRectValid; | ||||
//! current fully clipped screen rect in pixels | ||||
mutable Rect d_screenRect; | ||||
mutable bool d_screenRectValid; | ||||
//! current fully clipped inner screen rect in pixels | ||||
mutable Rect d_screenInnerRect; | ||||
mutable bool d_screenInnerRectValid; | ||||
protected: | //! Helper to intialise the needed clipping for geometry and render sur | |||
/********************************************************************** | face. | |||
*** | void initialiseClippers(const RenderingContext& ctx); | |||
Properties for Window base class | ||||
*********************************************************************** | ||||
**/ | ||||
static WindowProperties::Alpha d_alphaProperty; | ||||
static WindowProperties::AlwaysOnTop d_alwaysOnTopProperty; | ||||
static WindowProperties::ClippedByParent d_clippedByParentProperty; | ||||
static WindowProperties::DestroyedByParent d_destroyedByParentProperty | ||||
; | ||||
static WindowProperties::Disabled d_disabledProperty; | ||||
static WindowProperties::Font d_fontProperty; | ||||
static WindowProperties::ID d_IDProperty; | ||||
static WindowProperties::InheritsAlpha d_inheritsAlphaProperty; | ||||
static WindowProperties::MouseCursorImage d_mouseCursorProperty; | ||||
static WindowProperties::RestoreOldCapture d_restoreOldCaptureProperty | ||||
; | ||||
static WindowProperties::Text d_textProperty; | ||||
static WindowProperties::Visible d_visibleProperty; | ||||
static WindowProperties::ZOrderChangeEnabled d_zOrderChangeProperty; | ||||
static WindowProperties::WantsMultiClickEvents d_wantsMultiClicksPrope | ||||
rty; | ||||
static WindowProperties::MouseButtonDownAutoRepeat d_autoRepeatPropert | ||||
y; | ||||
static WindowProperties::AutoRepeatDelay d_autoRepeatDelayProperty; | ||||
static WindowProperties::AutoRepeatRate d_autoRepeatRateProperty; | ||||
static WindowProperties::DistributeCapturedInputs d_distInputsProperty | ||||
; | ||||
static WindowProperties::CustomTooltipType d_tooltipTypeProperty; | ||||
static WindowProperties::Tooltip d_tooltipProperty; | ||||
static WindowProperties::InheritsTooltipText d_inheritsTooltipProperty | ||||
; | ||||
static WindowProperties::RiseOnClick d_riseOnClickProperty; | ||||
static WindowProperties::VerticalAlignment d_vertAlignProperty; | ||||
static WindowProperties::HorizontalAlignment d_horzAlignProperty; | ||||
static WindowProperties::UnifiedAreaRect d_unifiedAreaRectProperty; | ||||
static WindowProperties::UnifiedPosition d_unifiedPositionProperty; | ||||
static WindowProperties::UnifiedXPosition d_unifiedXPositionProperty; | ||||
static WindowProperties::UnifiedYPosition d_unifiedYPositionProperty; | ||||
static WindowProperties::UnifiedSize d_unifiedSizeProperty; | ||||
static WindowProperties::UnifiedWidth d_unifiedWidthProperty; | ||||
static WindowProperties::UnifiedHeight d_unifiedHeightProperty; | ||||
static WindowProperties::UnifiedMinSize d_unifiedMinSizeProperty; | ||||
static WindowProperties::UnifiedMaxSize d_unifiedMaxSizeProperty; | ||||
static WindowProperties::MousePassThroughEnabled d_mousePassThroughE | ||||
nabledProperty; | ||||
static WindowProperties::WindowRenderer d_windowRendererProperty; | ||||
static WindowProperties::LookNFeel d_lookNFeelProperty; | ||||
static WindowProperties::DragDropTarget d_dragDropTargetProperty; | ||||
/********************************************************************** | ||||
*** | ||||
implementation functions | ||||
*********************************************************************** | ||||
**/ | ||||
/*! | /*! | |||
\brief | \brief | |||
Cleanup child windows | Cleanup child windows | |||
*/ | */ | |||
virtual void cleanupChildren(void); | virtual void cleanupChildren(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Add given window to child list at an appropriate position | Add given window to child list at an appropriate position | |||
*/ | */ | |||
skipping to change at line 3471 | skipping to change at line 3528 | |||
Implements move to front behavior. | Implements move to front behavior. | |||
\return | \return | |||
Should return true if some action was taken, or false if there was | Should return true if some action was taken, or false if there was | |||
nothing to be done. | nothing to be done. | |||
*/ | */ | |||
virtual bool moveToFront_impl(bool wasClicked); | virtual bool moveToFront_impl(bool wasClicked); | |||
/*! | /*! | |||
\brief | \brief | |||
Implementation of rise on click functionality. | ||||
\return | ||||
true if we did something, false if there was nothing to do. | ||||
*/ | ||||
bool doRiseOnClick(void); | ||||
/*! | ||||
\brief | ||||
Implementation method to modify window area while correctly applyin g | Implementation method to modify window area while correctly applyin g | |||
min / max size processing, and firing any appropriate events. | min / max size processing, and firing any appropriate events. | |||
/note | /note | |||
This is the implementation function for setting size and position. | This is the implementation function for setting size and position. | |||
In order to simplify area management, from this point on, all | In order to simplify area management, from this point on, all | |||
modifications to window size and position (area rect) should come | modifications to window size and position (area rect) should come | |||
through here. | through here. | |||
/param pos | /param pos | |||
skipping to change at line 3508 | skipping to change at line 3556 | |||
inhibited if size is at max or min. | inhibited if size is at max or min. | |||
- false to indicate the operation is not a strict sizing operation on | - false to indicate the operation is not a strict sizing operation on | |||
the top and/or left edges and that the window position may change as | the top and/or left edges and that the window position may change as | |||
required | required | |||
/param fireEvents | /param fireEvents | |||
- true if events should be fired as normal. | - true if events should be fired as normal. | |||
- false to inhibit firing of events (required, for example, if you need | - false to inhibit firing of events (required, for example, if you need | |||
to call this from the onSize/onMove handlers). | to call this from the onSize/onMove handlers). | |||
*/ | */ | |||
void setArea_impl(const UVector2& pos, const UVector2& size, bool topLe | void setArea_impl(const UVector2& pos, const UVector2& size, | |||
ftSizing = false, bool fireEvents = true); | bool topLeftSizing = false, bool fireEvents = true); | |||
/*! | /*! | |||
\brief | \brief | |||
Add the given window to the drawing list at an appropriate position for | Add the given window to the drawing list at an appropriate position for | |||
it's settings and the required direction. Basically, when \a at_ba ck | it's settings and the required direction. Basically, when \a at_ba ck | |||
is false, the window will appear in front of all other windows with the | is false, the window will appear in front of all other windows with the | |||
same 'always on top' setting. When \a at_back is true, the window will | same 'always on top' setting. When \a at_back is true, the window will | |||
appear behind all other windows wih the same 'always on top' settin g. | appear behind all other windows wih the same 'always on top' settin g. | |||
\param wnd | \param wnd | |||
skipping to change at line 3557 | skipping to change at line 3606 | |||
correctly take into account 'Always on top' windows as needed. | correctly take into account 'Always on top' windows as needed. | |||
\return | \return | |||
- true if the Window is at the top of the z-order in relation to si bling | - true if the Window is at the top of the z-order in relation to si bling | |||
windows with the same 'always on top' setting. | windows with the same 'always on top' setting. | |||
- false if the Window is not at the top of the z-order in relation to | - false if the Window is not at the top of the z-order in relation to | |||
sibling windows with the same 'always on top' setting. | sibling windows with the same 'always on top' setting. | |||
*/ | */ | |||
bool isTopOfZOrder() const; | bool isTopOfZOrder() const; | |||
/*! | ||||
\brief | ||||
Update position and clip region on this Windows geometry / renderin | ||||
g | ||||
surface. | ||||
*/ | ||||
void updateGeometryRenderSettings(); | ||||
//! transfer RenderingSurfaces to be owned by our target RenderingSurfa | ||||
ce. | ||||
void transferChildSurfaces(); | ||||
//! helper function for calculating clipping rectangles. | ||||
Rect getParentElementClipIntersection(const Rect& unclipped_area) const | ||||
; | ||||
virtual int writePropertiesXML(XMLSerializer& xml_stream) const; | virtual int writePropertiesXML(XMLSerializer& xml_stream) const; | |||
virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const; | virtual int writeChildWindowsXML(XMLSerializer& xml_stream) const; | |||
virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const; | virtual bool writeAutoChildWindowXML(XMLSerializer& xml_stream) const; | |||
/********************************************************************** *** | /********************************************************************** *** | |||
May not copy or assign Window objects | Properties for Window base class | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
Window(const Window& wnd) : PropertySet(), EventSet() {} | static WindowProperties::Alpha d_alphaProperty; | |||
Window& operator=(const Window& wnd) {return *this;} | static WindowProperties::AlwaysOnTop d_alwaysOnTopProperty; | |||
static WindowProperties::ClippedByParent d_clippedByParentProperty; | ||||
static WindowProperties::DestroyedByParent d_destroyedByParentProperty | ||||
; | ||||
static WindowProperties::Disabled d_disabledProperty; | ||||
static WindowProperties::Font d_fontProperty; | ||||
static WindowProperties::ID d_IDProperty; | ||||
static WindowProperties::InheritsAlpha d_inheritsAlphaProperty; | ||||
static WindowProperties::MouseCursorImage d_mouseCursorProperty; | ||||
static WindowProperties::RestoreOldCapture d_restoreOldCaptureProperty | ||||
; | ||||
static WindowProperties::Text d_textProperty; | ||||
static WindowProperties::Visible d_visibleProperty; | ||||
static WindowProperties::ZOrderChangeEnabled d_zOrderChangeProperty; | ||||
static WindowProperties::WantsMultiClickEvents d_wantsMultiClicksPrope | ||||
rty; | ||||
static WindowProperties::MouseButtonDownAutoRepeat d_autoRepeatPropert | ||||
y; | ||||
static WindowProperties::AutoRepeatDelay d_autoRepeatDelayProperty; | ||||
static WindowProperties::AutoRepeatRate d_autoRepeatRateProperty; | ||||
static WindowProperties::DistributeCapturedInputs d_distInputsProperty | ||||
; | ||||
static WindowProperties::CustomTooltipType d_tooltipTypeProperty; | ||||
static WindowProperties::Tooltip d_tooltipProperty; | ||||
static WindowProperties::InheritsTooltipText d_inheritsTooltipProperty | ||||
; | ||||
static WindowProperties::RiseOnClick d_riseOnClickProperty; | ||||
static WindowProperties::VerticalAlignment d_vertAlignProperty; | ||||
static WindowProperties::HorizontalAlignment d_horzAlignProperty; | ||||
static WindowProperties::UnifiedAreaRect d_unifiedAreaRectProperty; | ||||
static WindowProperties::UnifiedPosition d_unifiedPositionProperty; | ||||
static WindowProperties::UnifiedXPosition d_unifiedXPositionProperty; | ||||
static WindowProperties::UnifiedYPosition d_unifiedYPositionProperty; | ||||
static WindowProperties::UnifiedSize d_unifiedSizeProperty; | ||||
static WindowProperties::UnifiedWidth d_unifiedWidthProperty; | ||||
static WindowProperties::UnifiedHeight d_unifiedHeightProperty; | ||||
static WindowProperties::UnifiedMinSize d_unifiedMinSizeProperty; | ||||
static WindowProperties::UnifiedMaxSize d_unifiedMaxSizeProperty; | ||||
static WindowProperties::MousePassThroughEnabled d_mousePassThroughE | ||||
nabledProperty; | ||||
static WindowProperties::WindowRenderer d_windowRendererProperty; | ||||
static WindowProperties::LookNFeel d_lookNFeelProperty; | ||||
static WindowProperties::DragDropTarget d_dragDropTargetProperty; | ||||
static WindowProperties::AutoRenderingSurface d_autoRenderingSurfacePr | ||||
operty; | ||||
static WindowProperties::Rotation d_rotationProperty; | ||||
static WindowProperties::XRotation d_xRotationProperty; | ||||
static WindowProperties::YRotation d_yRotationProperty; | ||||
static WindowProperties::ZRotation d_zRotationProperty; | ||||
static WindowProperties::NonClient d_nonClientProperty; | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Private implementation Data | Implementation Data | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | //! definition of type used for the list of attached child windows. | |||
\brief | typedef std::vector<Window*> ChildList; | |||
String holding the type name for the Window | //! definition of type used for the UserString dictionary. | |||
(is also the name of the WindowFactory that created us) | typedef std::map<String, String, String::FastLessCompare> UserStringMap | |||
*/ | ; | |||
const String d_type; | //! definition of type used to track properties banned from writing XML | |||
. | ||||
typedef std::set<String, String::FastLessCompare> BannedXMLPropertySet; | ||||
//! type of Window (also the name of the WindowFactory that created us) | ||||
const String d_type; | ||||
//! The name of the window (GUI system unique). | //! The name of the window (GUI system unique). | |||
String d_name; | String d_name; | |||
//! Type name of the window as defined in a Falagard mapping. | //! Type name of the window as defined in a Falagard mapping. | |||
String d_falagardType; | String d_falagardType; | |||
//! true when this window is an auto-window (it's name contains __auto_ | ||||
) | ||||
bool d_autoWindow; | ||||
//! The prefix used on this window (if any) when created instanced w | //! true when this window is currently being initialised (creating chil | |||
indows. | dren etc) | |||
String d_windowPrefix; | bool d_initialising; | |||
//! true when this window is being destroyed. | ||||
bool d_destructionStarted; | ||||
//! true when Window is enabled | ||||
bool d_enabled; | ||||
//! is window visible (i.e. it will be rendered, but may still be obscu | ||||
red) | ||||
bool d_visible; | ||||
//! true when Window is the active Window (receiving inputs). | ||||
bool d_active; | ||||
friend class WindowManager; | //! The list of child Window objects attached to this. | |||
ChildList d_children; | ||||
//! Child window objects arranged in rendering order. | ||||
ChildList d_drawList; | ||||
//! Holds pointer to the parent window. | ||||
Window* d_parent; | ||||
//! true when Window will be auto-destroyed by parent. | ||||
bool d_destroyedByParent; | ||||
//! true when Window will be clipped by parent Window area Rect. | ||||
bool d_clippedByParent; | ||||
//! true if Window is in non-client (outside InnerRect) area of parent. | ||||
bool d_nonClientContent; | ||||
//! Name of the Look assigned to this window (if any). | ||||
String d_lookName; | ||||
//! The WindowRenderer module that implements the Look'N'Feel specifica | ||||
tion | ||||
WindowRenderer* d_windowRenderer; | ||||
//! Object which acts as a cache of geometry drawn by this Window. | ||||
GeometryBuffer* d_geometry; | ||||
//! RenderingSurface owned by this window (may be 0) | ||||
RenderingSurface* d_surface; | ||||
//! true if window geometry cache needs to be regenerated. | ||||
mutable bool d_needsRedraw; | ||||
//! holds setting for automatic creation of of surface (RenderingWindow | ||||
) | ||||
bool d_autoRenderingWindow; | ||||
//! Holds pointer to the Window objects current mouse cursor image. | ||||
const Image* d_mouseCursor; | ||||
//! Alpha transparency setting for the Window | ||||
float d_alpha; | ||||
//! true if the Window inherits alpha from the parent Window | ||||
bool d_inheritsAlpha; | ||||
//! Window that has captured inputs | ||||
static Window* d_captureWindow; | ||||
//! The Window that previously had capture (used for restoreOldCapture | ||||
mode) | ||||
Window* d_oldCapture; | ||||
//! Restore capture to the previous capture window when releasing captu | ||||
re. | ||||
bool d_restoreOldCapture; | ||||
//! Whether to distribute captured inputs to child windows. | ||||
bool d_distCapturedInputs; | ||||
//! Holds pointer to the Window objects current Font. | ||||
Font* d_font; | ||||
//! Holds the text / label / caption for this Window. | ||||
String d_textLogical; | ||||
//! pointer to bidirection support object | ||||
BiDiVisualMapping* d_bidiVisualMapping; | ||||
//! whether bidi visual mapping has been updated since last text change | ||||
. | ||||
mutable bool d_bidiDataValid; | ||||
//! RenderedString representation of text string as ouput from a parser | ||||
. | ||||
mutable RenderedString d_renderedString; | ||||
//! true if d_renderedString is valid, false if needs re-parse. | ||||
mutable bool d_renderedStringValid; | ||||
//! Shared instance of a parser to be used in most instances. | ||||
static BasicRenderedStringParser d_basicStringParser; | ||||
//! Pointer to a custom (user assigned) RenderedStringParser object. | ||||
RenderedStringParser* d_customStringParser; | ||||
//! User ID assigned to this Window | ||||
uint d_ID; | ||||
//! Holds pointer to some user assigned data. | ||||
void* d_userData; | ||||
//! Holds a collection of named user string values. | ||||
UserStringMap d_userStrings; | ||||
//! true if Window will be drawn on top of all other Windows | ||||
bool d_alwaysOnTop; | ||||
//! whether window should rise in the z order when left clicked. | ||||
bool d_riseOnClick; | ||||
//! true if the Window responds to z-order change requests. | ||||
bool d_zOrderingEnabled; | ||||
//! true if the Window wishes to hear about multi-click mouse events. | ||||
bool d_wantsMultiClicks; | ||||
//! whether (most) mouse events pass through this window | ||||
bool d_mousePassThroughEnabled; | ||||
//! whether pressed mouse button will auto-repeat the down event. | ||||
bool d_autoRepeat; | ||||
//! seconds before first repeat event is fired | ||||
float d_repeatDelay; | ||||
//! secons between further repeats after delay has expired. | ||||
float d_repeatRate; | ||||
//! button we're tracking for auto-repeat purposes. | ||||
MouseButton d_repeatButton; | ||||
//! implements repeating - is true after delay has elapsed, | ||||
bool d_repeating; | ||||
//! implements repeating - tracks time elapsed. | ||||
float d_repeatElapsed; | ||||
//! true if window will receive drag and drop related notifications | ||||
bool d_dragDropTarget; | ||||
//! Text string used as tip for this window. | ||||
String d_tooltipText; | ||||
//! Possible custom Tooltip for this window. | ||||
Tooltip* d_customTip; | ||||
//! true if this Window created the custom Tooltip. | ||||
bool d_weOwnTip; | ||||
//! whether tooltip text may be inherited from parent. | ||||
bool d_inheritsTipText; | ||||
//! true if this window is allowed to write XML, false if not | ||||
bool d_allowWriteXML; | ||||
//! collection of properties not to be written to XML for this window. | ||||
BannedXMLPropertySet d_bannedXMLProperties; | ||||
//! This Window objects area as defined by a URect. | ||||
URect d_area; | ||||
//! Current constrained pixel size of the window. | ||||
Size d_pixelSize; | ||||
//! current minimum size for the window. | ||||
UVector2 d_minSize; | ||||
//! current maximum size for the window. | ||||
UVector2 d_maxSize; | ||||
//! Specifies the base for horizontal alignment. | ||||
HorizontalAlignment d_horzAlign; | ||||
//! Specifies the base for vertical alignment. | ||||
VerticalAlignment d_vertAlign; | ||||
//! Rotation angles for this window | ||||
Vector3 d_rotation; | ||||
//! outer area rect in screen pixels | ||||
mutable Rect d_outerUnclippedRect; | ||||
//! inner area rect in screen pixels | ||||
mutable Rect d_innerUnclippedRect; | ||||
//! outer area clipping rect in screen pixels | ||||
mutable Rect d_outerRectClipper; | ||||
//! inner area clipping rect in screen pixels | ||||
mutable Rect d_innerRectClipper; | ||||
//! area rect used for hit-testing agains this window | ||||
mutable Rect d_hitTestRect; | ||||
mutable bool d_outerUnclippedRectValid; | ||||
mutable bool d_innerUnclippedRectValid; | ||||
mutable bool d_outerRectClipperValid; | ||||
mutable bool d_innerRectClipperValid; | ||||
mutable bool d_hitTestRectValid; | ||||
private: | ||||
/********************************************************************** | ||||
*** | ||||
May not copy or assign Window objects | ||||
*********************************************************************** | ||||
**/ | ||||
Window(const Window&) : PropertySet(), EventSet() {} | ||||
Window& operator=(const Window&) {return *this;} | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIWindow_h_ | #endif // end of guard _CEGUIWindow_h_ | |||
End of changes. 76 change blocks. | ||||
428 lines changed or deleted | 753 lines changed or added | |||
CEGUIWindowFactory.h | CEGUIWindowFactory.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIWindowFactory.h | filename: CEGUIWindowFactory.h | |||
created: 21/2/2004 | created: 21/2/2004 | |||
author: Paul D Turner | author: Paul D Turner | |||
purpose: Defines abstract base class for WindowFactory object s | purpose: Defines abstract base class for WindowFactory objects | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
skipping to change at line 57 | skipping to change at line 57 | |||
CEGUI_DECLARE_WINDOW_FACTORY(MyWidget); | CEGUI_DECLARE_WINDOW_FACTORY(MyWidget); | |||
Would generate a factory class named MyWidgetFactory. | Would generate a factory class named MyWidgetFactory. | |||
The factory is automatically instantiated and for the example it would | The factory is automatically instantiated and for the example it would | |||
be available as: | be available as: | |||
WindowFactory* wf = &(getMyWidgetFactory()); | WindowFactory* wf = &(getMyWidgetFactory()); | |||
or | or | |||
WindowFactory* wf = &CEGUI_WINDOW_FACTORY(MyWidget); | WindowFactory* wf = &CEGUI_WINDOW_FACTORY(MyWidget); | |||
*/ | */ | |||
#define CEGUI_DECLARE_WINDOW_FACTORY( T )\ | #define CEGUI_DECLARE_WINDOW_FACTORY( T )\ | |||
class T ## Factory : public WindowFactory\ | class T ## Factory : public WindowFactory\ | |||
{\ | ||||
public:\ | ||||
T ## Factory() : WindowFactory( T::WidgetTypeName ) {}\ | ||||
Window* createWindow(const String& name)\ | ||||
{\ | ||||
return new T (d_type, name);\ | ||||
}\ | ||||
void destroyWindow(Window* window)\ | ||||
{\ | {\ | |||
delete window;\ | public:\ | |||
}\ | T ## Factory() : WindowFactory( T::WidgetTypeName ) {}\ | |||
};\ | Window* createWindow(const String& name)\ | |||
T ## Factory& get ## T ## Factory(); | {\ | |||
return new T (d_type, name);\ | ||||
}\ | ||||
void destroyWindow(Window* window)\ | ||||
{\ | ||||
delete window;\ | ||||
}\ | ||||
};\ | ||||
T ## Factory& get ## T ## Factory(); | ||||
/*! | /*! | |||
\brief | \brief | |||
Generates code for the constructor for the instance of the window facto | Generates code for the constructor for the instance of the window facto | |||
ry generated | ry | |||
from the class name \a T | generated from the class name \a T | |||
*/ | */ | |||
#define CEGUI_DEFINE_WINDOW_FACTORY( T )\ | #define CEGUI_DEFINE_WINDOW_FACTORY( T )\ | |||
T ## Factory& get ## T ## Factory()\ | T ## Factory& get ## T ## Factory()\ | |||
{\ | {\ | |||
static T ## Factory s_factory;\ | static T ## Factory s_factory;\ | |||
return s_factory;\ | return s_factory;\ | |||
} | } | |||
/*! | /*! | |||
\brief | \brief | |||
Helper macro that return the real factory class name from a given class | Helper macro that return the real factory class name from a given class | |||
name \a T | name \a T | |||
*/ | */ | |||
#define CEGUI_WINDOW_FACTORY( T ) (get ## T ## Factory()) | #define CEGUI_WINDOW_FACTORY( T ) (get ## T ## Factory()) | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
Abstract class that defines the required interface for all WindowFac | Abstract class that defines the required interface for all WindowFactor | |||
tory objects | y | |||
objects. | ||||
A WindowFactory is used to create and destroy windows of a specific | A WindowFactory is used to create and destroy windows of a specific typ | |||
type. For every | e. | |||
type of Window object wihin the system (widgets, dialogs, movable wi | For every type of Window object wihin the system (widgets, dialogs, mov | |||
ndows etc) there | able | |||
must be an associated WindowFactory registered with the WindowManage | windows etc) there must be an associated WindowFactory registered with | |||
r so that the system | the | |||
knows how to create and destroy those types of Window base object. | WindowFactoryManager so that the system knows how to create and destroy | |||
those types of Window base object. | ||||
\note | ||||
The use if of the CEGUI_DECLARE_WINDOW_FACTORY, CEGUI_DEFINE_WINDOW_FAC | ||||
TORY | ||||
and CEGUI_WINDOW_FACTORY macros is deprecated in favour of the | ||||
template class TplWindowFactory and templatised | ||||
WindowFactoryManager::addFactory function, whereby you no longer need t | ||||
o | ||||
directly create any supporting structure for your new window type, and | ||||
can | ||||
simply do: | ||||
\code | ||||
CEGUI::WindowFactoryManager::addFactory<TplWindowFactory<MyWidget> >(); | ||||
\endcode | ||||
*/ | */ | |||
class CEGUIEXPORT WindowFactory | class CEGUIEXPORT WindowFactory | |||
{ | { | |||
public: | public: | |||
/*! | /*! | |||
\brief | \brief | |||
Create a new Window object of whatever type this WindowFacto | Create a new Window object of whatever type this WindowFactory prod | |||
ry produces. | uces. | |||
\param name | \param name | |||
A unique name that is to be assigned to the newly created Wi | A unique name that is to be assigned to the newly created Window ob | |||
ndow object | ject | |||
\return | \return | |||
Pointer to the new Window object. | Pointer to the new Window object. | |||
*/ | */ | |||
virtual Window* createWindow(const String& name) = 0; | virtual Window* createWindow(const String& name) = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Destroys the given Window object. | Destroys the given Window object. | |||
\param window | \param window | |||
Pointer to the Window object to be destroyed. | Pointer to the Window object to be destroyed. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
virtual void destroyWindow(Window* window) = 0; | virtual void destroyWindow(Window* window) = 0; | |||
/*! | /*! | |||
\brief | \brief | |||
Get the string that describes the type of Window object this | Get the string that describes the type of Window object this | |||
WindowFactory produces. | WindowFactory produces. | |||
\return | \return | |||
String object that contains the unique Window object type pr | String object that contains the unique Window object type produced | |||
oduced by this WindowFactory | by | |||
*/ | this WindowFactory | |||
const String& getTypeName(void) const {return d_type;} | */ | |||
const String& getTypeName() const | ||||
{ return d_type; } | ||||
protected: | //! Destructor. | |||
/******************************************************************* | virtual ~WindowFactory() | |||
****** | {} | |||
Construction and Destruction | ||||
******************************************************************** | ||||
*****/ | ||||
WindowFactory(const String& type) : d_type(type) {} | ||||
public: // luabind compatibility | protected: | |||
virtual ~WindowFactory(void) {} | //! Constructor | |||
WindowFactory(const String& type) : | ||||
d_type(type) | ||||
{} | ||||
protected: | protected: | |||
/******************************************************************* | //! String holding the type of object created by this factory. | |||
****** | String d_type; | |||
Implementation Data | ||||
******************************************************************** | ||||
*****/ | ||||
String d_type; //!< String holding the type of obje | ||||
ct created by this factory | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIWindowFactory_h_ | #endif // end of guard _CEGUIWindowFactory_h_ | |||
End of changes. 21 change blocks. | ||||
81 lines changed or deleted | 93 lines changed or added | |||
CEGUIWindowFactoryManager.h | CEGUIWindowFactoryManager.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIWindowFactoryManager_h_ | #ifndef _CEGUIWindowFactoryManager_h_ | |||
#define _CEGUIWindowFactoryManager_h_ | #define _CEGUIWindowFactoryManager_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
#include "CEGUILogger.h" | #include "CEGUILogger.h" | |||
#include "CEGUIIteratorBase.h" | #include "CEGUIIteratorBase.h" | |||
#include "CEGUIWindowFactory.h" | ||||
#include <map> | #include <map> | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
skipping to change at line 124 | skipping to change at line 125 | |||
TargetTypeStack d_targetStack; //!< Container holdi ng the target types. | TargetTypeStack d_targetStack; //!< Container holdi ng the target types. | |||
}; | }; | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Construction and Destruction | Construction and Destruction | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
/*! | /*! | |||
\brief | \brief | |||
Constructs a new WindowFactoryManager object. | Constructs a new WindowFactoryManager object. | |||
*/ | */ | |||
WindowFactoryManager(void) | WindowFactoryManager(void); | |||
{ | ||||
Logger::getSingleton().logEvent("CEGUI::WindowFactoryManager | ||||
singleton created"); | ||||
} | ||||
/*! | /*! | |||
\brief | \brief | |||
Destructor for WindowFactoryManager objects | Destructor for WindowFactoryManager objects | |||
*/ | */ | |||
~WindowFactoryManager(void) | ~WindowFactoryManager(void) | |||
{ | { | |||
Logger::getSingleton().logEvent("CEGUI::WindowFactoryManager singleton destroyed"); | Logger::getSingleton().logEvent("CEGUI::WindowFactoryManager singleton destroyed"); | |||
} | } | |||
skipping to change at line 156 | skipping to change at line 154 | |||
Pointer to the WindowFactory to be added to the WindowManage r. | Pointer to the WindowFactory to be added to the WindowManage r. | |||
\return | \return | |||
Nothing | Nothing | |||
\exception NullObjectException \a factory was null. | \exception NullObjectException \a factory was null. | |||
\exception AlreadyExistsException \a factory provided a Window type name which is in use by another registered WindowFactory. | \exception AlreadyExistsException \a factory provided a Window type name which is in use by another registered WindowFactory. | |||
*/ | */ | |||
void addFactory(WindowFactory* factory); | void addFactory(WindowFactory* factory); | |||
/*! | ||||
\brief | ||||
Creates a WindowFactory of the type \a T and adds it to the system | ||||
for | ||||
use. The created WindowFactory will automatically be deleted when | ||||
the | ||||
factory is removed from the system (either directly or at system | ||||
deletion time). | ||||
\tparam T | ||||
Specifies the type of WindowFactory subclass to add a factory for. | ||||
\return | ||||
Nothing | ||||
*/ | ||||
template <typename T> | ||||
static void addFactory(); | ||||
/*! | /*! | |||
\brief | \brief | |||
Removes a WindowFactory from the list of registered factorie s. | Removes a WindowFactory from the list of registered factorie s. | |||
\note | \note | |||
The WindowFactory object is not destroyed (since it was crea ted externally), instead it is just removed from the list. | The WindowFactory object is not destroyed (since it was crea ted externally), instead it is just removed from the list. | |||
\param name | \param name | |||
String which holds the name (technically, Window type name) of the WindowFactory to be removed. If \a name is not | String which holds the name (technically, Window type name) of the WindowFactory to be removed. If \a name is not | |||
in the list, no error occurs (nothing happens). | in the list, no error occurs (nothing happens). | |||
skipping to change at line 195 | skipping to change at line 209 | |||
*/ | */ | |||
void removeFactory(WindowFactory* factory); | void removeFactory(WindowFactory* factory); | |||
/*! | /*! | |||
\brief | \brief | |||
Remove all WindowFactory objects from the list. | Remove all WindowFactory objects from the list. | |||
\return | \return | |||
Nothing | Nothing | |||
*/ | */ | |||
void removeAllFactories(void) {d_factoryRegistry.c lear();} | void removeAllFactories(void); | |||
/*! | /*! | |||
\brief | \brief | |||
Return a pointer to the specified WindowFactory object. | Return a pointer to the specified WindowFactory object. | |||
\param type | \param type | |||
String holding the Window object type to return the WindowFa ctory for. | String holding the Window object type to return the WindowFa ctory for. | |||
\return | \return | |||
Pointer to the WindowFactory object that creates Windows of the type \a type. | Pointer to the WindowFactory object that creates Windows of the type \a type. | |||
skipping to change at line 394 | skipping to change at line 408 | |||
*/ | */ | |||
const FalagardWindowMapping& getFalagardMappingForType(const String& ty pe) const; | const FalagardWindowMapping& getFalagardMappingForType(const String& ty pe) const; | |||
private: | private: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef std::map<String, WindowFactory*, String::FastLessCompare> WindowFactoryRegistry; //!< Type used to implement registry of WindowFactory objects | typedef std::map<String, WindowFactory*, String::FastLessCompare> WindowFactoryRegistry; //!< Type used to implement registry of WindowFactory objects | |||
typedef std::map<String, AliasTargetStack, String::FastLessCompare> TypeAliasRegistry; //!< Type used to implement registry of window type aliases. | typedef std::map<String, AliasTargetStack, String::FastLessCompare> TypeAliasRegistry; //!< Type used to implement registry of window type aliases. | |||
typedef std::map<String, FalagardWindowMapping, String::FastLessCompare > FalagardMapRegistry; //!< Type used to implement registry of falagard window mappings. | typedef std::map<String, FalagardWindowMapping, String::FastLessCompare > FalagardMapRegistry; //!< Type used to implement registry of falagard window mappings. | |||
//! Type used for list of WindowFacory objects that we created ourselve | ||||
s | ||||
typedef std::vector<WindowFactory*> OwnedWindowFactoryList; | ||||
WindowFactoryRegistry d_factoryRegistry; //!< The container that forms the WindowFactory registry | WindowFactoryRegistry d_factoryRegistry; //!< The container that forms the WindowFactory registry | |||
TypeAliasRegistry d_aliasRegistry; //!< The container that forms the window type alias registry. | TypeAliasRegistry d_aliasRegistry; //!< The container that forms the window type alias registry. | |||
FalagardMapRegistry d_falagardRegistry; //!< Container that hold all the falagard window mappings. | FalagardMapRegistry d_falagardRegistry; //!< Container that hold all the falagard window mappings. | |||
//! Container that tracks WindowFactory objects we created ourselves. | ||||
static OwnedWindowFactoryList d_ownedFactories; | ||||
public: | public: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Iterator stuff | Iterator stuff | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef ConstBaseIterator<WindowFactoryRegistry> WindowFactor yIterator; | typedef ConstBaseIterator<WindowFactoryRegistry> WindowFactor yIterator; | |||
typedef ConstBaseIterator<TypeAliasRegistry> TypeAliasIte rator; | typedef ConstBaseIterator<TypeAliasRegistry> TypeAliasIte rator; | |||
typedef ConstBaseIterator<FalagardMapRegistry> FalagardMappingIter ator; | typedef ConstBaseIterator<FalagardMapRegistry> FalagardMappingIter ator; | |||
/*! | /*! | |||
skipping to change at line 426 | skipping to change at line 444 | |||
*/ | */ | |||
TypeAliasIterator getAliasIterator(void) const; | TypeAliasIterator getAliasIterator(void) const; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a WindowFactoryManager::FalagardMappingIterator object to it erate over the defined falagard window mappings. | Return a WindowFactoryManager::FalagardMappingIterator object to it erate over the defined falagard window mappings. | |||
*/ | */ | |||
FalagardMappingIterator getFalagardMappingIterator() const; | FalagardMappingIterator getFalagardMappingIterator() const; | |||
}; | }; | |||
//------------------------------------------------------------------------- | ||||
---// | ||||
template <typename T> | ||||
void WindowFactoryManager::addFactory() | ||||
{ | ||||
// create the factory object | ||||
WindowFactory* factory = new T; | ||||
// only do the actual add now if our singleton has already been created | ||||
if (WindowFactoryManager::getSingletonPtr()) | ||||
{ | ||||
Logger::getSingleton().logEvent("Created WindowFactory for '" + | ||||
factory->getTypeName() + | ||||
"' windows."); | ||||
// add the factory we just created | ||||
try | ||||
{ | ||||
WindowFactoryManager::getSingleton().addFactory(factory); | ||||
} | ||||
catch (Exception&) | ||||
{ | ||||
Logger::getSingleton().logEvent("Deleted WindowFactory for '" + | ||||
factory->getTypeName() + | ||||
"' windows."); | ||||
// delete the factory object | ||||
delete factory; | ||||
throw; | ||||
} | ||||
} | ||||
d_ownedFactories.push_back(factory); | ||||
} | ||||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // end of guard _CEGUIWindowFactoryManager_h_ | #endif // end of guard _CEGUIWindowFactoryManager_h_ | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 59 lines changed or added | |||
CEGUIWindowManager.h | CEGUIWindowManager.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIWindowManager_h_ | #ifndef _CEGUIWindowManager_h_ | |||
#define _CEGUIWindowManager_h_ | #define _CEGUIWindowManager_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
#include "CEGUILogger.h" | #include "CEGUILogger.h" | |||
#include "CEGUIIteratorBase.h" | #include "CEGUIIteratorBase.h" | |||
#include "CEGUIEventSet.h" | ||||
#include <map> | #include <map> | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4275) | # pragma warning(disable : 4275) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
skipping to change at line 59 | skipping to change at line 60 | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
The WindowManager class describes an object that manages creation an d lifetime of Window objects. | The WindowManager class describes an object that manages creation an d lifetime of Window objects. | |||
The WindowManager is the means by which Window objects are created a nd destroyed. For each sub-class | The WindowManager is the means by which Window objects are created a nd destroyed. For each sub-class | |||
of Window that is to be created, there must exist a WindowFactory ob ject which is registered with the | of Window that is to be created, there must exist a WindowFactory ob ject which is registered with the | |||
WindowFactoryManager. Additionally, the WindowManager tracks every Window object created, and can be | WindowFactoryManager. Additionally, the WindowManager tracks every Window object created, and can be | |||
used to access those Window objects by name. | used to access those Window objects by name. | |||
*/ | */ | |||
class CEGUIEXPORT WindowManager : public Singleton <WindowManager> | class CEGUIEXPORT WindowManager : public Singleton <WindowManager>, | |||
public EventSet | ||||
{ | { | |||
public: | public: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Public static data | Public static data | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
static const String GeneratedWindowNameBase; //!< Base name to use for generated window names. | static const String GeneratedWindowNameBase; //!< Base name to use for generated window names. | |||
//! Namespace for global events. | ||||
static const String EventNamespace; | ||||
//! Event fired when a new Window object is created. | ||||
static const String EventWindowCreated; | ||||
//! Event fired when a Window object is destroyed. | ||||
static const String EventWindowDestroyed; | ||||
/*! | /*! | |||
\brief | \brief | |||
Function type that is used as a callback when loading layout s from XML; the function is called | Function type that is used as a callback when loading layout s from XML; the function is called | |||
for each Property element encountered. | for each Property element encountered. | |||
\param window | \param window | |||
Window object that the property is to be applied to. | Window object that the property is to be applied to. | |||
\param propname | \param propname | |||
skipping to change at line 129 | skipping to change at line 137 | |||
\param type | \param type | |||
String that describes the type of Window to be created. A v alid WindowFactory for the specified type must be registered. | String that describes the type of Window to be created. A v alid WindowFactory for the specified type must be registered. | |||
\param name | \param name | |||
String that holds a unique name that is to be given to the n ew window. If this string is empty (""), a name | String that holds a unique name that is to be given to the n ew window. If this string is empty (""), a name | |||
will be generated for the window. | will be generated for the window. | |||
\return | \return | |||
Pointer to the newly created Window object. | Pointer to the newly created Window object. | |||
\exception InvalidRequestException WindowManager is locked and no Wind | ||||
ows | ||||
may be created. | ||||
\exception AlreadyExistsException A Window object with the name \a name already exists. | \exception AlreadyExistsException A Window object with the name \a name already exists. | |||
\exception UnknownObjectException No WindowFactory is registered for \a type Window objects. | \exception UnknownObjectException No WindowFactory is registered for \a type Window objects. | |||
\exception GenericException Some other e rror occurred (Exception message has details). | \exception GenericException Some other e rror occurred (Exception message has details). | |||
*/ | */ | |||
Window* createWindow(const String& type, const String& name = "", co nst String& prefix = ""); | Window* createWindow(const String& type, const String& name = ""); | |||
/*! | /*! | |||
\brief | \brief | |||
Destroy the specified Window object. | Destroy the specified Window object. | |||
\param window | \param window | |||
Pointer to the Window object to be destroyed. If the \a win dow is null, or is not recognised, nothing happens. | Pointer to the Window object to be destroyed. If the \a win dow is null, or is not recognised, nothing happens. | |||
\return | \return | |||
Nothing | Nothing | |||
skipping to change at line 232 | skipping to change at line 242 | |||
Client code data pointer passed to the PropertyCallback func tion. | Client code data pointer passed to the PropertyCallback func tion. | |||
\return | \return | |||
Pointer to the root Window object defined in the layout. | Pointer to the root Window object defined in the layout. | |||
\exception FileIOException thrown if something goes wrong while processing the file \a filename. | \exception FileIOException thrown if something goes wrong while processing the file \a filename. | |||
\exception InvalidRequestException thrown if \a filename appear s to be invalid. | \exception InvalidRequestException thrown if \a filename appear s to be invalid. | |||
*/ | */ | |||
Window* loadWindowLayout(const String& filename, const String& name_ prefix = "", const String& resourceGroup = "", PropertyCallback* callback = 0, void* userdata = 0); | Window* loadWindowLayout(const String& filename, const String& name_ prefix = "", const String& resourceGroup = "", PropertyCallback* callback = 0, void* userdata = 0); | |||
Window* loadWindowLayout(const String& filename, bool generateRandom | ||||
Prefix); | ||||
/*! | /*! | |||
\brief | \brief | |||
Return whether the window dead pool is empty. | Return whether the window dead pool is empty. | |||
\return | \return | |||
- true if there are no windows in the dead pool. | - true if there are no windows in the dead pool. | |||
- false if the dead pool contains >=1 window awaiting destruction. | - false if the dead pool contains >=1 window awaiting destruction. | |||
*/ | */ | |||
bool isDeadPoolEmpty(void) const; | bool isDeadPoolEmpty(void) const; | |||
skipping to change at line 352 | skipping to change at line 360 | |||
\param resourceGroup | \param resourceGroup | |||
String describing the default resource group identifier to be used. | String describing the default resource group identifier to be used. | |||
\return | \return | |||
Nothing. | Nothing. | |||
*/ | */ | |||
static void setDefaultResourceGroup(const String& resourceGroup) | static void setDefaultResourceGroup(const String& resourceGroup) | |||
{ d_defaultResourceGroup = resourceGroup; } | { d_defaultResourceGroup = resourceGroup; } | |||
/*! | ||||
\brief | ||||
Put WindowManager into the locked state. | ||||
While WindowManager is in the locked state all attempts to create a | ||||
Window of any type will fail with an InvalidRequestException being | ||||
thrown. Calls to lock/unlock are recursive; if multiple calls to l | ||||
ock | ||||
are made, WindowManager is only unlocked after a matching number of | ||||
calls to unlock. | ||||
\note | ||||
This is primarily intended for internal use within the system. | ||||
*/ | ||||
void lock(); | ||||
/*! | ||||
\brief | ||||
Put WindowManager into the unlocked state. | ||||
While WindowManager is in the locked state all attempts to create a | ||||
Window of any type will fail with an InvalidRequestException being | ||||
thrown. Calls to lock/unlock are recursive; if multiple calls to l | ||||
ock | ||||
are made, WindowManager is only unlocked after a matching number of | ||||
calls to unlock. | ||||
\note | ||||
This is primarily intended for internal use within the system. | ||||
*/ | ||||
void unlock(); | ||||
/*! | ||||
\brief | ||||
Returns whether WindowManager is currently in the locked state. | ||||
While WindowManager is in the locked state all attempts to create a | ||||
Window of any type will fail with an InvalidRequestException being | ||||
thrown. Calls to lock/unlock are recursive; if multiple calls to l | ||||
ock | ||||
are made, WindowManager is only unlocked after a matching number of | ||||
calls to unlock. | ||||
\return | ||||
- true to indicate WindowManager is locked and that any attempt to | ||||
create Window objects will fail. | ||||
- false to indicate WindowManager is unlocked and that Window objec | ||||
ts | ||||
may be created as normal. | ||||
*/ | ||||
bool isLocked() const; | ||||
private: | private: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation Methods | Implementation Methods | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | /*! | |||
\brief | \brief | |||
Implementation method to generate a unique name to use for a window . | Implementation method to generate a unique name to use for a window . | |||
*/ | */ | |||
String generateUniqueWindowName(); | String generateUniqueWindowName(); | |||
String generateUniqueWindowPrefix(); | ||||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Constants | Implementation Constants | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
static const char GUILayoutSchemaName[]; //!< Filename of the XML schema used for validating GUILayout files. | static const char GUILayoutSchemaName[]; //!< Filename of the XML schema used for validating GUILayout files. | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Implementation Data | Implementation Data | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef std::map<String, Window*, String::FastLessCompare> WindowRegistry; //!< Type used to imple ment registry of Window objects | typedef std::map<String, Window*, String::FastLessCompare> WindowRegistry; //!< Type used to imple ment registry of Window objects | |||
typedef std::vector<Window*> WindowVector; //!< Type to use for a collection of Window pointers. | typedef std::vector<Window*> WindowVector; //!< Type to use for a collection of Window pointers. | |||
WindowRegistry d_windowRegistry; //!< The container that forms the Window registry | WindowRegistry d_windowRegistry; //!< The container that forms the Window registry | |||
WindowVector d_deathrow; //!< Collection of 'destroyed' windows. | WindowVector d_deathrow; //!< Collection of 'destroyed' windows. | |||
unsigned long d_uid_counter; //!< Counter used to generate unique wi ndow names. | unsigned long d_uid_counter; //!< Counter used to generate unique wi ndow names. | |||
static String d_defaultResourceGroup; //!< holds default resource gro up | static String d_defaultResourceGroup; //!< holds default resource gro up | |||
//! count of times WM is locked against new window creation. | ||||
uint d_lockCount; | ||||
public: | public: | |||
/******************************************************************* ****** | /******************************************************************* ****** | |||
Iterator stuff | Iterator stuff | |||
******************************************************************** *****/ | ******************************************************************** *****/ | |||
typedef ConstBaseIterator<WindowRegistry> WindowIterator; | typedef ConstBaseIterator<WindowRegistry> WindowIterator; | |||
/*! | /*! | |||
\brief | \brief | |||
Return a WindowManager::WindowIterator object to iterate ove r the currently defined Windows. | Return a WindowManager::WindowIterator object to iterate ove r the currently defined Windows. | |||
End of changes. 9 change blocks. | ||||
7 lines changed or deleted | 67 lines changed or added | |||
CEGUIWindowProperties.h | CEGUIWindowProperties.h | |||
---|---|---|---|---|
skipping to change at line 583 | skipping to change at line 583 | |||
"Property to get/set the tooltip text for the window. Value is the too ltip text for the window.", | "Property to get/set the tooltip text for the window. Value is the too ltip text for the window.", | |||
"") | "") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access whether the window inherits its tooltip text from it | Property to access whether the window inherits its tooltip text from it | |||
s parent whn it has no tooltip text of its own. | s | |||
parent when it has no tooltip text of its own. Default state: True | ||||
\par Usage: | \par Usage: | |||
- Name: InheritsTooltipText | - Name: InheritsTooltipText | |||
- Format: "[text]". | - Format: "[text]". | |||
\par Where [Text] is: | \par Where [Text] is: | |||
- "True" to indicate the Window inherits its tooltip text from its | - "True" to indicate the Window inherits its tooltip text from its | |||
parent. | parent. | |||
- "False" to indicate the Window does not inherit its tooltip text. | - "False" to indicate the Window does not inherit its tooltip text. | |||
*/ | */ | |||
class InheritsTooltipText : public Property | class InheritsTooltipText : public Property | |||
{ | { | |||
public: | public: | |||
InheritsTooltipText() : Property( | InheritsTooltipText() : Property( | |||
"InheritsTooltipText", | "InheritsTooltipText", | |||
"Property to get/set whether the window inherits its parents toolti p text when it has none of its own. Value is either \"True\" or \"False\". ", | "Property to get/set whether the window inherits its parents toolti p text when it has none of its own. Value is either \"True\" or \"False\". ", | |||
"False") | "True") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
Property to access whether the window rises to the top of the z orde r when clicked. | Property to access whether the window rises to the top of the z orde r when clicked. | |||
skipping to change at line 1023 | skipping to change at line 1025 | |||
DragDropTarget() : Property( | DragDropTarget() : Property( | |||
"DragDropTarget", | "DragDropTarget", | |||
"Property to get/set whether the Window will receive drag and drop related notifications. Value is either \"True\" or \"False\".", | "Property to get/set whether the Window will receive drag and drop related notifications. Value is either \"True\" or \"False\".", | |||
"True") | "True") | |||
{} | {} | |||
String get(const PropertyReceiver* receiver) const; | String get(const PropertyReceiver* receiver) const; | |||
void set(PropertyReceiver* receiver, const String& value); | void set(PropertyReceiver* receiver, const String& value); | |||
}; | }; | |||
/*! | ||||
\brief | ||||
Property to get/set whether the Window will automatically attempt to us | ||||
e a | ||||
full imagery caching RenderingSurface (if supported by the renderer). | ||||
Here, | ||||
"full imagery caching" usually will mean caching a window's representat | ||||
ion | ||||
onto a texture (although no such implementation requirement is specifie | ||||
d.) | ||||
\par Usage: | ||||
- Name: AutoRenderingSurface | ||||
- Format: "[text]". | ||||
\par Where [Text] is: | ||||
- "True" if Window should automatically use a full imagery caching | ||||
RenderingSurface (aka a RenderingWindow). | ||||
- "False" if Window should not automatically use a full imagery cac | ||||
hing | ||||
RenderingSurface. | ||||
*/ | ||||
class AutoRenderingSurface : public Property | ||||
{ | ||||
public: | ||||
AutoRenderingSurface() : Property( | ||||
"AutoRenderingSurface", | ||||
"Property to get/set whether the Window will automatically attempt | ||||
to " | ||||
"use a full imagery caching RenderingSurface (if supported by the " | ||||
"renderer). Here, full imagery caching usually will mean caching a | ||||
" | ||||
"window's representation onto a texture (although no such " | ||||
"implementation requirement is specified.)" | ||||
" Value is either \"True\" or \"False\".", | ||||
"False") | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
/*! | ||||
\brief | ||||
Property to access the rotation factors of the window. | ||||
\par Usage: | ||||
- Name: Rotation | ||||
- Format: "x:[x_float] y:[y_float] z:[z_float]" | ||||
\par Where: | ||||
- [x_float] is a floating point value describing the rotation aroun | ||||
d the | ||||
x axis, in degrees. | ||||
- [y_float] is a floating point value describing the rotation aroun | ||||
d the | ||||
y axis, in degrees. | ||||
- [z_float] is a floating point value describing the rotation aroun | ||||
d the | ||||
z axis, in degrees. | ||||
*/ | ||||
class Rotation : public Property | ||||
{ | ||||
public: | ||||
Rotation() : Property( | ||||
"Rotation", | ||||
"Property to get/set the windows rotation factors. Value is " | ||||
"\"x:[x_float] y:[y_float] z:[z_float]\".", | ||||
"x:0 y:0 z:0") | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
/*! | ||||
\brief | ||||
Property to access the x axis rotation factor of the window. | ||||
\par Usage: | ||||
- Name: XRotation | ||||
- Format: "[float]" | ||||
\par Where: | ||||
- [float] is a floating point value describing the rotation around | ||||
the | ||||
x axis, in degrees. | ||||
*/ | ||||
class XRotation : public Property | ||||
{ | ||||
public: | ||||
XRotation() : Property( | ||||
"XRotation", | ||||
"Property to get/set the window's x axis rotation factor. Value is | ||||
" | ||||
"\"[float]\".", | ||||
"0", false) | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
/*! | ||||
\brief | ||||
Property to access the y axis rotation factor of the window. | ||||
\par Usage: | ||||
- Name: YRotation | ||||
- Format: "[float]" | ||||
\par Where: | ||||
- [float] is a floating point value describing the rotation around | ||||
the | ||||
y axis, in degrees. | ||||
*/ | ||||
class YRotation : public Property | ||||
{ | ||||
public: | ||||
YRotation() : Property( | ||||
"YRotation", | ||||
"Property to get/set the window's y axis rotation factor. Value is | ||||
" | ||||
"\"[float]\".", | ||||
"0", false) | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
/*! | ||||
\brief | ||||
Property to access the z axis rotation factor of the window. | ||||
\par Usage: | ||||
- Name: ZRotation | ||||
- Format: "[float]" | ||||
\par Where: | ||||
- [float] is a floating point value describing the rotation around | ||||
the | ||||
z axis, in degrees. | ||||
*/ | ||||
class ZRotation : public Property | ||||
{ | ||||
public: | ||||
ZRotation() : Property( | ||||
"ZRotation", | ||||
"Property to get/set the window's z axis rotation factor. Value is | ||||
" | ||||
"\"[float]\".", | ||||
"0", false) | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
/*! | ||||
\brief | ||||
Property to access window non-client setting. | ||||
This property offers access to the "non client" setting for the window. | ||||
\par Usage: | ||||
- Name: NonClient | ||||
- Format: "[text]". | ||||
\par Where [Text] is: | ||||
- "True" to indicate the Window is a non-client window. | ||||
- "False" to indicate the Window is not a non-client. | ||||
*/ | ||||
class NonClient : public Property | ||||
{ | ||||
public: | ||||
NonClient() : Property( | ||||
"NonClient", | ||||
"Property to get/set the 'non-client' setting for the Window. " | ||||
"Value is either \"True\" or \"False\".", | ||||
"False") | ||||
{} | ||||
String get(const PropertyReceiver* receiver) const; | ||||
void set(PropertyReceiver* receiver, const String& value); | ||||
}; | ||||
} // End of WindowProperties namespace section | } // End of WindowProperties namespace section | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIWindowProperties_h_ | #endif // end of guard _CEGUIWindowProperties_h_ | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 193 lines changed or added | |||
CEGUIWindowRenderer.h | CEGUIWindowRenderer.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
#include <vector> | #include <vector> | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
class WidgetLookFeel; | ||||
/*! | /*! | |||
\brief | \brief | |||
Base-class for the assignable WindowRenderer object | Base-class for the assignable WindowRenderer object | |||
*/ | */ | |||
class CEGUIEXPORT WindowRenderer | class CEGUIEXPORT WindowRenderer | |||
{ | { | |||
public: | public: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Constructor / Destructor | Constructor / Destructor | |||
*********************************************************************** ***/ | *********************************************************************** ***/ | |||
skipping to change at line 123 | skipping to change at line 120 | |||
/*! | /*! | |||
\brief | \brief | |||
Get unclipped inner rectangle that our window should return from it s | Get unclipped inner rectangle that our window should return from it s | |||
member function with the same name. | member function with the same name. | |||
*/ | */ | |||
virtual Rect getUnclippedInnerRect() const; | virtual Rect getUnclippedInnerRect() const; | |||
/*! | /*! | |||
\brief | \brief | |||
Get actual pixel rectangle our window is to return from its | Method called to perform extended laying out of the window's attach | |||
member function with the same name. | ed | |||
child windows. | ||||
*/ | */ | |||
virtual Rect getPixelRect() const; | virtual void performChildWindowLayout() {} | |||
/*! | /*! | |||
\brief | \brief | |||
Method called to perform extended laying out of the window's attach | update the RenderingContext as needed for our window. This is norm | |||
ed | ally | |||
child windows. | invoked via our window's member function with the same name. | |||
*/ | */ | |||
virtual void performChildWindowLayout() {} | virtual void getRenderingContext(RenderingContext& ctx) const; | |||
//! perform any time based updates for this WindowRenderer. | ||||
virtual void update(float /*elapsed*/) {} | ||||
protected: | protected: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation methods | Implementation methods | |||
*********************************************************************** ***/ | *********************************************************************** ***/ | |||
/*! | /*! | |||
\brief | \brief | |||
Register a property class that will be properly managed by this win dow | Register a property class that will be properly managed by this win dow | |||
renderer. | renderer. | |||
skipping to change at line 174 | skipping to change at line 174 | |||
Handler called when a Look'N'Feel is assigned to our window. | Handler called when a Look'N'Feel is assigned to our window. | |||
*/ | */ | |||
virtual void onLookNFeelAssigned() {} | virtual void onLookNFeelAssigned() {} | |||
/*! | /*! | |||
\brief | \brief | |||
Handler called when a Look'N'Feel is removed/unassigned from our wi ndow. | Handler called when a Look'N'Feel is removed/unassigned from our wi ndow. | |||
*/ | */ | |||
virtual void onLookNFeelUnassigned() {} | virtual void onLookNFeelUnassigned() {} | |||
void operator=(const WindowRenderer&) {} | ||||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation data | Implementation data | |||
*********************************************************************** ***/ | *********************************************************************** ***/ | |||
Window* d_window; //!< Pointer to the window this windowrenderer is assigned to. | Window* d_window; //!< Pointer to the window this windowrenderer is assigned to. | |||
const String d_name; //!< Name of the factory type used to create th is window renderer. | const String d_name; //!< Name of the factory type used to create th is window renderer. | |||
const String d_class; //!< Name of the widget class that is the "mini mum" requirement. | const String d_class; //!< Name of the widget class that is the "mini mum" requirement. | |||
typedef std::vector<Property*> PropertyList; | typedef std::vector<Property*> PropertyList; | |||
PropertyList d_properties; //!< The list of properties that this windo wrenderer will be handling. | PropertyList d_properties; //!< The list of properties that this windo wrenderer will be handling. | |||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 13 lines changed or added | |||
CEGUIWindowRendererManager.h | CEGUIWindowRendererManager.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIWindowRenderer.h | filename: CEGUIWindowRenderer.h | |||
created: Jan 11 2006 | created: Jan 11 2006 | |||
author: Tomas Lindquist Olsen | author: Tomas Lindquist Olsen | |||
purpose: Defines interface for the WindowRendererManager class | purpose: Defines interface for the WindowRendererManager class | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 33 | skipping to change at line 33 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIWindowRendererManager_h_ | #ifndef _CEGUIWindowRendererManager_h_ | |||
#define _CEGUIWindowRendererManager_h_ | #define _CEGUIWindowRendererManager_h_ | |||
#include "CEGUIWindowRenderer.h" | ||||
#include "CEGUISingleton.h" | #include "CEGUISingleton.h" | |||
//#include "CEGUIIteratorBase.h" | #include "CEGUIWindowRenderer.h" | |||
#include "CEGUILogger.h" | ||||
#include "CEGUIExceptions.h" | ||||
#include <map> | #include <map> | |||
#include <vector> | ||||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(push) | # pragma warning(push) | |||
# pragma warning(disable : 4251) | # pragma warning(disable : 4251) | |||
#endif | #endif | |||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
class CEGUIEXPORT WindowRendererManager : public Singleton<WindowRendererMa nager> | class CEGUIEXPORT WindowRendererManager : public Singleton<WindowRendererMa nager> | |||
{ | { | |||
public: | public: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Contructor / Destructor | Contructor / Destructor | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
WindowRendererManager(); | WindowRendererManager(); | |||
~WindowRendererManager(); | ~WindowRendererManager(); | |||
/********************************************************************** *** | /********************************************************************** *** | |||
skipping to change at line 71 | skipping to change at line 72 | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Accessors | Accessors | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
bool isFactoryPresent(const String& name) const; | bool isFactoryPresent(const String& name) const; | |||
WindowRendererFactory* getFactory(const String& name) const; | WindowRendererFactory* getFactory(const String& name) const; | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Manipulators | Manipulators | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/*! | ||||
\brief | ||||
Creates a WindowRendererFactory of the type \a T and adds it to the | ||||
system for use. | ||||
The created WindowRendererFactory will automatically be deleted whe | ||||
n the | ||||
factory is removed from the system (either directly or at system | ||||
deletion time). | ||||
\tparam T | ||||
Specifies the type of WindowRendererFactory subclass to add a facto | ||||
ry | ||||
for. | ||||
*/ | ||||
template <typename T> | ||||
static void addFactory(); | ||||
void addFactory(WindowRendererFactory* wr); | void addFactory(WindowRendererFactory* wr); | |||
void removeFactory(const String& name); | void removeFactory(const String& name); | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Factory usage | Factory usage | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
WindowRenderer* createWindowRenderer(const String& name); | WindowRenderer* createWindowRenderer(const String& name); | |||
void destroyWindowRenderer(WindowRenderer* wr); | void destroyWindowRenderer(WindowRenderer* wr); | |||
private: | private: | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Private implementation | Private implementation | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
/********************************************************************** *** | /********************************************************************** *** | |||
Implementation data | Implementation data | |||
*********************************************************************** **/ | *********************************************************************** **/ | |||
typedef std::map<String, WindowRendererFactory*, String::FastLessCompar e> WR_Registry; | typedef std::map<String, WindowRendererFactory*, String::FastLessCompar e> WR_Registry; | |||
WR_Registry d_wrReg; | WR_Registry d_wrReg; | |||
//! Container type to hold WindowRenderFacory objects that we created. | ||||
typedef std::vector<WindowRendererFactory*> OwnedFactoryList; | ||||
//! Container that tracks WindowFactory objects we created ourselves. | ||||
static OwnedFactoryList d_ownedFactories; | ||||
}; | }; | |||
//------------------------------------------------------------------------- | ||||
---// | ||||
template <typename T> | ||||
void WindowRendererManager::addFactory() | ||||
{ | ||||
// create the factory object | ||||
WindowRendererFactory* factory = new T; | ||||
// only do the actual add now if our singleton has already been created | ||||
if (WindowRendererManager::getSingletonPtr()) | ||||
{ | ||||
Logger::getSingleton().logEvent("Created WindowRendererFactory for | ||||
'" + | ||||
factory->getName() + | ||||
"' WindowRenderers."); | ||||
// add the factory we just created | ||||
try | ||||
{ | ||||
WindowRendererManager::getSingleton().addFactory(factory); | ||||
} | ||||
catch (Exception&) | ||||
{ | ||||
Logger::getSingleton().logEvent("Deleted WindowRendererFactory | ||||
for " | ||||
"'" + factory->getName() + | ||||
"' WindowRenderers."); | ||||
// delete the factory object | ||||
delete factory; | ||||
throw; | ||||
} | ||||
} | ||||
d_ownedFactories.push_back(factory); | ||||
} | ||||
//------------------------------------------------------------------------- | ||||
---// | ||||
} // End of CEGUI namespace | } // End of CEGUI namespace | |||
#if defined(_MSC_VER) | #if defined(_MSC_VER) | |||
# pragma warning(pop) | # pragma warning(pop) | |||
#endif | #endif | |||
#endif // _CEGUIWindowRendererManager_h_ | #endif // _CEGUIWindowRendererManager_h_ | |||
End of changes. 8 change blocks. | ||||
4 lines changed or deleted | 65 lines changed or added | |||
CEGUIWindowRendererModule.h | CEGUIWindowRendererModule.h | |||
---|---|---|---|---|
/*********************************************************************** | /*********************************************************************** | |||
filename: CEGUIWindowRendererModule.h | filename: CEGUIWindowRendererModule.h | |||
created: Fri Jan 13 2006 | created: Fri Jan 13 2006 | |||
author: Paul D Turner <paul@cegui.org.uk> | author: Paul D Turner <paul@cegui.org.uk> | |||
Tomas Lindquist Olsen <tomas@famolsen.dk> | Tomas Lindquist Olsen <tomas@famolsen.dk> | |||
*************************************************************************/ | *************************************************************************/ | |||
/************************************************************************** * | /************************************************************************** * | |||
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team | * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | * the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be | * The above copyright notice and this permission notice shall be | |||
skipping to change at line 32 | skipping to change at line 32 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIWindowRendererModule_h_ | #ifndef _CEGUIWindowRendererModule_h_ | |||
#define _CEGUIWindowRendererModule_h_ | #define _CEGUIWindowRendererModule_h_ | |||
#include "CEGUIExceptions.h" | #include "CEGUIBase.h" | |||
#include "CEGUIWindowRendererManager.h" | #include <vector> | |||
#include "CEGUILogger.h" | ||||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if defined(_MSC_VER) | |||
# ifdef CEGUIWRMODULE_EXPORTS | # pragma warning(push) | |||
# define CEGUIWRMODULE_API __declspec(dllexport) | # pragma warning(disable : 4251) | |||
# else | ||||
# define CEGUIWRMODULE_API __declspec(dllimport) | ||||
# endif | ||||
#else | ||||
# define CEGUIWRMODULE_API | ||||
#endif | #endif | |||
// declare module | namespace CEGUI | |||
#define CEGUI_DECLARE_WR_MODULE( moduleName )\ | { | |||
\ | //! Abstract interface for window renderer module objects. | |||
class CEGUI::WindowRendererFactory;\ | class CEGUIEXPORT WindowRendererModule | |||
\ | { | |||
extern "C" CEGUIWRMODULE_API void registerFactoryFunction(const CEGUI::Stri | public: | |||
ng& type_name);\ | //! Destructor. | |||
extern "C" CEGUIWRMODULE_API CEGUI::uint registerAllFactoriesFunction(void) | virtual ~WindowRendererModule(); | |||
;\ | //! Register the factory for WindowRenderers of the specified type. | |||
void doSafeFactoryRegistration(CEGUI::WindowRendererFactory* factory); | void registerFactory(const String& type_name); | |||
//! Register factories for all WindowRenderer types in the module. | ||||
// define factory | uint registerAllFactories(); | |||
#define CEGUI_DEFINE_WR_FACTORY( className )\ | //! Unregister the factory for WindowRenderers of the specified type. | |||
namespace CEGUI {\ | void unregisterFactory(const String& type_name); | |||
class className ## WRFactory : public WindowRendererFactory\ | //! Unregister factories for all WindowRenderer types in the module. | |||
{\ | uint unregisterAllFactories(); | |||
public:\ | ||||
className ## WRFactory(void) : WindowRendererFactory(className::TypeNam | ||||
e) { }\ | ||||
WindowRenderer* create(void)\ | ||||
{ return new className(className::TypeName); }\ | ||||
void destroy(WindowRenderer* wr)\ | ||||
{ delete wr; }\ | ||||
};\ | ||||
}\ | ||||
static CEGUI::className ## WRFactory s_ ## className ## WRFactory; | ||||
// start factory map | ||||
#define CEGUI_START_WR_FACTORY_MAP( module )\ | ||||
struct module ## WRMapEntry\ | ||||
{\ | ||||
const CEGUI::utf8* d_name;\ | ||||
CEGUI::WindowRendererFactory* d_factory;\ | ||||
};\ | ||||
\ | ||||
module ## WRMapEntry module ## WRFactoriesMap[] =\ | ||||
{\ | ||||
// end factory map | ||||
#define CEGUI_END_WR_FACTORY_MAP {0,0}}; | ||||
// map entry | protected: | |||
#define CEGUI_WR_FACTORY_MAP_ENTRY( class )\ | //! Collection type that holds pointers to the factory registerer objec | |||
{CEGUI::class::TypeName, &s_ ## class ## WRFactory}, | ts. | |||
typedef std::vector<WRFactoryRegisterer*> FactoryRegistry; | ||||
//! The collection of factorty registerer object pointers. | ||||
FactoryRegistry d_registry; | ||||
}; | ||||
// define module | ||||
#define CEGUI_DEFINE_WR_MODULE( module )\ | ||||
void registerFactoryFunction(const CEGUI::String& type_name)\ | ||||
{\ | ||||
module ## WRMapEntry* entry = module ## WRFactoriesMap;\ | ||||
while (entry->d_name)\ | ||||
{\ | ||||
if (entry->d_name == type_name)\ | ||||
{\ | ||||
doSafeFactoryRegistration(entry->d_factory);\ | ||||
return;\ | ||||
}\ | ||||
++entry;\ | ||||
}\ | ||||
\ | ||||
throw CEGUI::UnknownObjectException("::registerFactory - The window ren | ||||
derer factory for type '" + type_name + "' is not known in this module.");\ | ||||
}\ | ||||
\ | ||||
extern "C" CEGUI::uint registerAllFactoriesFunction(void)\ | ||||
{\ | ||||
CEGUI::uint count = 0;\ | ||||
module ## WRMapEntry* entry = module ## WRFactoriesMap;\ | ||||
while (entry->d_name)\ | ||||
{\ | ||||
doSafeFactoryRegistration(entry->d_factory);\ | ||||
++entry;\ | ||||
++count;\ | ||||
}\ | ||||
return count;\ | ||||
}\ | ||||
\ | ||||
void doSafeFactoryRegistration(CEGUI::WindowRendererFactory* factory)\ | ||||
{\ | ||||
assert(factory != 0);\ | ||||
\ | ||||
CEGUI::WindowRendererManager& wfm = CEGUI::WindowRendererManager::getSi | ||||
ngleton();\ | ||||
if (wfm.isFactoryPresent(factory->getName()))\ | ||||
{\ | ||||
CEGUI::Logger::getSingleton().logEvent(\ | ||||
"WindowRenderer factory '" + factory->getName() + "' appears to | ||||
be already registered, skipping.",\ | ||||
CEGUI::Informative);\ | ||||
}\ | ||||
else\ | ||||
{\ | ||||
wfm.addFactory(factory);\ | ||||
}\ | ||||
} | } | |||
#if defined(_MSC_VER) | ||||
# pragma warning(pop) | ||||
#endif | ||||
#endif // end of guard _CEGUIWindowRendererModule_h_ | #endif // end of guard _CEGUIWindowRendererModule_h_ | |||
End of changes. 7 change blocks. | ||||
104 lines changed or deleted | 33 lines changed or added | |||
CEGUIXMLParser.h | CEGUIXMLParser.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIXMLParser_h_ | #ifndef _CEGUIXMLParser_h_ | |||
#define _CEGUIXMLParser_h_ | #define _CEGUIXMLParser_h_ | |||
#include "CEGUIBase.h" | #include "CEGUIBase.h" | |||
#include "CEGUIString.h" | #include "CEGUIString.h" | |||
#include "CEGUIPropertySet.h" | ||||
// Start of CEGUI namespace section | // Start of CEGUI namespace section | |||
namespace CEGUI | namespace CEGUI | |||
{ | { | |||
/*! | /*! | |||
\brief | \brief | |||
This is an abstract class that is used by CEGUI to interface with X ML parser libraries. | This is an abstract class that is used by CEGUI to interface with X ML parser libraries. | |||
*/ | */ | |||
class CEGUIEXPORT XMLParser | class CEGUIEXPORT XMLParser : public PropertySet | |||
{ | { | |||
public: | public: | |||
/*! | /*! | |||
\brief | \brief | |||
XMLParser base class constructor. | XMLParser base class constructor. | |||
*/ | */ | |||
XMLParser(void); | XMLParser(void); | |||
/*! | /*! | |||
\brief | \brief | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
CEGUIXercesParser.h | CEGUIXercesParser.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |||
* OTHER DEALINGS IN THE SOFTWARE. | * OTHER DEALINGS IN THE SOFTWARE. | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef _CEGUIXercesParser_h_ | #ifndef _CEGUIXercesParser_h_ | |||
#define _CEGUIXercesParser_h_ | #define _CEGUIXercesParser_h_ | |||
#include "CEGUIXMLParser.h" | #include "../../CEGUIXMLParser.h" | |||
#include "CEGUIXercesParserProperties.h" | ||||
#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC) | |||
# ifdef CEGUIXERCESPARSER_EXPORTS | # ifdef CEGUIXERCESPARSER_EXPORTS | |||
# define CEGUIXERCESPARSER_API __declspec(dllexport) | # define CEGUIXERCESPARSER_API __declspec(dllexport) | |||
# else | # else | |||
# define CEGUIXERCESPARSER_API __declspec(dllimport) | # define CEGUIXERCESPARSER_API __declspec(dllimport) | |||
# endif | # endif | |||
#else | #else | |||
# define CEGUIXERCESPARSER_API | # define CEGUIXERCESPARSER_API | |||
#endif | #endif | |||
skipping to change at line 65 | skipping to change at line 66 | |||
{ | { | |||
class XercesHandler : public XERCES_CPP_NAMESPACE::DefaultHandler | class XercesHandler : public XERCES_CPP_NAMESPACE::DefaultHandler | |||
{ | { | |||
public: | public: | |||
XercesHandler(XMLHandler& handler); | XercesHandler(XMLHandler& handler); | |||
~XercesHandler(void); | ~XercesHandler(void); | |||
// Implementation of methods in Xerces DefaultHandler. | // Implementation of methods in Xerces DefaultHandler. | |||
void startElement(const XMLCh* const uri, const XMLCh* const localn ame, const XMLCh* const qname, const XERCES_CPP_NAMESPACE::Attributes& attr s); | void startElement(const XMLCh* const uri, const XMLCh* const localn ame, const XMLCh* const qname, const XERCES_CPP_NAMESPACE::Attributes& attr s); | |||
void endElement(const XMLCh* const uri, const XMLCh* const localnam e, const XMLCh* const qname); | void endElement(const XMLCh* const uri, const XMLCh* const localnam e, const XMLCh* const qname); | |||
#if _XERCES_VERSION >= 30000 | ||||
void characters(const XMLCh* const chars, const XMLSize_t length); | ||||
#else /* _XERCES_VERSION >= 30000 */ | ||||
void characters (const XMLCh *const chars, const unsigned int lengt h); | void characters (const XMLCh *const chars, const unsigned int lengt h); | |||
#endif /* _XERCES_VERSION >= 30000 */ | ||||
void warning (const XERCES_CPP_NAMESPACE::SAXParseException &exc); | void warning (const XERCES_CPP_NAMESPACE::SAXParseException &exc); | |||
void error (const XERCES_CPP_NAMESPACE::SAXParseException &exc); | void error (const XERCES_CPP_NAMESPACE::SAXParseException &exc); | |||
void fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exc ); | void fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exc ); | |||
protected: | protected: | |||
XMLHandler& d_handler; //!< This is the 'real' CEGUI based han dler which we interface via. | XMLHandler& d_handler; //!< This is the 'real' CEGUI based han dler which we interface via. | |||
}; | }; | |||
/*! | /*! | |||
\brief | \brief | |||
skipping to change at line 141 | skipping to change at line 146 | |||
static void initialiseSchema(XERCES_CPP_NAMESPACE::SAX2XMLReader* r eader, const String& schemaName, const String& xmlFilename, const String& r esourceGroup); | static void initialiseSchema(XERCES_CPP_NAMESPACE::SAX2XMLReader* r eader, const String& schemaName, const String& xmlFilename, const String& r esourceGroup); | |||
static XERCES_CPP_NAMESPACE::SAX2XMLReader* createReader(XERCES_CPP _NAMESPACE::DefaultHandler& handler); | static XERCES_CPP_NAMESPACE::SAX2XMLReader* createReader(XERCES_CPP _NAMESPACE::DefaultHandler& handler); | |||
static void doParse(XERCES_CPP_NAMESPACE::SAX2XMLReader* parser, co nst String& xmlFilename, const String& resourceGroup); | static void doParse(XERCES_CPP_NAMESPACE::SAX2XMLReader* parser, co nst String& xmlFilename, const String& resourceGroup); | |||
// Implementation of abstract interface. | // Implementation of abstract interface. | |||
bool initialiseImpl(void); | bool initialiseImpl(void); | |||
void cleanupImpl(void); | void cleanupImpl(void); | |||
//! holds the default resource group ID for loading schemas. | //! holds the default resource group ID for loading schemas. | |||
static String d_defaultSchemaResourceGroup; | static String d_defaultSchemaResourceGroup; | |||
//! Property for accessing the default schema resource group ID. | ||||
static XercesParserProperties::SchemaDefaultResourceGroup | ||||
s_schemaDefaultResourceGroupProperty; | ||||
}; | }; | |||
} // End of CEGUI namespace section | } // End of CEGUI namespace section | |||
#endif // end of guard _CEGUIXercesParser_h_ | #endif // end of guard _CEGUIXercesParser_h_ | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 9 lines changed or added | |||