viewport_type.h

Go to the documentation of this file.
00001 /* $Id: viewport_type.h 11788 2008-01-09 09:57:48Z rubidium $ */
00002 
00005 #ifndef VIEWPORT_TYPE_H
00006 #define VIEWPORT_TYPE_H
00007 
00008 #include "core/geometry_type.hpp"
00009 #include "zoom_type.h"
00010 #include "window_type.h"
00011 #include "tile_type.h"
00012 
00013 struct ViewPort {
00014   int left,top;                       // screen coordinates for the viewport
00015   int width, height;                  // screen width/height for the viewport
00016 
00017   int virtual_left, virtual_top;      // virtual coordinates
00018   int virtual_width, virtual_height;  // these are just width << zoom, height << zoom
00019 
00020   ZoomLevel zoom;
00021 };
00022 
00023 enum {
00024   ZOOM_IN   = 0,
00025   ZOOM_OUT  = 1,
00026   ZOOM_NONE = 2, // hack, used to update the button status
00027 };
00028 
00035 enum {
00036   BB_HEIGHT_UNDER_BRIDGE = 6, 
00037   BB_Z_SEPARATOR  = 7,        
00038 };
00039 
00041 enum ViewportPlaceMethod {
00042   VPM_X_OR_Y          = 0, 
00043   VPM_FIX_X           = 1, 
00044   VPM_FIX_Y           = 2, 
00045   VPM_RAILDIRS        = 3, 
00046   VPM_X_AND_Y         = 4, 
00047   VPM_X_AND_Y_LIMITED = 5, 
00048   VPM_SIGNALDIRS      = 6, 
00049 };
00050 
00052 enum ViewportHighlightMode {
00053   VHM_NONE    = 0, 
00054   VHM_RECT    = 1, 
00055   VHM_POINT   = 2, 
00056   VHM_SPECIAL = 3, 
00057   VHM_DRAG    = 4, 
00058   VHM_RAIL    = 5, 
00059 };
00060 
00061 /* highlighting draw styles */
00062 enum HighLightStyle {
00063   HT_NONE   = 0x00,
00064   HT_RECT   = 0x80,
00065   HT_POINT  = 0x40,
00066   HT_LINE   = 0x20,    
00067 
00068   HT_RAIL   = 0x10,    
00069 
00070   HT_DRAG_MASK = 0xF0, 
00071 
00072   /* lower bits (used with HT_LINE and HT_RAIL):
00073    * (see ASCII art in autorail.h for a visual interpretation) */
00074   HT_DIR_X  = 0,    
00075   HT_DIR_Y  = 1,    
00076   HT_DIR_HU = 2,    
00077   HT_DIR_HL = 3,    
00078   HT_DIR_VL = 4,    
00079   HT_DIR_VR = 5,    
00080   HT_DIR_MASK = 0x7 
00081 };
00082 DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
00083 
00084 
00085 struct TileHighlightData {
00086   Point size;
00087   Point outersize;
00088   Point pos;
00089   Point offs;
00090 
00091   Point new_pos;
00092   Point new_size;
00093   Point new_outersize;
00094 
00095   Point selend, selstart;
00096 
00097   byte dirty;
00098   byte sizelimit;
00099 
00100   byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
00101   byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
00102   byte next_drawstyle; // queued, but not yet drawn style
00103 
00104   ViewportHighlightMode place_mode;
00105   bool make_square_red;
00106   WindowClass window_class;
00107   WindowNumber window_number;
00108 
00109   ViewportPlaceMethod select_method;
00110   byte select_proc;
00111 
00112   TileIndex redsq;
00113 };
00114 
00115 #endif /* VIEWPORT_TYPE_H */

Generated on Wed Oct 1 17:03:25 2008 for openttd by  doxygen 1.5.6