simskin.h 5.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef __SIMSKIN_H
#define __SIMSKIN_H

#include "simcolor.h"

// Max Kielland
// Classic helper macro to transform a #define value into a "string"
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)

// For test purposes themes can be disabled or an alternative theme.tab file can be used.
//  -1 = No theme, use internal fallback
//   0 = Normal use, read theme.tab
// n>0 = Use alternative file named theme_n.tab

template<class T> class slist_tpl;
17
class skin_desc_t;
18 19 20 21 22 23 24 25 26 27


class skinverwaltung_t {
public:
	enum skintyp_t { nothing, menu, cursor, symbol, misc };

	/// @name icons used in the toolbars
	/// @{

	/// icon images for advanced tools (everything that involves clicking on the map)
28
	static const skin_desc_t *tool_icons_general;
29
	/// icon images for simple tools (eg pause, fast forward)
30
	static const skin_desc_t *tool_icons_simple;
31
	/// icon images for GUI tools (which open windows)
32
	static const skin_desc_t *tool_icons_dialoge;
33
	/// icon images for toolbars
34
	static const skin_desc_t *tool_icons_toolbars;
35
	/// icon to skin toolbar background
36
	static const skin_desc_t *toolbar_background;
37 38 39 40 41 42
	/// @}

	/**
	 * Different GUI elements
	 * @author prissi
	 */
43 44 45 46 47 48 49 50 51 52
	static const skin_desc_t* button;
	static const skin_desc_t* round_button;
	static const skin_desc_t* check_button;
	static const skin_desc_t* posbutton;
	static const skin_desc_t* back;
	static const skin_desc_t* scrollbar;
	static const skin_desc_t* divider;
	static const skin_desc_t* editfield;
	static const skin_desc_t* listbox;
	static const skin_desc_t* gadget;
53 54 55 56 57

	/// @name pictures used in the GUI
	/// @{

	/// image shown in welcome screen @see banner.cc
58
	static const skin_desc_t *logosymbol;
59
	/// image shown when loading pakset
60
	static const skin_desc_t *biglogosymbol;
61
	/// image shown with 'happy new year' message
62
	static const skin_desc_t *neujahrsymbol;
63
	/// image shown when creating new world
64
	static const skin_desc_t *neueweltsymbol;
65
	/// image shown in language selection
66
	static const skin_desc_t *flaggensymbol;
67
	/// image shown in message boxes @see gui/messagebox.h
68
	static const skin_desc_t *meldungsymbol;
69
	/// image shown in message options window
70
	static const skin_desc_t *message_options;
71
	/// image shown in color selection window
72
	static const skin_desc_t *color_options;
73
	// isometric compass for main map (evt. minimap)
74
	static const skin_desc_t *compass_iso;
75
	// normal staight compass for minimap
76
	static const skin_desc_t *compass_map;
77 78 79 80
	/// @}

	/// @name icons used for the tabs in the line management window
	/// @{
81 82 83 84 85 86 87 88 89
	static const skin_desc_t *zughaltsymbol;
	static const skin_desc_t *autohaltsymbol;
	static const skin_desc_t *schiffshaltsymbol;
	static const skin_desc_t *airhaltsymbol;
	static const skin_desc_t *monorailhaltsymbol;
	static const skin_desc_t *maglevhaltsymbol;
	static const skin_desc_t *narrowgaugehaltsymbol;
	static const skin_desc_t *bushaltsymbol;
	static const skin_desc_t *tramhaltsymbol;
90 91 92 93
	///@}

	/// @name icons shown in status bar at the bottom of the screen
	/// @{
94 95 96 97 98
	static const skin_desc_t *networksymbol;
	static const skin_desc_t *timelinesymbol;
	static const skin_desc_t *fastforwardsymbol;
	static const skin_desc_t *pausesymbol;
	static const skin_desc_t *seasons_icons;
99 100 101 102
	/// @}

	/// @name icons used to show which halt serves passengers / mail / freight
	/// @{
103 104 105
	static const skin_desc_t *passengers;
	static const skin_desc_t *mail;
	static const skin_desc_t *goods;
106 107 108
	/// @}

	/// images shown in display of lines in mini-map
109
	static const skin_desc_t *station_type;
110 111

	/// image to indicate power supply of factories
112
	static const skin_desc_t *electricity;
113
	/// image to indicate that an attraction is inside a town (attraction list window)
114
	static const skin_desc_t *intown;
115 116 117 118 119 120


	/// @name cursors
	/// @{

	/// cursors for tools
121
	static const skin_desc_t *cursor_general;
122
	/// for allegro: emulate mouse cursor
123
	static const skin_desc_t *mouse_cursor;
124
	/// symbol to mark tiles by AI players and text labels
125
	static const skin_desc_t *belegtzeiger;
126
	/// icon to mark start tiles for construction (ie the bulldozer image)
127
	static const skin_desc_t *bauigelsymbol;
128 129 130
	/// @}

	/// shown in hidden-buildings mode instead of buildings images
131
	static const skin_desc_t *construction_site;
132
	/// texture to be shown beneath city roads to indicate pavements
133
	static const skin_desc_t *fussweg;
134
	/// transformer image: supply
135
	static const skin_desc_t *pumpe;
136
	/// transformer image: consumer
137
	static const skin_desc_t *senke;
138
	/// texture to be shown beneath ways in tunnel
139
	static const skin_desc_t *tunnel_texture;
140

141 142
	static bool register_desc(skintyp_t type, const skin_desc_t *desc);
	static bool successfully_loaded(skintyp_t type);
143 144 145 146 147 148 149

	/**
	 * retrieves objects with type=menu and given name
	 * @param str pointer to beginning of name string (not null-terminated)
	 * @param len length of string
	 * @return pointer to skin object or NULL if nothing found
	 */
150
	static const skin_desc_t *get_extra( const char *str, int len );
151 152 153

private:
	/// holds objects from paks with type 'menu'
154
	static slist_tpl<const skin_desc_t *>extra_obj;
155 156 157
};

#endif