summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.h27
-rw-r--r--src/gui/window.cpp16
-rw-r--r--src/gui/window.h17
3 files changed, 20 insertions, 40 deletions
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 70afbb79..c709893f 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -63,43 +63,31 @@ class Gui : public gcn::Gui
* Draws the whole Gui by calling draw functions down in the
* Gui hierarchy. It also draws the mouse pointer.
*/
- void
- draw();
+ void draw();
/**
- * Return game font
+ * Return game font.
*/
- gcn::Font*
- getFont() { return mGuiFont; }
+ gcn::Font* getFont() const
+ { return mGuiFont; }
/**
* Sets whether a custom cursor should be rendered.
*/
- void
- setUseCustomCursor(bool customCursor);
+ void setUseCustomCursor(bool customCursor);
/**
* Sets which cursor should be used.
*/
void setCursorType(int index)
- {
- mCursorType = index;
- }
-
- /**
- * Gets the custom cursor flag.
- */
- bool isCustomCursor()
- {
- return mCustomCursor;
- }
+ { mCursorType = index; }
/**
* Cursors are in graphic order from left to right.
* CURSOR_POINTER should be left untouched.
* CURSOR_TOTAL should always be last.
*/
- enum{
+ enum {
CURSOR_POINTER = 0,
CURSOR_RESIZE_ACROSS,
CURSOR_RESIZE_DOWN,
@@ -107,6 +95,7 @@ class Gui : public gcn::Gui
CURSOR_RESIZE_DOWN_RIGHT,
CURSOR_TOTAL
};
+
private:
GuiConfigListener *mConfigListener;
gcn::ImageLoader *mHostImageLoader; /**< For loading images in GL */
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index a4c81bc7..7df5e3ac 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -117,10 +117,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
if (mModal)
{
- if (gui->isCustomCursor())
- {
- gui->setCursorType(Gui::CURSOR_POINTER);
- }
+ gui->setCursorType(Gui::CURSOR_POINTER);
requestModalFocus();
}
@@ -161,9 +158,7 @@ Window::~Window()
delete border.grid[6];
delete border.grid[7];
delete border.grid[8];
-
closeImage->decRef();
- closeImage = NULL;
}
delete mChrome;
@@ -396,8 +391,7 @@ void Window::mousePressed(gcn::MouseEvent &event)
void Window::mouseReleased(gcn::MouseEvent &event)
{
if (mResizable &&
- mouseResize &&
- gui->isCustomCursor())
+ mouseResize)
{
mouseResize = 0;
gui->setCursorType(Gui::CURSOR_POINTER);
@@ -407,8 +401,7 @@ void Window::mouseReleased(gcn::MouseEvent &event)
void Window::mouseExited(gcn::MouseEvent &event)
{
if (mResizable &&
- !mouseResize &&
- gui->isCustomCursor())
+ !mouseResize)
{
gui->setCursorType(Gui::CURSOR_POINTER);
}
@@ -421,8 +414,7 @@ void Window::mouseMoved(gcn::MouseEvent &event)
// changes the custom mouse cursor based on it's current position.
if (mResizable &&
- !mouseResize &&
- gui->isCustomCursor())
+ !mouseResize)
{
gcn::Rectangle tContainerRect(
getPadding(),
diff --git a/src/gui/window.h b/src/gui/window.h
index 8b6382a2..5e8d8010 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -161,9 +161,8 @@ class Window : public gcn::Window
{ mShowTitle = flag; }
/**
- * Sets whether the window is sticky.
- * A sticky window will not have its visibility set to false
- * on a general setVisible(false) call.
+ * Sets whether the window is sticky. A sticky window will not have
+ * its visibility set to false on a general setVisible(false) call.
*/
void setSticky(bool sticky);
@@ -173,8 +172,8 @@ class Window : public gcn::Window
bool isSticky();
/**
- * Overloads window setVisible by guichan to allow sticky window
- * Handling
+ * Overloads window setVisible by Guichan to allow sticky window
+ * handling.
*/
void setVisible(bool visible);
@@ -205,8 +204,8 @@ class Window : public gcn::Window
void mouseDragged(gcn::MouseEvent &event);
/**
- * Implements custom cursor image changing context,
- * based on mouse relative position.
+ * Implements custom cursor image changing context, based on mouse
+ * relative position.
*/
void mouseMoved(gcn::MouseEvent &event);
@@ -252,8 +251,8 @@ class Window : public gcn::Window
int defaultWidth, int defaultHeight);
/**
- * Reset the win pos and size to default.
- * Don't forget to set defaults first.
+ * Reset the win pos and size to default. Don't forget to set defaults
+ * first.
*/
virtual void resetToDefaultSize();