summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-08 11:31:41 +0000
committerrubidium <rubidium@openttd.org>2008-05-08 11:31:41 +0000
commit2eef026fe35b9236606062f7d8a59d5661a5c748 (patch)
tree34abcc3662d6f35a9ace2d7f77586e68242b96e7 /src/window_gui.h
parentd3650ecb3a42529c720634dcdc982d046a47a1ee (diff)
downloadopenttd-2eef026fe35b9236606062f7d8a59d5661a5c748.tar.xz
(svn r13004) -Codechange: replace AllocateWindow and AllocateWindowDesc with a Window constructor.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 081ec736b..32352d3ea 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -297,8 +297,14 @@ struct Window : ZeroedMemoryAllocator {
private:
WindowProc *wndproc; ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead.
+protected:
+ void Initialize(int x, int y, int min_width, int min_height, int def_width, int def_height,
+ WindowProc *proc, WindowClass cls, const Widget *widget, int window_number, void *data);
+
public:
- Window(WindowProc *proc) : wndproc(proc) {}
+ Window(int x, int y, int width, int height, WindowProc *proc, WindowClass cls, const Widget *widget, void *data = NULL);
+ Window(const WindowDesc *desc, void *data = NULL, WindowNumber number = 0);
+
virtual ~Window();
uint16 flags4; ///< Window flags, @see WindowFlags
@@ -554,11 +560,7 @@ Window *FindWindowFromPt(int x, int y);
bool IsWindowOfPrototype(const Window *w, const Widget *widget);
void AssignWidgetToWindow(Window *w, const Widget *widget);
-Window *AllocateWindow(int x, int y, int width, int height,
- WindowProc *proc, WindowClass cls, const Widget *widget,
- void *data = NULL);
-Window *AllocateWindowDesc(const WindowDesc *desc, void *data = NULL);
Window *AllocateWindowDescFront(const WindowDesc *desc, int window_number, void *data = NULL);
void DrawWindowViewport(const Window *w);