allegro.hpp   allegro.hpp 
skipping to change at line 60 skipping to change at line 60
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef GCN_ALLEGRO_HPP #ifndef GCN_ALLEGRO_HPP
#define GCN_ALLEGRO_HPP #define GCN_ALLEGRO_HPP
#include <guichan/allegro/allegrofont.hpp>
#include <guichan/allegro/allegrographics.hpp> #include <guichan/allegro/allegrographics.hpp>
#include <guichan/allegro/allegroimage.hpp> #include <guichan/allegro/allegroimage.hpp>
#include <guichan/allegro/allegroimageloader.hpp> #include <guichan/allegro/allegroimageloader.hpp>
#include <guichan/allegro/allegroinput.hpp> #include <guichan/allegro/allegroinput.hpp>
extern "C" extern "C"
{ {
/** /**
* Exists to be able to check for Guichan Allegro with autotools. * Exists to be able to check for Guichan Allegro with autotools.
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 allegrographics.hpp   allegrographics.hpp 
skipping to change at line 113 skipping to change at line 113
*/ */
virtual void setTarget(BITMAP *target); virtual void setTarget(BITMAP *target);
/** /**
* Gets the target bitmap. * Gets the target bitmap.
* *
* @return the target bitmap. * @return the target bitmap.
*/ */
virtual BITMAP *getTarget(); virtual BITMAP *getTarget();
/**
* Gets the color in Allegro format.
*
* @return the color in Allegro format.
*/
int getAllegroColor() const;
/**
* Draws an Allegro bitmap.
*
* @param bitmap the bitmap to draw.
* @param dstX the x-coordinate where to draw the bitmap.
* @param dstY the y-coordinate where to draw the bitmap.
*/
virtual void drawBitmap(BITMAP* bitmap, int dstX, int dstY);
// Inherited from Graphics // Inherited from Graphics
virtual void _beginDraw(); virtual void _beginDraw();
virtual void _endDraw(); virtual void _endDraw();
virtual bool pushClipArea(Rectangle area); virtual bool pushClipArea(Rectangle area);
virtual void popClipArea(); virtual void popClipArea();
virtual void drawImage(const Image* image, int srcX, int srcY, virtual void drawImage(const Image* image,
int dstX, int dstY, int width, int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height); int height);
virtual void drawPoint(int x, int y); virtual void drawPoint(int x, int y);
virtual void drawLine(int x1, int y1, int x2, int y2); virtual void drawLine(int x1, int y1, int x2, int y2);
virtual void drawRectangle(const Rectangle& rectangle); virtual void drawRectangle(const Rectangle& rectangle);
virtual void fillRectangle(const Rectangle& rectangle); virtual void fillRectangle(const Rectangle& rectangle);
virtual void setColor(const Color& color); virtual void setColor(const Color& color);
virtual const Color& getColor(); virtual const Color& getColor() const;
protected: protected:
BITMAP *mTarget; BITMAP *mTarget;
bool mClipNull; bool mClipNull;
int mAlColor; int mAllegroColor;
Color mColor; Color mColor;
}; };
} }
#endif // end GCN_ALLEGROGRAPHICS_HPP #endif // end GCN_ALLEGROGRAPHICS_HPP
 End of changes. 4 change blocks. 
4 lines changed or deleted 24 lines changed or added


 button.hpp   button.hpp 
skipping to change at line 62 skipping to change at line 62
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef GCN_BUTTON_HPP #ifndef GCN_BUTTON_HPP
#define GCN_BUTTON_HPP #define GCN_BUTTON_HPP
#include <string> #include <string>
#include "guichan/focuslistener.hpp"
#include "guichan/keylistener.hpp" #include "guichan/keylistener.hpp"
#include "guichan/mouseevent.hpp" #include "guichan/mouseevent.hpp"
#include "guichan/mouselistener.hpp" #include "guichan/mouselistener.hpp"
#include "guichan/platform.hpp" #include "guichan/platform.hpp"
#include "guichan/widget.hpp" #include "guichan/widget.hpp"
namespace gcn namespace gcn
{ {
/** /**
* A regular button. Add an ActionListener to it to know when it * A regular button. Add an ActionListener to it to know when it
* has been clicked. * has been clicked.
* *
* NOTE: You can only have text (a caption) on the button. If you want it * NOTE: You can only have text (a caption) on the button. If you want it
* to handle, for instance images, you can implement an ImageButt on * to handle, for instance images, you can implement an ImageButt on
* of your own and overload member functions from Button. * of your own and overload member functions from Button.
*/ */
class GCN_CORE_DECLSPEC Button : public Widget, class GCN_CORE_DECLSPEC Button : public Widget,
public MouseListener, public MouseListener,
public KeyListener public KeyListener,
public FocusListener
{ {
public: public:
/** /**
* Constructor. * Constructor.
*/ */
Button(); Button();
/** /**
* Constructor. * Constructor.
* *
skipping to change at line 142 skipping to change at line 144
* @return true if the button is pressed down. * @return true if the button is pressed down.
*/ */
virtual bool isPressed() const; virtual bool isPressed() const;
//Inherited from Widget //Inherited from Widget
virtual void draw(Graphics* graphics); virtual void draw(Graphics* graphics);
virtual void drawBorder(Graphics* graphics); virtual void drawBorder(Graphics* graphics);
virtual void focusLost(); // Inherited from FocusListener
virtual void focusLost(const Event& event);
// Inherited from MouseListener // Inherited from MouseListener
virtual void mousePressed(MouseEvent& mouseEvent); virtual void mousePressed(MouseEvent& mouseEvent);
virtual void mouseReleased(MouseEvent& mouseEvent); virtual void mouseReleased(MouseEvent& mouseEvent);
virtual void mouseEntered(MouseEvent& mouseEvent); virtual void mouseEntered(MouseEvent& mouseEvent);
virtual void mouseExited(MouseEvent& mouseEvent); virtual void mouseExited(MouseEvent& mouseEvent);
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 dropdown.hpp   dropdown.hpp 
skipping to change at line 64 skipping to change at line 64
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef GCN_DROPDOWN_HPP #ifndef GCN_DROPDOWN_HPP
#define GCN_DROPDOWN_HPP #define GCN_DROPDOWN_HPP
#include "guichan/actionlistener.hpp" #include "guichan/actionlistener.hpp"
#include "guichan/basiccontainer.hpp" #include "guichan/basiccontainer.hpp"
#include "guichan/deathlistener.hpp" #include "guichan/deathlistener.hpp"
#include "guichan/focushandler.hpp" #include "guichan/focushandler.hpp"
#include "guichan/focuslistener.hpp"
#include "guichan/keylistener.hpp" #include "guichan/keylistener.hpp"
#include "guichan/listmodel.hpp" #include "guichan/listmodel.hpp"
#include "guichan/mouselistener.hpp" #include "guichan/mouselistener.hpp"
#include "guichan/platform.hpp" #include "guichan/platform.hpp"
#include "guichan/widgets/listbox.hpp" #include "guichan/widgets/listbox.hpp"
#include "guichan/widgets/scrollarea.hpp" #include "guichan/widgets/scrollarea.hpp"
namespace gcn namespace gcn
{ {
/** /**
skipping to change at line 86 skipping to change at line 87
* DroppedDown box it uses one ScrollArea and one ListBox. It also uses an * DroppedDown box it uses one ScrollArea and one ListBox. It also uses an
* internal FocusHandler to handle the focus of the internal ScollArea and * internal FocusHandler to handle the focus of the internal ScollArea and
* ListBox. DropDown uses a ListModel to handle the list. To be able to use * ListBox. DropDown uses a ListModel to handle the list. To be able to use
* DropDown you must give DropDown an implemented ListModel which repre sents * DropDown you must give DropDown an implemented ListModel which repre sents
* your list. * your list.
*/ */
class GCN_CORE_DECLSPEC DropDown : class GCN_CORE_DECLSPEC DropDown :
public ActionListener, public ActionListener,
public BasicContainer, public BasicContainer,
public KeyListener, public KeyListener,
public MouseListener public MouseListener,
public FocusListener
{ {
public: public:
/** /**
* Contructor. * Contructor.
* *
* @param listModel the ListModel to use. * @param listModel the ListModel to use.
* @param scrollArea the ScrollArea to use. * @param scrollArea the ScrollArea to use.
* @param listBox the listBox to use. * @param listBox the listBox to use.
* @see ListModel, ScrollArea, ListBox. * @see ListModel, ScrollArea, ListBox.
*/ */
skipping to change at line 145 skipping to change at line 147
* Adjusts the height of the DropDown fitting it's parents height. * Adjusts the height of the DropDown fitting it's parents height.
*/ */
virtual void adjustHeight(); virtual void adjustHeight();
// Inherited from Widget // Inherited from Widget
virtual void draw(Graphics* graphics); virtual void draw(Graphics* graphics);
virtual void drawBorder(Graphics* graphics); virtual void drawBorder(Graphics* graphics);
virtual void focusLost();
virtual void setBaseColor(const Color& color); virtual void setBaseColor(const Color& color);
virtual void setBackgroundColor(const Color& color); virtual void setBackgroundColor(const Color& color);
virtual void setForegroundColor(const Color& color); virtual void setForegroundColor(const Color& color);
virtual void logic();
virtual void setFont(Font *font); virtual void setFont(Font *font);
// Inherited from BasicContainer // Inherited from BasicContainer
virtual Rectangle getChildrenArea(); virtual Rectangle getChildrenArea();
// Inherited from FocusListener
virtual void focusLost(const Event& event);
// Inherited from ActionListener // Inherited from ActionListener
virtual void action(const ActionEvent& actionEvent); virtual void action(const ActionEvent& actionEvent);
// Inherited from DeathListener // Inherited from DeathListener
virtual void death(const Event& event); virtual void death(const Event& event);
// Inherited from KeyListener // Inherited from KeyListener
 End of changes. 5 change blocks. 
5 lines changed or deleted 7 lines changed or added


 focushandler.hpp   focushandler.hpp 
skipping to change at line 62 skipping to change at line 62
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef GCN_FOCUSHANDLER_HPP #ifndef GCN_FOCUSHANDLER_HPP
#define GCN_FOCUSHANDLER_HPP #define GCN_FOCUSHANDLER_HPP
#include <vector> #include <vector>
#include "guichan/event.hpp"
#include "guichan/platform.hpp" #include "guichan/platform.hpp"
namespace gcn namespace gcn
{ {
class Widget; class Widget;
/** /**
* Used to keep track of widget focus. You will probably not have * Used to keep track of widget focus. You will probably not have
* to use the FocusHandler directly to handle focus. Widget has * to use the FocusHandler directly to handle focus. Widget has
* functions for handling focus which uses a FocusHandler. Use them * functions for handling focus which uses a FocusHandler. Use them
* instead. * instead.
* *
* @see Widget::isFocused * @see Widget::isFocused
* @see Widget::requestFocus * @see Widget::requestFocus
* @see Widget::setFocusable * @see Widget::setFocusable
* @see Widget::isFocusable * @see Widget::isFocusable
* @see Widget::gotFocus * @see FocusListener
* @see Widget::lostFocus
*/ */
class GCN_CORE_DECLSPEC FocusHandler class GCN_CORE_DECLSPEC FocusHandler
{ {
public: public:
/** /**
* Constructor. * Constructor.
*/ */
FocusHandler(); FocusHandler();
/** /**
* Destructor. * Destructor.
*/ */
virtual ~FocusHandler() { }; virtual ~FocusHandler() { };
/** /**
* Sets focus to a widget. Widget::lostFocus and * Sets focus to a widget. A focus event will also be sent to the w
* Widget::gotFocus will be called. idget's
* focus listeners.
* *
* @param widget the widget to focus. * @param widget the widget to focus.
*/ */
virtual void requestFocus(Widget* widget); virtual void requestFocus(Widget* widget);
/** /**
* Sets modal focus to a widget. * Sets modal focus to a widget.
* *
* @param widget the Widget to focus modal. * @param widget the Widget to focus modal.
* @throws Exception when another widget already has modal focus. * @throws Exception when another widget already has modal focus.
skipping to change at line 200 skipping to change at line 200
virtual void add(Widget* widget); virtual void add(Widget* widget);
/** /**
* Removes a widget from the FocusHandler. * Removes a widget from the FocusHandler.
* *
* @param widget the widget to remove. * @param widget the widget to remove.
*/ */
virtual void remove(Widget* widget); virtual void remove(Widget* widget);
/** /**
* Focuses nothing. * Focuses nothing. A focus event will also be sent to the focused
widget's
* focus listeners if a widget has focus.
*/ */
virtual void focusNone(); virtual void focusNone();
/** /**
* Focuses the next Widget which allows tab in unless current focus ed * Focuses the next Widget which allows tab in unless current focus ed
* Widget disallows tab out. * Widget disallows tab out.
*/ */
virtual void tabNext(); virtual void tabNext();
/** /**
* Focuses the previous Widget which allows tab in unless current f ocused * Focuses the previous Widget which allows tab in unless current f ocused
* Widget disallows tab out. * Widget disallows tab out.
*/ */
virtual void tabPrevious(); virtual void tabPrevious();
/** /**
* Applies the changes. * Gets the widget being dragged.
*
* @return the widget being dragged.
*/ */
virtual void applyChanges(); virtual Widget* getDraggedWidget();
/**
* Sets the widget being dragged.
*
* @param draggedWidget the widget being dragged.
*/
virtual void setDraggedWidget(Widget* draggedWidget);
/**
* Gets the last widget with the mouse.
*
* @return the last widget with the mouse.
*/
virtual Widget* getLastWidgetWithMouse();
/**
* Sets the last widget with the mouse.
*
* @param lastWidgetWithMouse the last widget with the mouse.
*/
virtual void setLastWidgetWithMouse(Widget* lastWidgetWithMouse);
/**
* Gets the last widget with modal focus.
*
* @return the last widget with modal focus.
*/
virtual Widget* getLastWidgetWithModalFocus();
/**
* Sets the last widget with modal focus.
*
* @param lastWidgetWithModalFocus the last widget with modal focus
.
*/
virtual void setLastWidgetWithModalFocus(Widget* lastWidgetWithModa
lFocus);
/**
* Gets the last widget with modal mouse input focus.
*
* @return the last widget with modal mouse input focus.
*/
virtual Widget* getLastWidgetWithModalMouseInputFocus();
/**
* Sets the last widget with modal mouse input focus.
*
* @param lastMouseWithModalMouseInputFocus the last widget with m
odal mouse input focus.
*/
virtual void setLastWidgetWithModalMouseInputFocus(Widget* lastWidg
etWithModalMouseInputFocus);
/**
* Gets the last widget pressed.
*
* @return the last widget pressed.
*/
virtual Widget* getLastWidgetPressed();
/**
* Sets the last widget pressed.
*
* @param lastWidgetPressed the last widget pressed.
*/
virtual void setLastWidgetPressed(Widget* lastWidgetPressed);
protected: protected:
/**
* Distributes a focus lost event.
*
* @param focusEvent the event to distribute.
* @author Olof Naess
* @since 0.7.0
*/
virtual void distributeFocusLostEvent(const Event& focusEvent);
/**
* Distributes a focus gained event.
*
* @param focusEvent the event to distribute.
* @author Olof Naess
* @since 0.7.0
*/
virtual void distributeFocusGainedEvent(const Event& focusEvent);
typedef std::vector<Widget*> WidgetVector; typedef std::vector<Widget*> WidgetVector;
typedef WidgetVector::iterator WidgetIterator; typedef WidgetVector::iterator WidgetIterator;
WidgetVector mWidgets; WidgetVector mWidgets;
Widget* mFocusedWidget; Widget* mFocusedWidget;
Widget* mToBeFocused;
Widget* mModalFocusedWidget; Widget* mModalFocusedWidget;
Widget* mModalMouseInputFocusedWidget; Widget* mModalMouseInputFocusedWidget;
Widget* mDraggedWidget;
Widget* mLastWidgetWithMouse;
Widget* mLastWidgetWithModalFocus;
Widget* mLastWidgetWithModalMouseInputFocus;
Widget* mLastWidgetPressed;
}; };
} }
#endif // end GCN_FOCUSHANDLER_HPP #endif // end GCN_FOCUSHANDLER_HPP
 End of changes. 9 change blocks. 
8 lines changed or deleted 103 lines changed or added


 font.hpp   font.hpp 
skipping to change at line 107 skipping to change at line 107
/** /**
* Gets a string index in a string providing an x coordinate. * Gets a string index in a string providing an x coordinate.
* Used to retrive a string index (for a character in a * Used to retrive a string index (for a character in a
* string) at a certain x position. It is especially useful * string) at a certain x position. It is especially useful
* when a mouse clicks in a TextField and you want to know which * when a mouse clicks in a TextField and you want to know which
* character was clicked. * character was clicked.
* *
* @return a string index in a string providing an x coordinate. * @return a string index in a string providing an x coordinate.
*/ */
virtual int getStringIndexAt(const std::string& text, int x); virtual int getStringIndexAt(const std::string& text, int x) const;
/** /**
* Draws a string. * Draws a string.
* *
* NOTE: You normally won't use this function to draw text since * NOTE: You normally won't use this function to draw text since
* Graphics contains better functions for drawing text. * Graphics contains better functions for drawing text.
* *
* @param graphics a Graphics object to use for drawing. * @param graphics a Graphics object to use for drawing.
* @param text the string to draw. * @param text the string to draw.
* @param x the x coordinate where to draw the string. * @param x the x coordinate where to draw the string.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 graphics.hpp   graphics.hpp 
skipping to change at line 181 skipping to change at line 181
* coordinate (20, 20). * coordinate (20, 20).
* *
* @param image the Image to draw. * @param image the Image to draw.
* @param srcX source Image x coordinate. * @param srcX source Image x coordinate.
* @param srcY source Image y coordinate. * @param srcY source Image y coordinate.
* @param dstX destination x coordinate. * @param dstX destination x coordinate.
* @param dstY destination y coordinate. * @param dstY destination y coordinate.
* @param width the width of the piece. * @param width the width of the piece.
* @param height the height of the piece. * @param height the height of the piece.
*/ */
virtual void drawImage(const Image* image, int srcX, int srcY, virtual void drawImage(const Image* image,
int dstX, int dstY, int width, int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height) = 0; int height) = 0;
/** /**
* Draws an image. A simplified version of the other drawImage. * Draws an image. A simplified version of the other drawImage.
* It will draw a whole image at the coordinate you specify. * It will draw a whole image at the coordinate you specify.
* It is equivalent to calling: * It is equivalent to calling:
* @code drawImage(myImage, 0, 0, dstX, dstY, image->getWidth(), \ * @code drawImage(myImage, 0, 0, dstX, dstY, image->getWidth(), \
image->getHeight()); @endcode image->getHeight()); @endcode
*/ */
virtual void drawImage(const Image* image, int dstX, int dstY); virtual void drawImage(const Image* image, int dstX, int dstY);
skipping to change at line 237 skipping to change at line 241
* *
* @param color a Color. * @param color a Color.
*/ */
virtual void setColor(const Color& color) = 0; virtual void setColor(const Color& color) = 0;
/** /**
* Gets the Color to use when drawing. * Gets the Color to use when drawing.
* *
* @return the Color used when drawing. * @return the Color used when drawing.
*/ */
virtual const Color& getColor() = 0; virtual const Color& getColor() const = 0;
/** /**
* Sets the font to use when drawing text. * Sets the font to use when drawing text.
* *
* @param font the Font to use when drawing. * @param font the Font to use when drawing.
*/ */
virtual void setFont(Font* font); virtual void setFont(Font* font);
/** /**
* Draws text. * Draws text.
* *
* @param text the text to draw. * @param text the text to draw.
* @param x the x coordinate where to draw the text. * @param x the x coordinate where to draw the text.
* @param y the y coordinate where to draw the text. * @param y the y coordinate where to draw the text.
* @param alignment Graphics::LEFT, Graphics::CENTER or Graphics::R IGHT. * @param alignment Graphics::LEFT, Graphics::CENTER or Graphics::R IGHT.
* @throws Exception when no Font is set. * @throws Exception when no Font is set.
*/ */
virtual void drawText(const std::string& text, int x, int y, virtual void drawText(const std::string& text,
int x,
int y,
unsigned int alignment = LEFT); unsigned int alignment = LEFT);
/** /**
* Alignments for text drawing. * Alignments for text drawing.
*/ */
enum enum
{ {
LEFT = 0, LEFT = 0,
CENTER, CENTER,
RIGHT RIGHT
}; };
 End of changes. 3 change blocks. 
4 lines changed or deleted 10 lines changed or added


 gui.hpp   gui.hpp 
skipping to change at line 280 skipping to change at line 280
* Handles modal focus releases. When a release occurs appropriate mouse events * Handles modal focus releases. When a release occurs appropriate mouse events
* should be distributed (such as mouse entered and mouse exited). * should be distributed (such as mouse entered and mouse exited).
* *
* @since 0.6.0 * @since 0.6.0
*/ */
virtual void handleModalFocusRelease(); virtual void handleModalFocusRelease();
/** /**
* Distributes a mouse event. * Distributes a mouse event.
* *
* @param mouseEvent the mouse event to distribute. * @param type The type of the event to distribute,
* @param button The button of the event (if any used) to distribut
e.
* @param x The x coordinate of the event.
* @param y The y coordinate of the event.
* @param fource indicates whether the distribution should be force d or not. * @param fource indicates whether the distribution should be force d or not.
* A forced distribution distributes the event even i f a widget * A forced distribution distributes the event even i f a widget
* is not enabled or not visible. Default value is fa lse. * is not enabled or not visible. Default value is fa lse.
* @param toSourceOnly indicates whether the distribution should be to the * @param toSourceOnly indicates whether the distribution should be to the
* source widget only or to it's parent's mouse listeners * source widget only or to it's parent's mouse listeners
* as well. * as well.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
virtual void distributeMouseEvent(MouseEvent& mouseEvent, bool forc virtual void distributeMouseEvent(Widget* source,
e = false, bool toSourceOnly = false); int type,
int button,
int x,
int y,
bool force = false,
bool toSourceOnly = false);
/** /**
* Distributes a key event. * Distributes a key event.
* *
* @param keyEvent the key event to distribute. * @param keyEvent the key event to distribute.
* @since 0.6.0 * @since 0.6.0
*/ */
virtual void distributeKeyEvent(KeyEvent& keyEvent); virtual void distributeKeyEvent(KeyEvent& keyEvent);
skipping to change at line 346 skipping to change at line 355
Input* mInput; Input* mInput;
FocusHandler* mFocusHandler; FocusHandler* mFocusHandler;
bool mTabbing; bool mTabbing;
typedef std::list<KeyListener*> KeyListenerList; typedef std::list<KeyListener*> KeyListenerList;
typedef KeyListenerList::iterator KeyListenerListIterator; typedef KeyListenerList::iterator KeyListenerListIterator;
KeyListenerList mKeyListeners; KeyListenerList mKeyListeners;
Widget* mDraggedWidget;
Widget* mLastWidgetWithMouse;
Widget* mLastWidgetWithModalFocus;
Widget* mLastWidgetWithModalMouseInputFocus;
Widget* mLastWidgetPressed;
// Current input state // Current input state
bool mShiftPressed; bool mShiftPressed;
bool mMetaPressed; bool mMetaPressed;
bool mControlPressed; bool mControlPressed;
bool mAltPressed; bool mAltPressed;
// Last mouse state // Last mouse state
unsigned int mLastMousePressButton; unsigned int mLastMousePressButton;
int mLastMousePressTimeStamp; int mLastMousePressTimeStamp;
int mLastMouseX; int mLastMouseX;
int mLastMouseY; int mLastMouseY;
int mClickCount; int mClickCount;
int mLastMouseDragButton;
}; };
} }
#endif // end GCN_GUI_HPP #endif // end GCN_GUI_HPP
/* yakslem - "Women, it's a constant struggle." /* yakslem - "Women, it's a constant struggle."
* finalman - "Yes, but sometimes they succeed with their guesses." * finalman - "Yes, but sometimes they succeed with their guesses."
* yaklsem - "...eh...I was talking about love." * yaklsem - "...eh...I was talking about love."
* finalman - "Oh...ok..." * finalman - "Oh...ok..."
* An awkward silence followed. * An awkward silence followed.
 End of changes. 4 change blocks. 
9 lines changed or deleted 13 lines changed or added


 guichan.hpp   guichan.hpp 
skipping to change at line 68 skipping to change at line 68
#define GCN_GUICHAN_HPP #define GCN_GUICHAN_HPP
#include <guichan/actionevent.hpp> #include <guichan/actionevent.hpp>
#include <guichan/actionlistener.hpp> #include <guichan/actionlistener.hpp>
#include <guichan/graphics.hpp> #include <guichan/graphics.hpp>
#include <guichan/color.hpp> #include <guichan/color.hpp>
#include <guichan/deathlistener.hpp> #include <guichan/deathlistener.hpp>
#include <guichan/event.hpp> #include <guichan/event.hpp>
#include <guichan/exception.hpp> #include <guichan/exception.hpp>
#include <guichan/focushandler.hpp> #include <guichan/focushandler.hpp>
#include <guichan/focuslistener.hpp>
#include <guichan/font.hpp> #include <guichan/font.hpp>
#include <guichan/genericinput.hpp>
#include <guichan/gui.hpp> #include <guichan/gui.hpp>
#include <guichan/image.hpp> #include <guichan/image.hpp>
#include <guichan/imagefont.hpp> #include <guichan/imagefont.hpp>
#include <guichan/imageloader.hpp> #include <guichan/imageloader.hpp>
#include <guichan/input.hpp> #include <guichan/input.hpp>
#include <guichan/inputevent.hpp> #include <guichan/inputevent.hpp>
#include <guichan/key.hpp> #include <guichan/key.hpp>
#include <guichan/keyevent.hpp> #include <guichan/keyevent.hpp>
#include <guichan/keyinput.hpp> #include <guichan/keyinput.hpp>
#include <guichan/keylistener.hpp> #include <guichan/keylistener.hpp>
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 image.hpp   image.hpp 
skipping to change at line 95 skipping to change at line 95
* Constructor. * Constructor.
*/ */
Image(); Image();
/** /**
* Destructor. * Destructor.
*/ */
virtual ~Image(); virtual ~Image();
/** /**
* Loads an image by calling the Image class' ImageLoader. * Loads an image by calling the Image class' ImageLoader. All imag
e loaders implemented
* in Guichan return a newly instantiated image which must be delet
ed in
* order to avoid a memory leak.
* *
* NOTE: The functions getPixel and putPixel are only guaranteed to work * NOTE: The functions getPixel and putPixel are only guaranteed to work
* before an image has been converted to display format. * before an image has been converted to display format.
* *
* @param filename the file to load. * @param filename the file to load.
* @param convertToDisplayFormat true if the image should be conver ted * @param convertToDisplayFormat true if the image should be conver ted
* to display, false otherwise. * to display, false otherwise.
*/ */
static Image* load(const std::string& filename, bool convertToDispl ayFormat = true); static Image* load(const std::string& filename, bool convertToDispl ayFormat = true);
 End of changes. 1 change blocks. 
1 lines changed or deleted 5 lines changed or added


 openglgraphics.hpp   openglgraphics.hpp 
skipping to change at line 117 skipping to change at line 117
// Inherited from Graphics // Inherited from Graphics
virtual void _beginDraw(); virtual void _beginDraw();
virtual void _endDraw(); virtual void _endDraw();
virtual bool pushClipArea(Rectangle area); virtual bool pushClipArea(Rectangle area);
virtual void popClipArea(); virtual void popClipArea();
virtual void drawImage(const Image* image, int srcX, int srcY, virtual void drawImage(const Image* image,
int dstX, int dstY, int width, int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height); int height);
virtual void drawPoint(int x, int y); virtual void drawPoint(int x, int y);
virtual void drawLine(int x1, int y1, int x2, int y2); virtual void drawLine(int x1, int y1, int x2, int y2);
virtual void drawRectangle(const Rectangle& rectangle); virtual void drawRectangle(const Rectangle& rectangle);
virtual void fillRectangle(const Rectangle& rectangle); virtual void fillRectangle(const Rectangle& rectangle);
virtual void setColor(const Color& color); virtual void setColor(const Color& color);
virtual const Color& getColor(); virtual const Color& getColor() const;
protected: protected:
int mWidth, mHeight; int mWidth, mHeight;
bool mAlpha; bool mAlpha;
Color mColor; Color mColor;
}; };
} }
#endif // end GCN_OPENGLGRAPHICS_HPP #endif // end GCN_OPENGLGRAPHICS_HPP
 End of changes. 2 change blocks. 
3 lines changed or deleted 7 lines changed or added


 widget.hpp   widget.hpp 
skipping to change at line 73 skipping to change at line 73
#include "guichan/color.hpp" #include "guichan/color.hpp"
#include "guichan/rectangle.hpp" #include "guichan/rectangle.hpp"
namespace gcn namespace gcn
{ {
class ActionListener; class ActionListener;
class BasicContainer; class BasicContainer;
class DeathListener; class DeathListener;
class DefaultFont; class DefaultFont;
class FocusHandler; class FocusHandler;
class FocusListener;
class Font; class Font;
class Graphics; class Graphics;
class KeyInput; class KeyInput;
class KeyListener; class KeyListener;
class MouseInput; class MouseInput;
class MouseListener; class MouseListener;
/** /**
* Widget base class. Contains basic widget functions every widget shou ld * Widget base class. Contains basic widget functions every widget shou ld
* have. Widgets should inherit from this class and implements it's * have. Widgets should inherit from this class and implements it's
skipping to change at line 96 skipping to change at line 97
* be overloaded unless you know what you are doing * be overloaded unless you know what you are doing
* *
* @author Olof Naess * @author Olof Naess
* @author Per Larsson. * @author Per Larsson.
*/ */
class GCN_CORE_DECLSPEC Widget class GCN_CORE_DECLSPEC Widget
{ {
public: public:
/** /**
* Constructor. Resets member variables. Noteable, a widget is not * Constructor. Resets member variables. Noteable, a widget is not
* focusable as default, therefore, Widgets that are supposed to be * focusable as default, therefore, widgets that are supposed to be
* focusable should overide this default in their own constructor. * focusable should overide this default in their own constructor.
*/ */
Widget(); Widget();
/** /**
* Default destructor. * Default destructor.
*/ */
virtual ~Widget(); virtual ~Widget();
/** /**
* Draws the Widget. It is called by the parent widget when it is t * Draws the widget. It is called by the parent widget when it is t
ime ime
* for the Widget to draw itself. The graphics object is set up so * for the widget to draw itself. The graphics object is set up so
* that all drawing is relative to the Widget, i.e coordinate (0,0) * that all drawing is relative to the widget, i.e coordinate (0,0)
is is
* the top-left corner of the Widget. It is not possible to draw * the top-left corner of the widget. It is not possible to draw
* outside of a Widgets dimension. * outside of a widgets dimension.
* *
* @param graphics a Graphics object to draw with. * @param graphics a Graphics object to draw with.
*/ */
virtual void draw(Graphics* graphics) = 0; virtual void draw(Graphics* graphics) = 0;
/** /**
* Draws the Widget border. A border is drawn around a Widget. * Draws the widget border. A border is drawn around a widget.
* The width and height of the border is therefore the Widgets * The width and height of the border is therefore the widgets
* height+2*bordersize. Think of a painting that has a certain size , * height+2*bordersize. Think of a painting that has a certain size ,
* the border surrounds the painting. * the border surrounds the painting.
* *
* @param graphics a Graphics object to draw with. * @param graphics a Graphics object to draw with.
*/ */
virtual void drawBorder(Graphics* graphics) { } virtual void drawBorder(Graphics* graphics) { }
/** /**
* Called for all Widgets in the gui each time Gui::logic is called . * Called for all widgets in the gui each time Gui::logic is called .
* You can do logic stuff here like playing an animation. * You can do logic stuff here like playing an animation.
* *
* @see Gui * @see Gui
*/ */
virtual void logic() { } virtual void logic() { }
/** /**
* Gets the Widget parent container. * Gets the widget parent container.
* *
* @return the Widget parent container. Returns NULL if the Widget * @return the widget parent container. Returns NULL if the widget
* has no parent. * has no parent.
*/ */
virtual Widget* getParent() const; virtual Widget* getParent() const;
/** /**
* Sets the width of the Widget in pixels. * Sets the width of the widget in pixels.
* *
* @param width the Widget width in pixels. * @param width the widget width in pixels.
*/ */
virtual void setWidth(int width); virtual void setWidth(int width);
/** /**
* Gets the width of the Widget in pixels. * Gets the width of the widget in pixels.
* *
* @return the Widget with in pixels. * @return the widget with in pixels.
*/ */
virtual int getWidth() const; virtual int getWidth() const;
/** /**
* Sets the height of the Widget in pixels. * Sets the height of the widget in pixels.
* *
* @param height the Widget height in pixels. * @param height the widget height in pixels.
*/ */
virtual void setHeight(int height); virtual void setHeight(int height);
/** /**
* Gets the height of the Widget in pixels. * Gets the height of the widget in pixels.
* *
* @return the Widget height in pixels. * @return the widget height in pixels.
*/ */
virtual int getHeight() const; virtual int getHeight() const;
/** /**
* Sets the size of the Widget. * Sets the size of the widget.
* *
* @param width the width. * @param width the width.
* @param height the height. * @param height the height.
*/ */
virtual void setSize(int width, int height); virtual void setSize(int width, int height);
/** /**
* Set the Widget x coordinate. It is relateive to it's parent. * Set the widget x coordinate. It is relateive to it's parent.
* *
* @param x the Widget x coordinate. * @param x the widget x coordinate.
*/ */
virtual void setX(int x); virtual void setX(int x);
/** /**
* Gets the Widget x coordinate. It is relative to it's parent. * Gets the widget x coordinate. It is relative to it's parent.
* *
* @return the Widget x coordinate. * @return the widget x coordinate.
*/ */
virtual int getX() const; virtual int getX() const;
/** /**
* Set the Widget y coordinate. It is relative to it's parent. * Set the widget y coordinate. It is relative to it's parent.
* *
* @param y the Widget y coordinate. * @param y the widget y coordinate.
*/ */
virtual void setY(int y); virtual void setY(int y);
/** /**
* Gets the Widget y coordinate. It is relative to it's parent. * Gets the widget y coordinate. It is relative to it's parent.
* *
* @return the Widget y coordinate. * @return the widget y coordinate.
*/ */
virtual int getY() const; virtual int getY() const;
/** /**
* Sets the Widget position. It is relative to it's parent. * Sets the widget position. It is relative to it's parent.
* *
* @param x the Widget x coordinate. * @param x the widget x coordinate.
* @param y the Widgets y coordinate. * @param y the widgets y coordinate.
*/ */
virtual void setPosition(int x, int y); virtual void setPosition(int x, int y);
/** /**
* Sets the dimension of the Widget. It is relative to it's parent. * Sets the dimension of the widget. It is relative to it's parent.
* *
* @param dimension the Widget dimension. * @param dimension the widget dimension.
*/ */
virtual void setDimension(const Rectangle& dimension); virtual void setDimension(const Rectangle& dimension);
/** /**
* Sets the size of the border, or the width if you so like. The si ze * Sets the size of the border, or the width if you so like. The si ze
* is the number of pixels that the border extends outside the Widg et. * is the number of pixels that the border extends outside the widg et.
* Border size = 0 means no border. * Border size = 0 means no border.
* *
* @param borderSize the size of the border. * @param borderSize the size of the border.
* @see drawBorder * @see drawBorder
*/ */
virtual void setBorderSize(unsigned int borderSize); virtual void setBorderSize(unsigned int borderSize);
/** /**
* Gets the size of the border, or the width if you so like. The si ze * Gets the size of the border, or the width if you so like. The si ze
* is the number of pixels that the border extends outside the Widg et. * is the number of pixels that the border extends outside the widg et.
* Border size = 0 means no border. * Border size = 0 means no border.
* *
* @return the size of the border. * @return the size of the border.
* @see drawBorder * @see drawBorder
*/ */
virtual unsigned int getBorderSize() const; virtual unsigned int getBorderSize() const;
/** /**
* Gets the dimension of the Widget. It is relative to it's parent. * Gets the dimension of the widget. It is relative to it's parent.
* *
* @return the widget dimension. * @return the widget dimension.
*/ */
virtual const Rectangle& getDimension() const; virtual const Rectangle& getDimension() const;
/** /**
* Sets a Widgets focusability. * Sets a widgets focusability.
* *
* @param focusable true if the Widget should be focusable. * @param focusable true if the widget should be focusable.
*/ */
virtual void setFocusable(bool focusable); virtual void setFocusable(bool focusable);
/** /**
* Checks whether the Widget is focusable. * Checks whether the widget is focusable.
* *
* @return true if the widget is focusable. * @return true if the widget is focusable.
*/ */
virtual bool isFocusable() const; virtual bool isFocusable() const;
/** /**
* Checks if the Widget is focused. * Checks if the widget is focused.
* *
* @return true if the widget currently has focus. * @return true if the widget currently has focus.
*/ */
virtual bool isFocused() const; virtual bool isFocused() const;
/** /**
* Sets the Widget to be disabled or enabled. A disabled * Sets the widget to be disabled or enabled. A disabled
* Widget will never recieve mouse or key input. * widget will never recieve mouse or key input.
* *
* @param enabled true if Widget is enabled. * @param enabled true if widget is enabled.
*/ */
virtual void setEnabled(bool enabled); virtual void setEnabled(bool enabled);
/** /**
* Checks if a Widget is disabled or not. * Checks if a widget is disabled or not.
* *
* @return true if the Widget should be enabled. * @return true if the widget should be enabled.
*/ */
virtual bool isEnabled() const; virtual bool isEnabled() const;
/** /**
* Called if the Widget looses focus. * Sets the widget to be visible.
*/
virtual void focusLost() { };
/**
* Called if the Widget recieves focus.
*/
virtual void focusGained() { };
/**
* Sets the Widget to be visible.
* *
* @param visible true if the Widget should be visiable. * @param visible true if the widget should be visiable.
*/ */
virtual void setVisible(bool visible); virtual void setVisible(bool visible);
/** /**
* Checks if the Widget is visible. * Checks if the widget is visible.
* *
* @return true if the Widget is visible. * @return true if the widget is visible.
*/ */
virtual bool isVisible() const; virtual bool isVisible() const;
/** /**
* Sets the base color. The base color is the background * Sets the base color. The base color is the background
* color for many Widgets like the Button and Contianer Widgets. * color for many widgets like the Button and Contianer widgets.
* *
* @param color the baseground Color. * @param color the baseground color.
*/ */
virtual void setBaseColor(const Color& color); virtual void setBaseColor(const Color& color);
/** /**
* Gets the base color. * Gets the base color.
* *
* @return the foreground Color. * @return the foreground color.
*/ */
virtual const Color& getBaseColor() const; virtual const Color& getBaseColor() const;
/** /**
* Sets the foreground color. * Sets the foreground color.
* *
* @param color the foreground Color. * @param color the foreground color.
*/ */
virtual void setForegroundColor(const Color& color); virtual void setForegroundColor(const Color& color);
/** /**
* Gets the foreground color. * Gets the foreground color.
* *
* @return the foreground Color. * @return the foreground color.
*/ */
virtual const Color& getForegroundColor() const; virtual const Color& getForegroundColor() const;
/** /**
* Sets the background color. * Sets the background color.
* *
* @param color the background Color. * @param color the background Color.
*/ */
virtual void setBackgroundColor(const Color& color); virtual void setBackgroundColor(const Color& color);
/** /**
* Gets the background color. * Gets the background color.
* *
* @return the background Color. * @return the background color.
*/ */
virtual const Color& getBackgroundColor() const; virtual const Color& getBackgroundColor() const;
/** /**
* Requests focus for the Widget. A Widget will only recieve focus * Sets the selection color.
*
* @param color the selection color.
*/
virtual void setSelectionColor(const Color& color);
/**
* Gets the selection color.
*
* @return the selection color.
*/
virtual const Color& getSelectionColor() const;
/**
* Requests focus for the widget. A widget will only recieve focus
* if it is focusable. * if it is focusable.
*/ */
virtual void requestFocus(); virtual void requestFocus();
/** /**
* Requests a move to the top in the parent Widget. * Requests a move to the top in the parent widget.
*/ */
virtual void requestMoveToTop(); virtual void requestMoveToTop();
/** /**
* Requests a move to the bottom in the parent Widget. * Requests a move to the bottom in the parent widget.
*/ */
virtual void requestMoveToBottom(); virtual void requestMoveToBottom();
/** /**
* Sets the FocusHandler to be used. * Sets the FocusHandler to be used.
* *
* WARNING: This function is used internally and should not * WARNING: This function is used internally and should not
* be called or overloaded unless you know what you * be called or overloaded unless you know what you
* are doing. * are doing.
* *
skipping to change at line 391 skipping to change at line 396
* *
* WARNING: This function is used internally and should not * WARNING: This function is used internally and should not
* be called or overloaded unless you know what you * be called or overloaded unless you know what you
* are doing. * are doing.
* *
* @return the FocusHandler used. * @return the FocusHandler used.
*/ */
virtual FocusHandler* _getFocusHandler(); virtual FocusHandler* _getFocusHandler();
/** /**
* Adds an ActionListener to the Widget. When an action is triggere * Adds an ActionListener to the widget. When an action is triggere
d d
* by the Widget, the action function in all the Widget's * by the widget, the action function in all the widget's
* ActionListeners will be called. * ActionListeners will be called.
* *
* @param actionListener the ActionListener to add. * @param actionListener the ActionListener to add.
*/ */
virtual void addActionListener(ActionListener* actionListener); virtual void addActionListener(ActionListener* actionListener);
/** /**
* Removes an added ActionListener from the Widget. * Removes an added ActionListener from the widget.
* *
* @param actionListener the ActionListener to remove. * @param actionListener the ActionListener to remove.
*/ */
virtual void removeActionListener(ActionListener* actionListener); virtual void removeActionListener(ActionListener* actionListener);
/** /**
* Adds a DeathListener to the Widget. When the widget dies * Adds a DeathListener to the widget. When the widget dies
* the death function in all the Widget's DeathListeners will be ca * the death function in all the widget's DeathListeners will be ca
lled. lled.
* *
* @param actionListener the DeathListener to add. * @param actionListener the DeathListener to add.
*/ */
virtual void addDeathListener(DeathListener* deathListener); virtual void addDeathListener(DeathListener* deathListener);
/** /**
* Removes an added DeathListener from the Widget. * Removes an added DeathListener from the widget.
* *
* @param deathListener the DeathListener to remove. * @param deathListener the DeathListener to remove.
*/ */
virtual void removeDeathListener(DeathListener* deathListener); virtual void removeDeathListener(DeathListener* deathListener);
/** /**
* Adds a MouseListener to the Widget. When a mouse message is * Adds a MouseListener to the widget. When a mouse message is
* recieved, it will be sent to the Widget's MouseListeners. * recieved, it will be sent to the widget's MouseListeners.
* *
* @param mouseListener the MouseListener to add. * @param mouseListener the MouseListener to add.
*/ */
virtual void addMouseListener(MouseListener* mouseListener); virtual void addMouseListener(MouseListener* mouseListener);
/** /**
* Removes an added MouseListener from the Widget. * Removes an added MouseListener from the widget.
* *
* @param mouseListener the MouseListener to remove. * @param mouseListener the MouseListener to remove.
*/ */
virtual void removeMouseListener(MouseListener* mouseListener); virtual void removeMouseListener(MouseListener* mouseListener);
/** /**
* Adds a KeyListener to the Widget. When a key message is recieved * Adds a KeyListener to the widget. When a key message is recieved
, ,
* it will be sent to the Widget's KeyListeners. * it will be sent to the widget's KeyListeners.
* *
* @param keyListener the KeyListener to add. * @param keyListener the KeyListener to add.
*/ */
virtual void addKeyListener(KeyListener* keyListener); virtual void addKeyListener(KeyListener* keyListener);
/** /**
* Removes an added KeyListener from the Widget. * Removes an added KeyListener from the widget.
* *
* @param keyListener the KeyListener to remove. * @param keyListener the KeyListener to remove.
*/ */
virtual void removeKeyListener(KeyListener* keyListener); virtual void removeKeyListener(KeyListener* keyListener);
/**
* Adds a FocusListener to the widget. When a focus event is reciev
ed,
* it will be sent to the widget's FocusListeners.
*
* @param focusListener the FocusListener to add.
* @author Olof Naess
* @since 0.7.0
*/
virtual void addFocusListener(FocusListener* focusListener);
/** /**
* Sets the action event identifier of the Widget. The identifier i * Removes an added FocusListener from the widget.
s *
* @param focusListener the FocusListener to remove.
* @author Olof Naess
* @since 0.7.0
*/
virtual void removeFocusListener(FocusListener* FocusListener);
/**
* Sets the action event identifier of the widget. The identifier i
s
* used to be able to identify which action has occured. * used to be able to identify which action has occured.
* *
* NOTE: An action event identifier should not be used to identify a * NOTE: An action event identifier should not be used to identify a
* certain Widget but rather a certain event in your applicat * certain widget but rather a certain event in your applicat
ion. ion.
* Several Widgets can have the same action event identifer. * Several widgets can have the same action event identifer.
* *
* @param actionEventId the action event identifier. * @param actionEventId the action event identifier.
* @since 0.6.0 * @since 0.6.0
*/ */
virtual void setActionEventId(const std::string& actionEventId); virtual void setActionEventId(const std::string& actionEventId);
/** /**
* Gets the action event identifier. * Gets the action event identifier.
* *
* @return the action event identifier. * @return the action event identifier.
*/ */
virtual const std::string& getActionEventId() const; virtual const std::string& getActionEventId() const;
/** /**
* Gets the absolute position on the screen for the Widget. * Gets the absolute position on the screen for the widget.
* *
* @param x absolute x coordinate will be stored in this parameter. * @param x absolute x coordinate will be stored in this parameter.
* @param y absolute y coordinate will be stored in this parameter. * @param y absolute y coordinate will be stored in this parameter.
*/ */
virtual void getAbsolutePosition(int& x, int& y) const; virtual void getAbsolutePosition(int& x, int& y) const;
/** /**
* Sets the parent of the Widget. A parent must be a BasicContainer . * Sets the parent of the widget. A parent must be a BasicContainer .
* *
* WARNING: This function is used internally and should not * WARNING: This function is used internally and should not
* be called or overloaded unless you know what you * be called or overloaded unless you know what you
* are doing. * are doing.
* *
* @param parent the parent BasicContainer.. * @param parent the parent BasicContainer..
*/ */
virtual void _setParent(Widget* parent); virtual void _setParent(Widget* parent);
/** /**
* Gets the font used. If no font has been set, the global font wil l * Gets the font used. If no font has been set, the global font wil l
* be returned instead. If no global font has been set, the default * be returned instead. If no global font has been set, the default
* font will be returend. * font will be returend.
* ugly default. * ugly default.
* *
* @return the used Font. * @return the used Font.
*/ */
Font *getFont() const; Font *getFont() const;
/** /**
* Sets the global font to be used by default for all Widgets. * Sets the global font to be used by default for all widgets.
* *
* @param font the global Font. * @param font the global Font.
*/ */
static void setGlobalFont(Font* font); static void setGlobalFont(Font* font);
/** /**
* Sets the font. If font is NULL, the global font will be used. * Sets the font. If font is NULL, the global font will be used.
* *
* @param font the Font. * @param font the Font.
*/ */
virtual void setFont(Font* font); virtual void setFont(Font* font);
/** /**
* Called when the font has changed. If the change is global, * Called when the font has changed. If the change is global,
* this function will only be called if the Widget don't have a * this function will only be called if the widget don't have a
* font already set. * font already set.
*/ */
virtual void fontChanged() { } virtual void fontChanged() { }
/** /**
* Checks whether a Widget exists or not, that is if it still exist s * Checks whether a widget exists or not, that is if it still exist s
* an instance of the object. * an instance of the object.
* *
* @param widget the Widget to check. * @param widget the widget to check.
*/ */
static bool widgetExists(const Widget* widget); static bool widgetExists(const Widget* widget);
/** /**
* Check if tab in is enabled. Tab in means that you can set focus * Check if tab in is enabled. Tab in means that you can set focus
* to this Widget by pressing the tab button. If tab in is disabled * to this widget by pressing the tab button. If tab in is disabled
* then the FocusHandler will skip this widget and focus the next * then the FocusHandler will skip this widget and focus the next
* in its focus order. * in its focus order.
* *
* @return true if tab in is enabled. * @return true if tab in is enabled.
*/ */
virtual bool isTabInEnabled() const; virtual bool isTabInEnabled() const;
/** /**
* Sets tab in enabled. Tab in means that you can set focus * Sets tab in enabled. Tab in means that you can set focus
* to this Widget by pressing the tab button. If tab in is disabled * to this widget by pressing the tab button. If tab in is disabled
* then the FocusHandler will skip this widget and focus the next * then the FocusHandler will skip this widget and focus the next
* in its focus order. * in its focus order.
* *
* @param enabled true if tab in should be enabled. * @param enabled true if tab in should be enabled.
*/ */
virtual void setTabInEnabled(bool enabled); virtual void setTabInEnabled(bool enabled);
/** /**
* Checks if tab out is enabled. Tab out means that you can lose * Checks if tab out is enabled. Tab out means that you can lose
* focus to this Widget by pressing the tab button. If tab out is * focus to this widget by pressing the tab button. If tab out is
* disabled then the FocusHandler ignores tabbing and focus will * disabled then the FocusHandler ignores tabbing and focus will
* stay with this Widget. * stay with this widget.
* *
* @return true if tab out is enabled. * @return true if tab out is enabled.
*/ */
virtual bool isTabOutEnabled() const; virtual bool isTabOutEnabled() const;
/** /**
* Sets tab out enabled. Tab out means that you can lose * Sets tab out enabled. Tab out means that you can lose
* focus to this Widget by pressing the tab button. If tab out is * focus to this widget by pressing the tab button. If tab out is
* disabled then the FocusHandler ignores tabbing and focus will * disabled then the FocusHandler ignores tabbing and focus will
* stay with this Widget. * stay with this widget.
* *
* @param enabled true if tab out should be enabled. * @param enabled true if tab out should be enabled.
*/ */
virtual void setTabOutEnabled(bool enabled); virtual void setTabOutEnabled(bool enabled);
/** /**
* Requests modal focus. When a widget has modal focus, only that * Requests modal focus. When a widget has modal focus, only that
* widget and it's children may recieve input. * widget and it's children may recieve input.
* *
* @throws Exception if another widget already has modal focus. * @throws Exception if another widget already has modal focus.
skipping to change at line 646 skipping to change at line 670
/** /**
* Gets the key listeners of the widget. * Gets the key listeners of the widget.
* *
* @return the key listeners of the widget. * @return the key listeners of the widget.
* @since 0.6.0 * @since 0.6.0
*/ */
virtual const std::list<KeyListener*>& _getKeyListeners(); virtual const std::list<KeyListener*>& _getKeyListeners();
/** /**
* Gets the focus listeners of the widget.
*
* @return the focus listeners of the widget.
* @since 0.7.0
*/
virtual const std::list<FocusListener*>& _getFocusListeners();
/**
* Gets the subarea of the widget that the children occupy. * Gets the subarea of the widget that the children occupy.
* *
* @return the subarea as a Rectangle. * @return the subarea as a Rectangle.
*/ */
virtual Rectangle getChildrenArea(); virtual Rectangle getChildrenArea();
/** /**
* Gets the internal FocusHandler used. * Gets the internal FocusHandler used.
* *
* @return the internalFocusHandler used. If no internal FocusHandl er * @return the internalFocusHandler used. If no internal FocusHandl er
skipping to change at line 669 skipping to change at line 701
/** /**
* Sets the internal FocusHandler. An internal focushandler is * Sets the internal FocusHandler. An internal focushandler is
* needed if both a widget in the widget and the widget itself * needed if both a widget in the widget and the widget itself
* should be foucsed at the same time. * should be foucsed at the same time.
* *
* @param focusHandler the FocusHandler to be used. * @param focusHandler the FocusHandler to be used.
*/ */
virtual void setInternalFocusHandler(FocusHandler* focusHandler); virtual void setInternalFocusHandler(FocusHandler* focusHandler);
/** /**
* Moves a Widget to the top of this widget. The moved widget will * Moves a widget to the top of this widget. The moved widget will
be be
* drawn above all other widgets in this widget. * drawn above all other widgets in this widget.
* *
* @param widget the Widget to move. * @param widget the widget to move.
*/ */
virtual void moveToTop(Widget* widget) { }; virtual void moveToTop(Widget* widget) { };
/** /**
* Moves a widget in this widget to the bottom of this widget. * Moves a widget in this widget to the bottom of this widget.
* The moved widget will be drawn below all other widgets in this w idget. * The moved widget will be drawn below all other widgets in this w idget.
* *
* @param widget the Widget to move. * @param widget the widget to move.
*/ */
virtual void moveToBottom(Widget* widget) { }; virtual void moveToBottom(Widget* widget) { };
/** /**
* Focuses the next Widget in the widget. * Focuses the next widget in the widget.
*/ */
virtual void focusNext() { }; virtual void focusNext() { };
/** /**
* Focuses the previous Widget in the widget. * Focuses the previous widget in the widget.
*/ */
virtual void focusPrevious() { }; virtual void focusPrevious() { };
/** /**
* Tries to show a specific part of a Widget by moving it. Used if the * Tries to show a specific part of a widget by moving it. Used if the
* widget should act as a container. * widget should act as a container.
* *
* @param widget the target Widget. * @param widget the target widget.
* @param area the area to show. * @param area the area to show.
*/ */
virtual void showWidgetPart(Widget* widget, Rectangle area) { }; virtual void showWidgetPart(Widget* widget, Rectangle area) { };
protected: protected:
/** /**
* Generates an action to the Widget's ActionListeners. * Generates an action to the widget's ActionListeners.
*/ */
void generateAction(); void generateAction();
typedef std::list<MouseListener*> MouseListenerList; typedef std::list<MouseListener*> MouseListenerList;
typedef MouseListenerList::iterator MouseListenerIterator; typedef MouseListenerList::iterator MouseListenerIterator;
MouseListenerList mMouseListeners; MouseListenerList mMouseListeners;
typedef std::list<KeyListener*> KeyListenerList; typedef std::list<KeyListener*> KeyListenerList;
KeyListenerList mKeyListeners; KeyListenerList mKeyListeners;
typedef KeyListenerList::iterator KeyListenerIterator; typedef KeyListenerList::iterator KeyListenerIterator;
typedef std::list<ActionListener*> ActionListenerList; typedef std::list<ActionListener*> ActionListenerList;
ActionListenerList mActionListeners; ActionListenerList mActionListeners;
typedef ActionListenerList::iterator ActionListenerIterator; typedef ActionListenerList::iterator ActionListenerIterator;
typedef std::list<DeathListener*> DeathListenerList; typedef std::list<DeathListener*> DeathListenerList;
DeathListenerList mDeathListeners; DeathListenerList mDeathListeners;
typedef DeathListenerList::iterator DeathListenerIterator; typedef DeathListenerList::iterator DeathListenerIterator;
typedef std::list<FocusListener*> FocusListenerList;
FocusListenerList mFocusListeners;
typedef FocusListenerList::iterator FocusListenerIterator;
Color mForegroundColor; Color mForegroundColor;
Color mBackgroundColor; Color mBackgroundColor;
Color mBaseColor; Color mBaseColor;
Color mSelectionColor;
FocusHandler* mFocusHandler; FocusHandler* mFocusHandler;
FocusHandler* mInternalFocusHandler; FocusHandler* mInternalFocusHandler;
Widget* mParent; Widget* mParent;
Rectangle mDimension; Rectangle mDimension;
unsigned int mBorderSize; unsigned int mBorderSize;
std::string mActionEventId; std::string mActionEventId;
bool mFocusable; bool mFocusable;
bool mVisible; bool mVisible;
bool mTabIn; bool mTabIn;
bool mTabOut; bool mTabOut;
 End of changes. 86 change blocks. 
112 lines changed or deleted 150 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/