window.h
author belugas
Tue, 03 Oct 2006 20:16:20 +0000
changeset 4719 fc6e14219f72
parent 4712 4335ad42e163
child 4727 6819acce7c57
permissions -rw-r--r--
(svn r6631) -Codechange: Use accessors for click_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2159
diff changeset
     2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
#ifndef WINDOW_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     4
#define WINDOW_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
4692
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
     6
#include "macros.h"
4299
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
     7
#include "string.h"
4712
4335ad42e163 (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
bjarni
parents: 4695
diff changeset
     8
#include "order.h"
4299
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
     9
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    10
typedef struct WindowEvent WindowEvent;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
typedef void WindowProc(Window *w, WindowEvent *e);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    14
/* How the resize system works:
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    15
    First, you need to add a WWT_RESIZEBOX to the widgets, and you need
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    16
     to add the flag WDF_RESIZABLE to the window. Now the window is ready
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    17
     to resize itself.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    18
    As you may have noticed, all widgets have a RESIZE_XXX in their line.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    19
     This lines controls how the widgets behave on resize. RESIZE_NONE means
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    20
     it doesn't do anything. Any other option let's one of the borders
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    21
     move with the changed width/height. So if a widget has
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    22
     RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    23
     the right of the window will also be made 5 pixels wider.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    24
    Now, what if you want to clamp a widget to the bottom? Give it the flag
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    25
     RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    26
     5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    27
     widgets moves downwards without resizing, and appears to be clamped
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    28
     to the bottom. Nice aint it?
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    29
   You should know one more thing about this system. Most windows can't
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    30
    handle an increase of 1 pixel. So there is a step function, which
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    31
    let the windowsize only be changed by X pixels. You configure this
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    32
    after making the window, like this:
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    33
      w->resize.step_height = 10;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    34
    Now the window will only change in height in steps of 10.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    35
   You can also give a minimum width and height. The default value is
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    36
    the default height/width of the window itself. You can change this
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    37
    AFTER window-creation, with:
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    38
     w->resize.width or w->resize.height.
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    39
   That was all.. good luck, and enjoy :) -- TrueLight */
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    40
4547
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    41
enum ResizeFlags {
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    42
	RESIZE_NONE   = 0,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    43
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    44
	RESIZE_LEFT   = 1,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    45
	RESIZE_RIGHT  = 2,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    46
	RESIZE_TOP    = 4,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    47
	RESIZE_BOTTOM = 8,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    48
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    49
	RESIZE_LR     = RESIZE_LEFT  | RESIZE_RIGHT,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    50
	RESIZE_RB     = RESIZE_RIGHT | RESIZE_BOTTOM,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    51
	RESIZE_TB     = RESIZE_TOP   | RESIZE_BOTTOM,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    52
	RESIZE_LRB    = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_BOTTOM,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    53
	RESIZE_LRTB   = RESIZE_LEFT  | RESIZE_RIGHT  | RESIZE_TOP | RESIZE_BOTTOM,
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    54
	RESIZE_RTB    = RESIZE_RIGHT | RESIZE_TOP    | RESIZE_BOTTOM,
4547
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    55
} ResizeFlag;
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
    56
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
typedef struct Widget {
4547
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    58
	byte type;                        ///< Widget type, see @WindowWidgetTypes
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    59
	byte resize_flag;                 ///< Resize direction, alignment, etc. during resizing, see @ResizeFlags
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    60
	byte color;                       ///< Widget colour, see docs/ottd-colourtext-palette.png
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    61
	uint16 left, right, top, bottom;  ///< The position offsets inside the window
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    62
	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
d37c2d172ad4 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
Darkvater
parents: 4542
diff changeset
    63
	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
} Widget;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
4437
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
    66
typedef enum FrameFlags {
1938
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
    67
	FR_TRANSPARENT  = 0x01,  ///< Makes the background transparent if set
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
    68
	FR_BORDERONLY   = 0x10,  ///< Draw border only, no background
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
    69
	FR_LOWERED      = 0x20,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
    70
	FR_DARKENED     = 0x40,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
4437
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
    71
} FrameFlags;
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
    72
49e79e135539 (svn r6209) Move DrawFrameRect() out of gfx.[ch], because it uses data (_color_list) which the renderer shouldn't have know about
tron
parents: 4434
diff changeset
    73
void DrawFrameRect(int left, int top, int right, int bottom, int color, FrameFlags flags);
1938
70baf462aff1 (svn r2444) - CodeChange: Add an enum for demagicifying the values of the 'flags' parameter of DrawFrameRect(). (_Abraxa_)
hackykid
parents: 1648
diff changeset
    74
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    75
enum WindowEventCodes {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    76
	WE_CLICK               =  0,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    77
	WE_PAINT               =  1,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    78
	WE_MOUSELOOP           =  2,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    79
	WE_TICK                =  3,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    80
	WE_4                   =  4,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    81
	WE_TIMEOUT             =  5,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    82
	WE_PLACE_OBJ           =  6,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    83
	WE_ABORT_PLACE_OBJ     =  7,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    84
	WE_DESTROY             =  8,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    85
	WE_ON_EDIT_TEXT        =  9,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    86
	WE_POPUPMENU_SELECT    = 10,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    87
	WE_POPUPMENU_OVER      = 11,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    88
	WE_DRAGDROP            = 12,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    89
	WE_PLACE_DRAG          = 13,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    90
	WE_PLACE_MOUSEUP       = 14,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    91
	WE_PLACE_PRESIZE       = 15,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    92
	WE_DROPDOWN_SELECT     = 16,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    93
	WE_RCLICK              = 17,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    94
	WE_KEYPRESS            = 18,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    95
	WE_CREATE              = 19,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    96
	WE_MOUSEOVER           = 20,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    97
	WE_ON_EDIT_TEXT_CANCEL = 21,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    98
	WE_RESIZE              = 22,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
    99
	WE_MESSAGE             = 23,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   100
	WE_SCROLL              = 24,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   101
	WE_MOUSEWHEEL          = 25,
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   102
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   104
struct WindowEvent {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   105
	byte event;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   106
	union {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   107
		struct{
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   108
			Point pt;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   109
			int widget;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   110
		} click;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 424
diff changeset
   111
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   112
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   113
			Point pt;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   114
			TileIndex tile;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   115
			TileIndex starttile;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   116
			int userdata;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   117
		} place;
1648
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   118
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   119
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   120
			Point pt;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   121
			int widget;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   122
		} dragdrop;
4335
02934874f33d (svn r6036) -Codechange: do not handle SCROLL in a central function, but let windows handle them theirself. Added WE_SCROLL for this.
truelight
parents: 4318
diff changeset
   123
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   124
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   125
			Point size;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   126
			Point diff;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   127
		} sizing;
4337
e705eef174bf (svn r6038) -Codechange: move mousewheel code to event WE_MOUSEWHEEL instead of a general function that handles that
truelight
parents: 4335
diff changeset
   128
4634
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   129
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   130
			char *str;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   131
		} edittext;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   132
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   133
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   134
			Point pt;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   135
		} popupmenu;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   136
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   137
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   138
			int button;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   139
			int index;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   140
		} dropdown;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   141
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   142
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   143
			Point pt;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   144
			int widget;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   145
		} mouseover;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   146
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   147
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   148
			bool cont;     // continue the search? (default true)
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   149
			byte ascii;    // 8-bit ASCII-value of the key
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   150
			uint16 keycode;// untranslated key (including shift-state)
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   151
		} keypress;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   152
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   153
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   154
			uint msg;      // message to be sent
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   155
			uint wparam;   // additional message-specific information
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   156
			uint lparam;   // additional message-specific information
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   157
		} message;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   158
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   159
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   160
			Point delta;   // delta position against position of last call
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   161
		} scroll;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   162
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   163
		struct {
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   164
			int wheel;     // how much was 'wheel'd'
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   165
		} wheel;
07699ac2bf37 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct
belugas
parents: 4547
diff changeset
   166
	} we;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   168
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   169
enum WindowKeyCodes {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   170
	WKC_SHIFT = 0x8000,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   171
	WKC_CTRL  = 0x4000,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   172
	WKC_ALT   = 0x2000,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   173
	WKC_META  = 0x1000,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   174
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
	// Special ones
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   176
	WKC_NONE        =  0,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   177
	WKC_ESC         =  1,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   178
	WKC_BACKSPACE   =  2,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   179
	WKC_INSERT      =  3,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   180
	WKC_DELETE      =  4,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   181
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   182
	WKC_PAGEUP      =  5,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   183
	WKC_PAGEDOWN    =  6,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   184
	WKC_END         =  7,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   185
	WKC_HOME        =  8,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   186
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
	// Arrow keys
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   188
	WKC_LEFT        =  9,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   189
	WKC_UP          = 10,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   190
	WKC_RIGHT       = 11,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   191
	WKC_DOWN        = 12,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   193
	// Return & tab
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   194
	WKC_RETURN      = 13,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   195
	WKC_TAB         = 14,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   196
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   197
	// Numerical keyboard
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   198
	WKC_NUM_0       = 16,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   199
	WKC_NUM_1       = 17,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   200
	WKC_NUM_2       = 18,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   201
	WKC_NUM_3       = 19,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   202
	WKC_NUM_4       = 20,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   203
	WKC_NUM_5       = 21,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   204
	WKC_NUM_6       = 22,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   205
	WKC_NUM_7       = 23,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   206
	WKC_NUM_8       = 24,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   207
	WKC_NUM_9       = 25,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   208
	WKC_NUM_DIV     = 26,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   209
	WKC_NUM_MUL     = 27,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   210
	WKC_NUM_MINUS   = 28,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   211
	WKC_NUM_PLUS    = 29,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   212
	WKC_NUM_ENTER   = 30,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   213
	WKC_NUM_DECIMAL = 31,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   214
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   215
	// Space
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   216
	WKC_SPACE       = 32,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   217
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   218
	// Function keys
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   219
	WKC_F1          = 33,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   220
	WKC_F2          = 34,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   221
	WKC_F3          = 35,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   222
	WKC_F4          = 36,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   223
	WKC_F5          = 37,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   224
	WKC_F6          = 38,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   225
	WKC_F7          = 39,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   226
	WKC_F8          = 40,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   227
	WKC_F9          = 41,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   228
	WKC_F10         = 42,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   229
	WKC_F11         = 43,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   230
	WKC_F12         = 44,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
129
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 116
diff changeset
   232
	// backquote is the key left of "1"
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 116
diff changeset
   233
	// we only store this key here, no matter what character is really mapped to it
df1a60bc0d70 (svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
dominik
parents: 116
diff changeset
   234
	// on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °)
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   235
	WKC_BACKQUOTE   = 45,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   236
	WKC_PAUSE       = 46,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   237
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
	// 0-9 are mapped to 48-57
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
	// A-Z are mapped to 65-90
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
	// a-z are mapped to 97-122
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
typedef struct WindowDesc {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   244
	int16 left, top, width, height;
2788
0187c588107e (svn r3336) byte -> WindowClass, uint16 -> WindowNumber
tron
parents: 2757
diff changeset
   245
	WindowClass cls;
0187c588107e (svn r3336) byte -> WindowClass, uint16 -> WindowNumber
tron
parents: 2757
diff changeset
   246
	WindowClass parent_cls;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
	uint32 flags;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
	const Widget *widgets;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
	WindowProc *proc;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
} WindowDesc;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
enum {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   253
	WDF_STD_TOOLTIPS    =  1, /* use standard routine when displaying tooltips */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   254
	WDF_DEF_WIDGET      =  2, /* default widget control for some widgets in the on click event */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   255
	WDF_STD_BTN         =  4, /* default handling for close and drag widgets (widget no 0 and 1) */
2064
e6a2b42d0b15 (svn r2573) Codechange: Removed WDF_RESTORE_DPARAM, it's not needed with the new string system.
ludde
parents: 2021
diff changeset
   256
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   257
	WDF_UNCLICK_BUTTONS = 16, /* Unclick buttons when the window event times out */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   258
	WDF_STICKY_BUTTON   = 32, /* Set window to sticky mode; they are not closed unless closed with 'X' (widget 2) */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   259
	WDF_RESIZABLE       = 64, /* A window can be resized */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
/* can be used as x or y coordinates to cause a specific placement */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
enum {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   264
	WDP_AUTO   = -1,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   265
	WDP_CENTER = -2,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   266
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
1390
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   268
typedef struct Textbuf {
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   269
	char *buf;                  /* buffer in which text is saved */
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   270
	uint16 maxlength, maxwidth; /* the maximum size of the buffer. Maxwidth specifies screensize in pixels */
3458
26360c9a3743 (svn r4301) - Fix: the maxlength parameter of Textbuf is supposed to be the size of the buffer (so length of string + '\0'), but in the code it was a mix of both. It didn't cause any problems though, only an occasionaly one-less character than allowed. (thanks Tron for noticing)
Darkvater
parents: 3344
diff changeset
   271
	uint16 length, width;       /* the current size of the string. Width specifies screensize in pixels */
1390
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   272
	bool caret;                 /* is the caret ("_") visible or not */
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   273
	uint16 caretpos;            /* the current position of the caret in the buffer */
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   274
	uint16 caretxoffs;          /* the current position of the caret in pixels */
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   275
} Textbuf;
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1386
diff changeset
   276
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   277
#define WP(ptr,str) (*(str*)(ptr)->custom)
2906
ac54fefb84e7 (svn r3461) - Fix: Increase window-size as for 64-bit machines it wasn't enough
Darkvater
parents: 2888
diff changeset
   278
/* You cannot 100% reliably calculate the biggest custom struct as
ac54fefb84e7 (svn r3461) - Fix: Increase window-size as for 64-bit machines it wasn't enough
Darkvater
parents: 2888
diff changeset
   279
 * the number of pointers in it and alignment will have a huge impact.
4299
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   280
 * 96 is the largest window-size for 64-bit machines currently */
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   281
#define WINDOW_CUSTOM_SIZE 96
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
2596
07cecb439908 (svn r3133) - static, const
tron
parents: 2549
diff changeset
   283
typedef struct Scrollbar {
62
2bdd81b8adcc (svn r63) Fix: [ 1009385 ] Too many save games prevented loading
dominik
parents: 0
diff changeset
   284
	uint16 count, cap, pos;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
} Scrollbar;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   286
2596
07cecb439908 (svn r3133) - static, const
tron
parents: 2549
diff changeset
   287
typedef struct ResizeInfo {
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   288
	uint width; /* Minimum width and height */
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   289
	uint height;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   290
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   291
	uint step_width; /* In how big steps the width and height go */
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   292
	uint step_height;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   293
} ResizeInfo;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   294
2622
73167d7e30c7 (svn r3162) -Fix: renamed 'Message' to 'WindowMessage', a struct named 'Message' already
truelight
parents: 2596
diff changeset
   295
typedef struct WindowMessage {
1648
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   296
		int msg;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   297
		int wparam;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   298
		int lparam;
2622
73167d7e30c7 (svn r3162) -Fix: renamed 'Message' to 'WindowMessage', a struct named 'Message' already
truelight
parents: 2596
diff changeset
   299
} WindowMessage;
1648
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   300
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   301
struct Window {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   302
	uint16 flags4;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   303
	WindowClass window_class;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   304
	WindowNumber window_number;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   305
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   306
	int left, top;
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   307
	int width, height;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   308
842
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   309
	Scrollbar hscroll, vscroll, vscroll2;
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   310
	ResizeInfo resize;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   311
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   312
	byte caption_color;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   313
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   314
	uint32 click_state, disabled_state, hidden_state;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   315
	WindowProc *wndproc;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   316
	ViewPort *viewport;
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   317
	const Widget *original_widget;
4077
d4d440dd8925 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
tron
parents: 3812
diff changeset
   318
	Widget *widget;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   319
	uint32 desc_flags;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   320
2622
73167d7e30c7 (svn r3162) -Fix: renamed 'Message' to 'WindowMessage', a struct named 'Message' already
truelight
parents: 2596
diff changeset
   321
	WindowMessage message;
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   322
	byte custom[WINDOW_CUSTOM_SIZE];
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   323
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   324
4299
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   325
typedef struct querystr_d {
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   326
	StringID caption;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   327
	WindowClass wnd_class;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   328
	WindowNumber wnd_num;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   329
	Textbuf text;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   330
	const char *orig;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   331
	CharSetFilter afilter;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   332
} querystr_d;
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   333
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
91f5d2bedcff (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
truelight
parents: 4266
diff changeset
   334
4300
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   335
typedef struct query_d {
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   336
	StringID caption;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   337
	StringID message;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   338
	WindowClass wnd_class;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   339
	WindowNumber wnd_num;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   340
	void (*ok_cancel_callback)(bool ok_clicked);
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   341
	bool calledback;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   342
} query_d;
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   343
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(query_d));
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4299
diff changeset
   344
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
typedef struct {
4171
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   346
	byte item_count;      /* follow_vehicle */
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   347
	byte sel_index;       /* scrollpos_x */
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   348
	byte main_button;     /* scrollpos_y */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   349
	byte action_id;
4171
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   350
	StringID string_id;   /* unk30 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   351
	uint16 checked_items; /* unk32 */
2216
cdedee39cc2b (svn r2734) -Feature: The Main Toolbar Dropdown Menu can now display disabled items
celestar
parents: 2187
diff changeset
   352
	byte disabled_items;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   353
} menu_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   354
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   355
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   356
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   357
	int16 data_1, data_2, data_3;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   358
	int16 data_4, data_5;
2596
07cecb439908 (svn r3133) - static, const
tron
parents: 2549
diff changeset
   359
	bool close;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   360
	byte byte_1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
} def_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   362
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(def_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   363
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   364
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   365
	void *data;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   366
} void_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   367
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(void_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   368
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   369
typedef struct {
2596
07cecb439908 (svn r3133) - static, const
tron
parents: 2549
diff changeset
   370
	uint16 base;
07cecb439908 (svn r3133) - static, const
tron
parents: 2549
diff changeset
   371
	uint16 count;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   372
} tree_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   373
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tree_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   374
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   375
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   376
	StringID string_id;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   377
} tooltips_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   378
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tooltips_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   379
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   380
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   381
	byte railtype;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   382
	byte sel_index;
2498
3ed05caa4449 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
tron
parents: 2448
diff changeset
   383
	EngineID sel_engine;
3ed05caa4449 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
tron
parents: 2448
diff changeset
   384
	EngineID rename_engine;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   385
} buildtrain_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   386
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildtrain_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   387
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   388
typedef struct {
842
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   389
	byte vehicletype;
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   390
	byte sel_index[2];
2746
47c6e734556e (svn r3291) - Codechange, Autoreplace: Replace int with EngineID and -1 with INVALID_ENGINE, as appropriate.
peter1138
parents: 2683
diff changeset
   391
	EngineID sel_engine[2];
842
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   392
	uint16 count[2];
4434
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   393
	bool wagon_btnstate; // true means engine is selected
842
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   394
} replaceveh_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   395
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d));
842
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   396
efc3546bc313 (svn r1323) Adding autoreplace feature
bjarni
parents: 826
diff changeset
   397
typedef struct {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   398
	VehicleID sel;
4638
05955c6cb536 (svn r6513) -Codechange: unified the code to draw depot windows
bjarni
parents: 4635
diff changeset
   399
	byte type;
4635
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   400
	uint16 engine_list_length;
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   401
	uint16 wagon_list_length;
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   402
	uint16 engine_count;
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   403
	uint16 wagon_count;
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   404
	Vehicle **vehicle_list;
1b35cdc018ee (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
bjarni
parents: 4634
diff changeset
   405
	Vehicle **wagon_list;
4638
05955c6cb536 (svn r6513) -Codechange: unified the code to draw depot windows
bjarni
parents: 4635
diff changeset
   406
} depot_d;
05955c6cb536 (svn r6513) -Codechange: unified the code to draw depot windows
bjarni
parents: 4635
diff changeset
   407
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(depot_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   408
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   409
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   410
	int sel;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   411
} order_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   412
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(order_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   413
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   414
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   415
	byte tab;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   416
} traindetails_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   417
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(traindetails_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   418
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   419
typedef struct {
849
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   420
	int32 scroll_x;
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   421
	int32 scroll_y;
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   422
	int32 subscroll;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   423
} smallmap_d;
4318
8ca2db000c2a (svn r5971) -Fix: wrong struct in assert_compile (thomasdev)
truelight
parents: 4300
diff changeset
   424
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(smallmap_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   425
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   426
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   427
	uint32 face;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   428
	byte gender;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   429
} facesel_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   430
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(facesel_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   431
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   432
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   433
	int sel;
4695
3a5bf7ff066b (svn r6602) - Feature: we now support NewGRF livery refits, as used by DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype.
peter1138
parents: 4694
diff changeset
   434
	struct RefitOption *cargo;
4694
c917a3ad0dd2 (svn r6601) - Codechange: Support cargo subtypes in the refit window. The refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch)
peter1138
parents: 4692
diff changeset
   435
	struct RefitList *list;
c917a3ad0dd2 (svn r6601) - Codechange: Support cargo subtypes in the refit window. The refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch)
peter1138
parents: 4692
diff changeset
   436
	uint length;
4712
4335ad42e163 (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
bjarni
parents: 4695
diff changeset
   437
	VehicleOrderID order;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   438
} refit_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   439
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(refit_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   440
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   441
typedef struct {
2116
23031555ff54 (svn r2626) static, const, misc.
tron
parents: 2064
diff changeset
   442
	VehicleID follow_vehicle;
849
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   443
	int32 scrollpos_x;
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   444
	int32 scrollpos_y;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   445
} vp_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   446
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp_d) + 3 * sizeof(byte)); // + 3 * byte is a hack from Miham
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   447
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   448
// vp2_d is the same as vp_d, except for the data_# values..
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   449
typedef struct {
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   450
	uint16 follow_vehicle;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   451
	int32 scrollpos_x;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   452
	int32 scrollpos_y;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   453
	byte data_1;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   454
	byte data_2;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   455
	byte data_3;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   456
} vp2_d;
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   457
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp2_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   458
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   459
typedef struct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   460
	uint16 follow_vehicle;
849
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   461
	int32 scrollpos_x;
c3407041774f (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   462
	int32 scrollpos_y;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   463
	NewsItem *ni;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   464
} news_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   465
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(news_d));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   466
859
611a03925f9a (svn r1340) -Feature: scrolling credits list...finally! Hope nobody gets offended if I forgot them.
darkvater
parents: 849
diff changeset
   467
typedef struct {
998
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   468
	uint32 background_img;
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   469
	int8 rank;
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   470
} highscore_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   471
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(highscore_d));
998
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   472
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   473
typedef struct {
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   474
	int height;
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   475
	uint16 counter;
c90459c24842 (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents: 983
diff changeset
   476
} scroller_d;
1004
dcc3c5747e22 (svn r1503) Added feature:
miham
parents: 998
diff changeset
   477
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d));
859
611a03925f9a (svn r1340) -Feature: scrolling credits list...finally! Hope nobody gets offended if I forgot them.
darkvater
parents: 849
diff changeset
   478
4542
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   479
typedef enum SortListFlags {
2888
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   480
	VL_DESC    = 0x01,  // sort descending or ascending
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   481
	VL_RESORT  = 0x02,  // instruct the code to resort the list in the next loop
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   482
	VL_REBUILD = 0x04   // create sort-listing to use for qsort and friends
4542
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   483
} SortListFlags;
588
03521b270f62 (svn r1009) -Feature: per-station vehicle lists
tron
parents: 543
diff changeset
   484
4542
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   485
typedef struct Listing {
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   486
	bool order;    // Ascending/descending
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   487
	byte criteria; // Sorting criteria
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   488
} Listing;
588
03521b270f62 (svn r1009) -Feature: per-station vehicle lists
tron
parents: 543
diff changeset
   489
2888
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   490
typedef struct list_d {
4542
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   491
	uint16 list_length;  // length of the list being sorted
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   492
	byte sort_type;      // what criteria to sort on
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   493
	SortListFlags flags; // used to control sorting/resorting/etc.
f42ecc669275 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents: 4520
diff changeset
   494
	uint16 resort_timer; // resort list after a given amount of ticks if set
2888
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   495
} list_d;
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   496
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d));
79da960a5372 (svn r3441) - Feature: Allow the network game list to be sorted (by name/clients/compatibility ascending/descending)
Darkvater
parents: 2887
diff changeset
   497
1648
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   498
typedef struct message_d {
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   499
	int msg;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   500
	int wparam;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   501
	int lparam;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   502
} message_d;
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   503
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(message_d));
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   504
2636
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   505
typedef struct dropdown_d {
2683
ca9645a21734 (svn r3225) - Fix for "[ 1359165 ] Autoreplace problem with r3171 and later" -- Move the disabled/hidden bits to custom data in window struct.
peter1138
parents: 2636
diff changeset
   506
	uint32 disabled_state;
ca9645a21734 (svn r3225) - Fix for "[ 1359165 ] Autoreplace problem with r3171 and later" -- Move the disabled/hidden bits to custom data in window struct.
peter1138
parents: 2636
diff changeset
   507
	uint32 hidden_state;
2636
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   508
	WindowClass parent_wnd_class;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   509
	WindowNumber parent_wnd_num;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   510
	byte parent_button;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   511
	byte num_items;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   512
	byte selected_index;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   513
	const StringID *items;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   514
	byte click_delay;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   515
	bool drag_mode;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   516
} dropdown_d;
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   517
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(dropdown_d));
bdff7da76aa2 (svn r3178) - Codechange: move static _dropdown_* vars into the window custom data, giving var1 and var2 more meaningful names.
peter1138
parents: 2634
diff changeset
   518
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   519
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   520
/****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   521
enum WindowWidgetBehaviours {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   522
	WWB_PUSHBUTTON  = 1 << 5,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   523
	WWB_NODISBUTTON = 2 << 5,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   524
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   525
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   526
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   527
enum WindowWidgetTypes {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   528
	WWT_EMPTY = 0,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   529
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   530
	WWT_IMGBTN     =  1,         /* button with image */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   531
	WWT_PANEL      = WWT_IMGBTN,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   532
	WWT_PANEL_2    =  2,         /* button with diff image when clicked */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   533
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   534
	WWT_TEXTBTN    =  3,         /* button with text */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   535
	WWT_4          =  4,         /* button with diff text when clicked */
4345
1da147230c79 (svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
belugas
parents: 4344
diff changeset
   536
	WWT_LABEL       = 5,         /* centered label */
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   537
	WWT_6          =  6,         /* combo box text area */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   538
	WWT_MATRIX     =  7,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   539
	WWT_SCROLLBAR  =  8,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   540
	WWT_FRAME      =  9,         /* frame */
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   541
	WWT_CAPTION    = 10,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   542
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   543
	WWT_HSCROLLBAR = 11,
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   544
	WWT_STICKYBOX  = 12,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   545
	WWT_SCROLL2BAR = 13,         /* 2nd vertical scrollbar*/
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   546
	WWT_RESIZEBOX  = 14,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   547
	WWT_CLOSEBOX   = 15,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   548
	WWT_LAST       = 16,         /* Last Item. use WIDGETS_END to fill up padding!! */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   549
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   550
	WWT_MASK       = 31,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   551
4434
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   552
	WWT_PUSHTXTBTN  = WWT_TEXTBTN | WWB_PUSHBUTTON,
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   553
	WWT_PUSHIMGBTN  = WWT_IMGBTN  | WWB_PUSHBUTTON,
a08cb4b5c179 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4345
diff changeset
   554
	WWT_NODISTXTBTN = WWT_TEXTBTN | WWB_NODISBUTTON,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   555
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   556
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   557
#define WIDGETS_END WWT_LAST,   RESIZE_NONE,     0,     0,     0,     0,     0, 0, STR_NULL
176
84990c4b9212 (svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents: 164
diff changeset
   558
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   559
enum WindowFlags {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   560
	WF_TIMEOUT_SHL       = 0,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   561
	WF_TIMEOUT_MASK      = 7,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   562
	WF_DRAGGING          = 1 <<  3,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   563
	WF_SCROLL_UP         = 1 <<  4,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   564
	WF_SCROLL_DOWN       = 1 <<  5,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   565
	WF_SCROLL_MIDDLE     = 1 <<  6,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   566
	WF_HSCROLL           = 1 <<  7,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   567
	WF_SIZING            = 1 <<  8,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   568
	WF_STICKY            = 1 <<  9,
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   569
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   570
	WF_DISABLE_VP_SCROLL = 1 << 10,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   571
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   572
	WF_WHITE_BORDER_ONE  = 1 << 11,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   573
	WF_WHITE_BORDER_MASK = 3 << 11,
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   574
	WF_SCROLL2           = 1 << 13,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   575
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   576
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   577
/* window.c */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   578
void CallWindowEventNP(Window *w, int event);
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1009
diff changeset
   579
void CallWindowTickEvent(void);
4171
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   580
void SetWindowDirty(const Window *w);
1648
41c3d5de9994 (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
darkvater
parents: 1570
diff changeset
   581
void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, uint msg, uint wparam, uint lparam);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   582
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   583
Window *FindWindowById(WindowClass cls, WindowNumber number);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   584
void DeleteWindow(Window *w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   585
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   586
Window *FindWindowFromPt(int x, int y);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   587
4171
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   588
bool IsWindowOfPrototype(const Window *w, const Widget *widget);
867
dffd33233237 (svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents: 859
diff changeset
   589
void AssignWidgetToWindow(Window *w, const Widget *widget);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   590
Window *AllocateWindow(
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   591
							int x,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   592
							int y,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   593
							int width,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   594
							int height,
158
b1a821f84250 (svn r159) -Fix: w->custom[] was too small for 64bit pointers
truelight
parents: 129
diff changeset
   595
							WindowProc *proc,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   596
							WindowClass cls,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   597
							const Widget *widget);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   598
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   599
Window *AllocateWindowDesc(const WindowDesc *desc);
4520
98f1b167d0ca (svn r6345) -Codechange: AllocateWindowDescFront() now ensures that window_number is set before calling the WE_CREATE event
bjarni
parents: 4438
diff changeset
   600
Window *AllocateWindowDescFront(const WindowDesc *desc, int window_number);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   601
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   602
void DrawWindowViewport(Window *w);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   603
4692
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   604
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   605
 * Sets the enabled/disabled status of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   606
 * By default, widgets are enabled.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   607
 * On certain conditions, they have to be disabled.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   608
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   609
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   610
 * @param disab_stat : status to use ie: disabled = true, enabled = false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   611
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   612
static inline void SetWindowWidgetDisabledState(Window *w, byte widget_index, bool disab_stat)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   613
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   614
	SB(w->disabled_state, widget_index, 1, !!disab_stat);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   615
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   616
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   617
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   618
 * Sets a widget to disabled.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   619
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   620
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   621
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   622
static inline void DisableWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   623
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   624
	SetWindowWidgetDisabledState(w, widget_index, true);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   625
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   626
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   627
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   628
 * Sets a widget to Enabled.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   629
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   630
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   631
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   632
static inline void EnableWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   633
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   634
	SetWindowWidgetDisabledState(w, widget_index, false);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   635
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   636
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   637
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   638
 * Gets the enabled/disabled status of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   639
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   640
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   641
 * @return status of the widget ie: disabled = true, enabled = false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   642
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   643
static inline bool IsWindowWidgetDisabled(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   644
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   645
	return HASBIT(w->disabled_state, widget_index);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   646
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   647
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   648
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   649
 * Sets the hidden/shown status of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   650
 * By default, widgets are visible.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   651
 * On certain conditions, they have to be hidden.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   652
 * @param w Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   653
 * @param widget_index index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   654
 * @param hidden_stat status to use ie. hidden = true, visible = false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   655
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   656
static inline void SetWindowWidgetHiddenState(Window *w, byte widget_index, bool hidden_stat)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   657
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   658
	SB(w->hidden_state, widget_index, 1, !!hidden_stat);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   659
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   660
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   661
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   662
 * Sets a widget hidden.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   663
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   664
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   665
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   666
static inline void HideWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   667
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   668
	SetWindowWidgetHiddenState(w, widget_index, true);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   669
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   670
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   671
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   672
 * Sets a widget visible.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   673
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   674
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   675
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   676
static inline void ShowWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   677
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   678
	SetWindowWidgetHiddenState(w, widget_index, false);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   679
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   680
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   681
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   682
 * Gets the visibility of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   683
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   684
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   685
 * @return status of the widget ie: hidden = true, visible = false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   686
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   687
static inline bool IsWindowWidgetHidden(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   688
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   689
	return HASBIT(w->hidden_state, widget_index);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   690
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   691
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   692
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   693
 * Sets the lowered/raised status of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   694
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   695
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   696
 * @param hidden_stat : status to use ie: lowered = true, raised = false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   697
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   698
static inline void SetWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   699
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   700
	SB(w->click_state, widget_index, 1, !!lowered_stat);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   701
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   702
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   703
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   704
 * Invert the lowered/raised  status of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   705
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   706
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   707
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   708
static inline void ToggleWidgetLoweredState(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   709
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   710
	TOGGLEBIT(w->click_state, widget_index);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   711
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   712
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   713
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   714
 * Marks a widget as lowered.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   715
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   716
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   717
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   718
static inline void LowerWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   719
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   720
	SetWidgetLoweredState(w, widget_index, true);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   721
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   722
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   723
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   724
 * Marks a widget as raised.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   725
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   726
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   727
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   728
static inline void RaiseWindowWidget(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   729
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   730
	SetWidgetLoweredState(w, widget_index, false);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   731
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   732
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   733
/**
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   734
 * Gets the lowered state of a widget.
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   735
 * @param w : Window on which the widget is located
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   736
 * @param widget_index : index of this widget in the window
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   737
 * @return status of the widget ie: lowered = true, raised= false
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   738
 */
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   739
static inline bool IsWindowWidgetLowered(Window *w, byte widget_index)
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   740
{
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   741
	return HASBIT(w->click_state, widget_index);
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   742
}
1712d668700f (svn r6599) -Codechange: Add accessors around the members click/disabled/hidden_state of Window
belugas
parents: 4638
diff changeset
   743
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1009
diff changeset
   744
void InitWindowSystem(void);
1474
a26a21fa10ef (svn r1978) - Fix: Plug some memleaks; thanks Valgrind
Darkvater
parents: 1390
diff changeset
   745
void UnInitWindowSystem(void);
a26a21fa10ef (svn r1978) - Fix: Plug some memleaks; thanks Valgrind
Darkvater
parents: 1390
diff changeset
   746
void ResetWindowSystem(void);
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2216
diff changeset
   747
int GetMenuItemIndex(const Window *w, int x, int y);
1570
c9b6cf44ce53 (svn r2074) MouseLoop -> InputLoop(), factor out a real mouse-specific MouseLoop from the new InitLoop() (more in the spirit of HandleKeypress()).
pasky
parents: 1474
diff changeset
   748
void InputLoop(void);
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1009
diff changeset
   749
void UpdateWindows(void);
4171
5c6e60c392c3 (svn r5609) CodeChange : Apply coding style
belugas
parents: 4077
diff changeset
   750
void InvalidateWidget(const Window *w, byte widget_index);
4719
fc6e14219f72 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   751
void RaiseWindowButtons(Window *w);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   752
void RelocateAllWindows(int neww, int newh);
380
87faf9e3216f (svn r569) Fix type mismatch
tron
parents: 176
diff changeset
   753
int PositionMainToolbar(Window *w);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   754
4719
fc6e14219f72 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   755
/* misc_gui.c*/
fc6e14219f72 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   756
void GuiShowTooltips(StringID string_id);
fc6e14219f72 (svn r6631) -Codechange: Use accessors for click_state.
belugas
parents: 4712
diff changeset
   757
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   758
/* widget.c */
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2216
diff changeset
   759
int GetWidgetFromPos(const Window *w, int x, int y);
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2216
diff changeset
   760
void DrawWindowWidgets(const Window *w);
2448
1a07657c9f9a (svn r2974) -Fix: Drag and drop selection on drop down boxes didn't select correct item when some items were hidden.
peter1138
parents: 2436
diff changeset
   761
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   762
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   763
void HandleButtonClick(Window *w, byte widget);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   764
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1009
diff changeset
   765
Window *GetCallbackWnd(void);
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1009
diff changeset
   766
void DeleteNonVitalWindows(void);
763
ced9fcae239d (svn r1225) -Feature: SHIFT+DEL now deletes all non-vital windows (only status bar and main bar remain)
darkvater
parents: 682
diff changeset
   767
void DeleteAllNonVitalWindows(void);
983
4765bf636f6b (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
darkvater
parents: 982
diff changeset
   768
void HideVitalWindows(void);
4765bf636f6b (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
darkvater
parents: 982
diff changeset
   769
void ShowVitalWindows(void);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   770
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   771
/* window.c */
682
74c70f645d95 (svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
darkvater
parents: 588
diff changeset
   772
VARDEF Window _windows[25];
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   773
VARDEF Window *_last_window;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   774
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   775
VARDEF Point _cursorpos_drag_start;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   776
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   777
VARDEF bool _left_button_down;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   778
VARDEF bool _left_button_clicked;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   779
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   780
VARDEF bool _right_button_down;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   781
VARDEF bool _right_button_clicked;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   782
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   783
VARDEF int _alloc_wnd_parent_num;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   784
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   785
VARDEF int _scrollbar_start_pos;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   786
VARDEF int _scrollbar_size;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   787
VARDEF byte _scroller_click_timeout;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   788
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   789
VARDEF bool _scrolling_scrollbar;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   790
VARDEF bool _scrolling_viewport;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   791
VARDEF bool _popup_menu_active;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   792
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   793
VARDEF byte _special_mouse_mode;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   794
enum SpecialMouseMode {
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   795
	WSM_NONE     = 0,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   796
	WSM_DRAGDROP = 1,
4344
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   797
	WSM_SIZING   = 2,
7e123fec5b0b (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4337
diff changeset
   798
	WSM_PRESIZE  = 3,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   799
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   800
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   801
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   802
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   803
#endif /* WINDOW_H */