diff options
Diffstat (limited to 'backends/platform/wince/CEgui/GUIElement.cpp')
-rw-r--r-- | backends/platform/wince/CEgui/GUIElement.cpp | 152 |
1 files changed, 78 insertions, 74 deletions
diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp index 23e7843de1..7689837e3d 100644 --- a/backends/platform/wince/CEgui/GUIElement.cpp +++ b/backends/platform/wince/CEgui/GUIElement.cpp @@ -23,104 +23,108 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include <SDL.h> + #include "Toolbar.h" #include "SDL_ImageResource.h" namespace CEGUI { - GUIElement::GUIElement(int x, int y, int width, int height) : - _background(0), _drawn(false), _visible(true), _x(x), _y(y), _width(width), _height(height) - { - } +GUIElement::GUIElement(int x, int y, int width, int height) : +_background(0), _drawn(false), _visible(true), _x(x), _y(y), _width(width), _height(height) { +} - bool GUIElement::setBackground(WORD backgroundReference) { - _background = new SDL_ImageResource(); - if (!_background->load(backgroundReference)) { - delete _background; - _background = NULL; - return false; - } - if (!_height && !_width) { - _height = _background->height(); - _width = _background->width(); - } - else - if (_background->height() != _height || _background->width() != _width) { - delete _background; - _background = NULL; - return false; - } - return true; +bool GUIElement::setBackground(WORD backgroundReference) { + _background = new SDL_ImageResource(); + if (!_background->load(backgroundReference)) { + delete _background; + _background = NULL; + return false; } - - void GUIElement::move(int x, int y) { - _x = x; - _y = y; + if (!_height && !_width) { + _height = _background->height(); + _width = _background->width(); } + else + if (_background->height() != _height || _background->width() != _width) { + delete _background; + _background = NULL; + return false; + } + return true; +} - bool GUIElement::draw(SDL_Surface *surface) { - if (_background && !_drawn && _visible) { - SDL_Rect rect; - - rect.x = _x; - rect.y = _y; - rect.w = _width; - rect.h = _height; +void GUIElement::move(int x, int y) { + _x = x; + _y = y; +} - SDL_BlitSurface(_background->get(), NULL, surface, &rect); +bool GUIElement::draw(SDL_Surface *surface) { + if (_background && !_drawn && _visible) { + SDL_Rect rect; - _drawn = true; + rect.x = _x; + rect.y = _y; + rect.w = _width; + rect.h = _height; - return true; - } - else - return false; - } + SDL_BlitSurface(_background->get(), NULL, surface, &rect); - bool GUIElement::checkInside(int x, int y) { - if (x >= _x && x <= _x + _width && y >= _y && y <= _y + _height) - return true; - else - return false; - } + _drawn = true; - void GUIElement::setVisible(bool visibility) { - if (visibility && !_visible) - _drawn = false; - _visible = visibility; + return true; } + else + return false; +} - bool GUIElement::visible() { - return _visible; - } +bool GUIElement::checkInside(int x, int y) { + if (x >= _x && x <= _x + _width && y >= _y && y <= _y + _height) + return true; + else + return false; +} - void GUIElement::forceRedraw() { +void GUIElement::setVisible(bool visibility) { + if (visibility && !_visible) _drawn = false; - } + _visible = visibility; +} - bool GUIElement::drawn() { - return _drawn; - } +bool GUIElement::visible() { + return _visible; +} - int GUIElement::x() { - return _x; - } +void GUIElement::forceRedraw() { + _drawn = false; +} - int GUIElement::y() { - return _y; - } +bool GUIElement::drawn() { + return _drawn; +} - int GUIElement::width() { - return _width; - } +int GUIElement::x() { + return _x; +} - int GUIElement::height() { - return _height; - } +int GUIElement::y() { + return _y; +} - GUIElement::~GUIElement() { - delete _background; - } +int GUIElement::width() { + return _width; +} + +int GUIElement::height() { + return _height; +} +GUIElement::~GUIElement() { + delete _background; } + +} // End of namespace CEGUI |