# gfx_type.h

Go to the documentation of this file.

    00001 /* $Id: gfx_type.h 14269 2008-09-07 22:14:48Z rubidium $ */
    00002
    00005 #ifndef GFX_TYPE_H
    00006 #define GFX_TYPE_H
    00007
    00008 #include "core/enum_type.hpp"
    00009 #include "core/geometry_type.hpp"
    00010 #include "zoom_type.h"
    00011
    00012 typedef uint32 SpriteID;
    00013 struct PalSpriteID {
    00014   SpriteID sprite;
    00015   SpriteID pal;
    00016 };
    00017 typedef int32 CursorID;
    00018
    00019 enum WindowKeyCodes {
    00020   WKC_SHIFT = 0x8000,
    00021   WKC_CTRL  = 0x4000,
    00022   WKC_ALT   = 0x2000,
    00023   WKC_META  = 0x1000,
    00024
    00025   /* Special ones */
    00026   WKC_NONE        =  0,
    00027   WKC_ESC         =  1,
    00028   WKC_BACKSPACE   =  2,
    00029   WKC_INSERT      =  3,
    00030   WKC_DELETE      =  4,
    00031
    00032   WKC_PAGEUP      =  5,
    00033   WKC_PAGEDOWN    =  6,
    00034   WKC_END         =  7,
    00035   WKC_HOME        =  8,
    00036
    00037   /* Arrow keys */
    00038   WKC_LEFT        =  9,
    00039   WKC_UP          = 10,
    00040   WKC_RIGHT       = 11,
    00041   WKC_DOWN        = 12,
    00042
    00043   /* Return & tab */
    00044   WKC_RETURN      = 13,
    00045   WKC_TAB         = 14,
    00046
    00047   /* Space */
    00048   WKC_SPACE       = 32,
    00049
    00050   /* Function keys */
    00051   WKC_F1          = 33,
    00052   WKC_F2          = 34,
    00053   WKC_F3          = 35,
    00054   WKC_F4          = 36,
    00055   WKC_F5          = 37,
    00056   WKC_F6          = 38,
    00057   WKC_F7          = 39,
    00058   WKC_F8          = 40,
    00059   WKC_F9          = 41,
    00060   WKC_F10         = 42,
    00061   WKC_F11         = 43,
    00062   WKC_F12         = 44,
    00063
    00064   /* Backquote is the key left of "1"
    00065    * we only store this key here, no matter what character is really mapped to it
    00066    * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
    00067   WKC_BACKQUOTE   = 45,
    00068   WKC_PAUSE       = 46,
    00069
    00070   /* 0-9 are mapped to 48-57
    00071    * A-Z are mapped to 65-90
    00072    * a-z are mapped to 97-122 */
    00073
    00074   /* Numerical keyboard */
    00075   WKC_NUM_DIV     = 138,
    00076   WKC_NUM_MUL     = 139,
    00077   WKC_NUM_MINUS   = 140,
    00078   WKC_NUM_PLUS    = 141,
    00079   WKC_NUM_ENTER   = 142,
    00080   WKC_NUM_DECIMAL = 143,
    00081
    00082   /* Other keys */
    00083   WKC_SLASH       = 144,
    00084   WKC_SEMICOLON   = 145,
    00085   WKC_EQUALS      = 146,
    00086   WKC_L_BRACKET   = 147,
    00087   WKC_BACKSLASH   = 148,
    00088   WKC_R_BRACKET   = 149,
    00089   WKC_SINGLEQUOTE = 150,
    00090   WKC_COMMA       = 151,
    00091   WKC_PERIOD      = 152,
    00092   WKC_MINUS       = 153,
    00093 };
    00094
    00096 struct AnimCursor {
    00097   static const CursorID LAST = MAX_UVALUE(CursorID);
    00098   CursorID sprite;
    00099   byte display_time;
    00100 };
    00101
    00102 struct CursorVars {
    00103   Point pos, size, offs, delta;
    00104   Point draw_pos, draw_size;
    00105   int short_vehicle_offset;
    00106   SpriteID sprite;
    00107   SpriteID pal;
    00108
    00109   int wheel;
    00110
    00111   /* We need two different vars to keep track of how far the scrollwheel moved.
    00112    * OSX uses this for scrolling around the map. */
    00113   int v_wheel;
    00114   int h_wheel;
    00115
    00116   const AnimCursor *animate_list;
    00117   const AnimCursor *animate_cur;
    00118   uint animate_timeout;
    00119
    00120   bool visible;
    00121   bool dirty;
    00122   bool fix_at;
    00123   bool in_window;
    00124 };
    00125
    00126 struct DrawPixelInfo {
    00127   void *dst_ptr;
    00128   int left, top, width, height;
    00129   int pitch;
    00130   ZoomLevel zoom;
    00131 };
    00132
    00133 struct Colour {
    00134   byte r;
    00135   byte g;
    00136   byte b;
    00137 };
    00138
    00139 enum FontSize {
    00140   FS_NORMAL,
    00141   FS_SMALL,
    00142   FS_LARGE,
    00143   FS_END,
    00144 };
    00145 DECLARE_POSTFIX_INCREMENT(FontSize);
    00146
    00152 struct SubSprite {
    00153   int left, top, right, bottom;
    00154 };
    00155
    00156 enum {
    00157   COLOUR_DARK_BLUE,
    00158   COLOUR_PALE_GREEN,
    00159   COLOUR_PINK,
    00160   COLOUR_YELLOW,
    00161   COLOUR_RED,
    00162   COLOUR_LIGHT_BLUE,
    00163   COLOUR_GREEN,
    00164   COLOUR_DARK_GREEN,
    00165   COLOUR_BLUE,
    00166   COLOUR_CREAM,
    00167   COLOUR_MAUVE,
    00168   COLOUR_PURPLE,
    00169   COLOUR_ORANGE,
    00170   COLOUR_BROWN,
    00171   COLOUR_GREY,
    00172   COLOUR_WHITE
    00173 };
    00174
    00176 enum TextColour {
    00177   TC_FROMSTRING  = 0x00,
    00178   TC_BLUE        = 0x00,
    00179   TC_SILVER      = 0x01,
    00180   TC_GOLD        = 0x02,
    00181   TC_RED         = 0x03,
    00182   TC_PURPLE      = 0x04,
    00183   TC_LIGHT_BROWN = 0x05,
    00184   TC_ORANGE      = 0x06,
    00185   TC_GREEN       = 0x07,
    00186   TC_YELLOW      = 0x08,
    00187   TC_DARK_GREEN  = 0x09,
    00188   TC_CREAM       = 0x0A,
    00189   TC_BROWN       = 0x0B,
    00190   TC_WHITE       = 0x0C,
    00191   TC_LIGHT_BLUE  = 0x0D,
    00192   TC_GREY        = 0x0E,
    00193   TC_DARK_BLUE   = 0x0F,
    00194   TC_BLACK       = 0x10,
    00195 };
    00196
    00197 enum StringColorFlags {
    00198   IS_PALETTE_COLOR = 0x100,
    00199 };
    00200
    00201 #endif /* GFX_TYPE_H */