/usr/include/cegui-0.8.7/CEGUI/widgets/ListboxTextItem.h is in libcegui-mk2-dev 0.8.7-1.3+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | /***********************************************************************
created: 12/6/2004
author: Paul D Turner
purpose: Interface for list box text items
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* 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
* OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUIListboxTextItem_h_
#define _CEGUIListboxTextItem_h_
#include "./ListboxItem.h"
#include "../BasicRenderedStringParser.h"
#include "../DefaultRenderedStringParser.h"
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Class used for textual items in a list box.
*/
class CEGUIEXPORT ListboxTextItem : public ListboxItem
{
public:
/*************************************************************************
Constants
*************************************************************************/
static const Colour DefaultTextColour; //!< Default text colour.
/*************************************************************************
Construction and Destruction
*************************************************************************/
/*!
\brief
base class constructor
*/
ListboxTextItem(const String& text, uint item_id = 0, void* item_data = 0, bool disabled = false, bool auto_delete = true);
/*!
\brief
base class destructor
*/
virtual ~ListboxTextItem(void) {}
/*************************************************************************
Accessor methods
*************************************************************************/
/*!
\brief
Return a pointer to the font being used by this ListboxTextItem
This method will try a number of places to find a font to be used. If no font can be
found, NULL is returned.
\return
Font to be used for rendering this item
*/
const Font* getFont(void) const;
/*!
\brief
Return the current colours used for text rendering.
\return
ColourRect object describing the currently set colours
*/
ColourRect getTextColours(void) const {return d_textCols;}
/*************************************************************************
Manipulator methods
*************************************************************************/
/*!
\brief
Set the font to be used by this ListboxTextItem
\param font
Font to be used for rendering this item
\return
Nothing
*/
void setFont(Font* font);
/*!
\brief
Set the font to be used by this ListboxTextItem
\param font_name
String object containing the name of the Font to be used for rendering this item
\return
Nothing
*/
void setFont(const String& font_name);
/*!
\brief
Set the colours used for text rendering.
\param cols
ColourRect object describing the colours to be used.
\return
Nothing.
*/
void setTextColours(const ColourRect& cols) {d_textCols = cols;}
/*!
\brief
Set the colours used for text rendering.
\param top_left_colour
Colour (as ARGB value) to be applied to the top-left corner of each text glyph rendered.
\param top_right_colour
Colour (as ARGB value) to be applied to the top-right corner of each text glyph rendered.
\param bottom_left_colour
Colour (as ARGB value) to be applied to the bottom-left corner of each text glyph rendered.
\param bottom_right_colour
Colour (as ARGB value) to be applied to the bottom-right corner of each text glyph rendered.
\return
Nothing.
*/
void setTextColours(Colour top_left_colour, Colour top_right_colour, Colour bottom_left_colour, Colour bottom_right_colour);
/*!
\brief
Set the colours used for text rendering.
\param col
colour value to be used when rendering.
\return
Nothing.
*/
void setTextColours(Colour col) {setTextColours(col, col, col, col);}
/*!
\brief
Set whether the the ListboxTextItem will have it's text parsed via the
BasicRenderedStringParser or not.
\param enable
- true if the ListboxTextItem text will be parsed.
- false if the ListboxTextItem text will be used verbatim.
*/
void setTextParsingEnabled(const bool enable);
//! return whether text parsing is enabled for this ListboxTextItem.
bool isTextParsingEnabled() const;
// base class overrides
void setText(const String& text);
bool handleFontRenderSizeChange(const Font* const font);
/*************************************************************************
Required implementations of pure virtuals from the base class.
*************************************************************************/
Sizef getPixelSize(void) const;
void draw(GeometryBuffer& buffer, const Rectf& targetRect, float alpha, const Rectf* clipper) const;
protected:
void parseTextString() const;
/*************************************************************************
Implementation Data
*************************************************************************/
ColourRect d_textCols; //!< Colours used for rendering the text.
Font* d_font; //!< Font used for rendering text.
//! Parser used to produce a final RenderedString from the standard String.
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;
//! Parser used when parsing is off. Basically just does linebreaks.
static DefaultRenderedStringParser d_noTagsStringParser;
//! boolean that specifies whether text parsing is enabled for the item.
bool d_textParsingEnabled;
};
} // End of CEGUI namespace section
#endif // end of guard _CEGUIListboxTextItem_h_
|