4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
10 /** @file tilehighlight_func.h Functions related to tile highlights. */
12 #ifndef TILEHIGHLIGHT_FUNC_H
13 #define TILEHIGHLIGHT_FUNC_H
16 #include "window_gui.h"
17 #include "tilehighlight_type.h"
19 void SetPointerMode (PointerMode mode
, WindowClass window_class
,
20 WindowNumber window_num
, CursorID icon
);
23 * Change the cursor and mouse click/drag handling to a mode for performing special operations like tile area selection, object placement, etc.
24 * @param mode Mode to perform.
25 * @param w %Window requesting the mode change.
26 * @param icon New shape of the mouse cursor.
28 static inline void SetPointerMode (PointerMode mode
, Window
*w
, CursorID icon
)
30 SetPointerMode (mode
, w
->window_class
, w
->window_number
, icon
);
33 void ResetPointerMode (void);
35 bool HandlePlacePushButton (Window
*w
, int widget
, CursorID cursor
, PointerMode mode
);
37 void HandleDemolishMouseUp (TileIndex start_tile
, TileIndex end_tile
);
39 void VpStartPlaceSizing (TileIndex tile
, ViewportPlaceMethod method
,
40 int userdata
= 0, uint limit
= 0);
41 void VpSetPlaceSizingLimit (uint limit
);
42 void VpStopPlaceSizing (void);
44 void UpdateTileSelection();
46 extern TileHighlightData _thd
;
48 #endif /* TILEHIGHLIGHT_FUNC_H */