tilehighlight_type.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef TILEHIGHLIGHT_TYPE_H
00013 #define TILEHIGHLIGHT_TYPE_H
00014 
00015 #include "core/geometry_type.hpp"
00016 #include "window_type.h"
00017 #include "tile_type.h"
00018 #include "viewport_type.h"
00019 
00020 
00022 enum HighLightStyle {
00023   HT_NONE      = 0x000, 
00024   HT_RECT      = 0x010, 
00025   HT_POINT     = 0x020, 
00026   HT_SPECIAL   = 0x030, 
00027   HT_DRAG      = 0x040, 
00028   HT_LINE      = 0x008, 
00029   HT_RAIL      = 0x080, 
00030   HT_VEHICLE   = 0x100, 
00031   HT_DIAGONAL  = 0x200, 
00032   HT_PREVIEW   = 0x400, 
00033   HT_DRAG_MASK = 0x4F8, 
00034 
00035   /* lower bits (used with HT_LINE and HT_RAIL):
00036    * (see ASCII art in table/autorail.h for a visual interpretation) */
00037   HT_DIR_X  = 0,    
00038   HT_DIR_Y  = 1,    
00039   HT_DIR_HU = 2,    
00040   HT_DIR_HL = 3,    
00041   HT_DIR_VL = 4,    
00042   HT_DIR_VR = 5,    
00043   HT_DIR_END,       
00044   HT_DIR_MASK = 0x7 
00045 };
00046 DECLARE_ENUM_AS_BIT_SET(HighLightStyle)
00047 
00048 
00049 
00050 struct TileHighlightData {
00051   Point pos;           
00052   Point size;          
00053   Point offs;          
00054   Point outersize;     
00055   bool diagonal;       
00056 
00057   Point new_pos;       
00058   Point new_size;      
00059   Point new_outersize; 
00060   byte dirty;          
00061 
00062   Point selstart;      
00063   Point selend;        
00064   byte sizelimit;      
00065 
00066   HighLightStyle drawstyle;      
00067   HighLightStyle next_drawstyle; 
00068 
00069   HighLightStyle place_mode;     
00070   WindowClass window_class;      
00071   WindowNumber window_number;    
00072 
00073   bool make_square_red;          
00074   TileIndex redsq;               
00075 
00076   ViewportPlaceMethod select_method;            
00077   ViewportDragDropSelectionProcess select_proc; 
00078 
00079   void Reset();
00080 
00081   bool IsDraggingDiagonal();
00082   Window *GetCallbackWnd();
00083 };
00084 
00085 #endif /* TILEHIGHLIGHT_TYPE_H */