Freeciv-3.2
Loading...
Searching...
No Matches
colors_common.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__COLORS_COMMON_H
15#define FC__COLORS_COMMON_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* utility */
22#include "registry.h"
23
24/* common */
25#include "fc_types.h"
26
27/* The color system is designed on the assumption that almost, but
28 * not quite, all displays will be truecolor. */
29
30struct color;
31struct color_system;
32struct tileset;
33struct rgbcolor;
34
35#define SPECENUM_NAME color_std
36/* Mapview colors */
37#define SPECENUM_VALUE0 COLOR_MAPVIEW_UNKNOWN /* Black */
38#define SPECENUM_VALUE0NAME "mapview_unknown"
39#define SPECENUM_VALUE1 COLOR_MAPVIEW_CITYTEXT /* white */
40#define SPECENUM_VALUE1NAME "mapview_citytext"
41#define SPECENUM_VALUE2 COLOR_MAPVIEW_CITYTEXT_DARK /* black */
42#define SPECENUM_VALUE2NAME "mapview_citytext_dark"
43#define SPECENUM_VALUE3 COLOR_MAPVIEW_CITYPROD_NEGATIVE /* red */
44#define SPECENUM_VALUE3NAME "mapview_cityprod_negative"
45#define SPECENUM_VALUE4 COLOR_MAPVIEW_CITYGROWTH_BLOCKED /* red */
46#define SPECENUM_VALUE4NAME "mapview_cityblocked"
47#define SPECENUM_VALUE5 COLOR_MAPVIEW_GOTO /* cyan */
48#define SPECENUM_VALUE5NAME "mapview_goto"
49#define SPECENUM_VALUE6 COLOR_MAPVIEW_SELECTION /* yellow */
50#define SPECENUM_VALUE6NAME "mapview_selection"
51#define SPECENUM_VALUE7 COLOR_MAPVIEW_TRADE_ROUTE_LINE
52#define SPECENUM_VALUE7NAME "mapview_trade_route_line"
53#define SPECENUM_VALUE8 COLOR_MAPVIEW_TRADE_ROUTES_ALL_BUILT /* green */
54#define SPECENUM_VALUE8NAME "mapview_trade_routes_all_built"
55#define SPECENUM_VALUE9 COLOR_MAPVIEW_TRADE_ROUTES_SOME_BUILT /* yellow */
56#define SPECENUM_VALUE9NAME "mapview_trade_routes_some_built"
57#define SPECENUM_VALUE10 COLOR_MAPVIEW_TRADE_ROUTES_NO_BUILT /* red */
58#define SPECENUM_VALUE10NAME "mapview_trade_routes_no_built"
59#define SPECENUM_VALUE11 COLOR_MAPVIEW_CITY_LINK /* green */
60#define SPECENUM_VALUE11NAME "mapview_city_link"
61#define SPECENUM_VALUE12 COLOR_MAPVIEW_TILE_LINK /* red */
62#define SPECENUM_VALUE12NAME "mapview_tile_link"
63#define SPECENUM_VALUE13 COLOR_MAPVIEW_UNIT_LINK /* cyan */
64#define SPECENUM_VALUE13NAME "mapview_unit_link"
65/* Spaceship colors */
66#define SPECENUM_VALUE14 COLOR_SPACESHIP_BACKGROUND /* black */
67#define SPECENUM_VALUE14NAME "spaceship_background"
68/* Overview colors */
69#define SPECENUM_VALUE15 COLOR_OVERVIEW_UNKNOWN /* Black */
70#define SPECENUM_VALUE15NAME "overview_unknown"
71#define SPECENUM_VALUE16 COLOR_OVERVIEW_MY_CITY /* white */
72#define SPECENUM_VALUE16NAME "overview_mycity"
73#define SPECENUM_VALUE17 COLOR_OVERVIEW_ALLIED_CITY
74#define SPECENUM_VALUE17NAME "overview_alliedcity"
75#define SPECENUM_VALUE18 COLOR_OVERVIEW_ENEMY_CITY /* cyan */
76#define SPECENUM_VALUE18NAME "overview_enemycity"
77#define SPECENUM_VALUE19 COLOR_OVERVIEW_MY_UNIT /* yellow */
78#define SPECENUM_VALUE19NAME "overview_myunit"
79#define SPECENUM_VALUE20 COLOR_OVERVIEW_ALLIED_UNIT
80#define SPECENUM_VALUE20NAME "overview_alliedunit"
81#define SPECENUM_VALUE21 COLOR_OVERVIEW_ENEMY_UNIT /* red */
82#define SPECENUM_VALUE21NAME "overview_enemyunit"
83#define SPECENUM_VALUE22 COLOR_OVERVIEW_OCEAN /* ocean/blue */
84#define SPECENUM_VALUE22NAME "overview_ocean"
85#define SPECENUM_VALUE23 COLOR_OVERVIEW_LAND /* ground/green */
86#define SPECENUM_VALUE23NAME "overview_ground"
87#define SPECENUM_VALUE24 COLOR_OVERVIEW_FROZEN /* frozen/grey */
88#define SPECENUM_VALUE24NAME "overview_frozen"
89#define SPECENUM_VALUE25 COLOR_OVERVIEW_VIEWRECT /* white */
90#define SPECENUM_VALUE25NAME "overview_viewrect"
91/* Reqtree colors */
92#define SPECENUM_VALUE26 COLOR_REQTREE_RESEARCHING /* cyan */
93#define SPECENUM_VALUE26NAME "reqtree_researching"
94#define SPECENUM_VALUE27 COLOR_REQTREE_KNOWN /* green */
95#define SPECENUM_VALUE27NAME "reqtree_known"
96#define SPECENUM_VALUE28 COLOR_REQTREE_GOAL_PREREQS_KNOWN
97#define SPECENUM_VALUE28NAME "reqtree_goal_prereqs_known"
98#define SPECENUM_VALUE29 COLOR_REQTREE_GOAL_UNKNOWN
99#define SPECENUM_VALUE29NAME "reqtree_goal_unknown"
100#define SPECENUM_VALUE30 COLOR_REQTREE_PREREQS_KNOWN /* yellow */
101#define SPECENUM_VALUE30NAME "reqtree_prereqs_known"
102#define SPECENUM_VALUE31 COLOR_REQTREE_UNKNOWN /* red */
103#define SPECENUM_VALUE31NAME "reqtree_unknown"
104#define SPECENUM_VALUE32 COLOR_REQTREE_UNREACHABLE
105#define SPECENUM_VALUE32NAME "reqtree_unreachable"
106#define SPECENUM_VALUE33 COLOR_REQTREE_NOT_GETTABLE
107#define SPECENUM_VALUE33NAME "reqtree_not_gettable"
108#define SPECENUM_VALUE34 COLOR_REQTREE_GOAL_NOT_GETTABLE
109#define SPECENUM_VALUE34NAME "reqtree_goal_not_gettable"
110#define SPECENUM_VALUE35 COLOR_REQTREE_BACKGROUND /* black */
111#define SPECENUM_VALUE35NAME "reqtree_background"
112#define SPECENUM_VALUE36 COLOR_REQTREE_TEXT /* black */
113#define SPECENUM_VALUE36NAME "reqtree_text"
114#define SPECENUM_VALUE37 COLOR_REQTREE_EDGE /* gray */
115#define SPECENUM_VALUE37NAME "reqtree_edge"
116/* Player dialog */
117#define SPECENUM_VALUE38 COLOR_PLAYER_COLOR_BACKGROUND /* black */
118#define SPECENUM_VALUE38NAME "playerdlg_background"
119
120#define SPECENUM_COUNT COLOR_LAST
121#include "specenum_gen.h"
122
123struct color *get_color(const struct tileset *t, enum color_std stdcolor);
124bool player_has_color(const struct player *pplayer);
125struct color *get_player_color(const struct tileset *t,
126 const struct player *pplayer);
127struct color *get_terrain_color(const struct tileset *t,
128 const struct terrain *pterrain);
129struct color *ensure_color(struct rgbcolor *rgb);
130
131/* Functions used by the tileset to allocate the color system. */
132struct color_system *color_system_read(struct section_file *file);
133void color_system_free(struct color_system *colors);
134
135/* Utilities for color values */
136struct color *color_best_contrast(struct color *subject,
137 struct color **candidates, int ncandidates);
138
139#ifdef __cplusplus
140}
141#endif /* __cplusplus */
142
143#endif /* FC__COLORS_COMMON_H */
void color_system_free(struct color_system *colors)
struct color * color_best_contrast(struct color *subject, struct color **candidates, int ncandidates)
struct color * get_player_color(const struct tileset *t, const struct player *pplayer)
struct color_system * color_system_read(struct section_file *file)
struct color * ensure_color(struct rgbcolor *rgb)
bool player_has_color(const struct player *pplayer)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
struct color * get_terrain_color(const struct tileset *t, const struct terrain *pterrain)
char * incite_cost
Definition comments.c:74
Definition colors.h:21