summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gui/window.h b/src/gui/window.h
index 625d7541..b83aa78b 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -28,6 +28,8 @@
#include "../guichanfwd.h"
+#include "windowlistener.h"
+
class ConfigListener;
class GCContainer;
class ImageRect;
@@ -115,6 +117,21 @@ class Window : public gcn::Window
void setDimension(const gcn::Rectangle &dimension);
/**
+ * Sets the position of this window.
+ */
+ void setPosition(int x, int y);
+
+ /**
+ * Sets the window x coordinate.
+ */
+ void setX(int x);
+
+ /**
+ * Sets the window y coordinate.
+ */
+ void setY(int y);
+
+ /**
* Sets the location relative to the given widget.
*/
void setLocationRelativeTo(gcn::Widget *widget);
@@ -255,6 +272,20 @@ class Window : public gcn::Window
*/
virtual void resetToDefaultSize();
+ /**
+ * Adds a listener to the list that's notified when the window is
+ * moved or resized.
+ */
+ void addWindowListener(WindowListener *listener)
+ { mListeners.push_back(listener); }
+
+ /**
+ * Removes a listener from the list that's notified when the window is
+ * moved or resized.
+ */
+ void removeWindowListener(WindowListener *listener)
+ { mListeners.remove(listener); }
+
enum ResizeHandles
{
TOP = 0x01,
@@ -310,6 +341,14 @@ class Window : public gcn::Window
* where two borders are moved at the same time.
*/
static const int resizeBorderWidth = 10;
+
+ private:
+ /**
+ * Sends out a window event to the list of selection listeners.
+ */
+ void fireWindowEvent(const WindowEvent &event);
+
+ WindowListeners mListeners;
};
#endif