Freeciv-3.3: /fast/freeciv/nightly/main/common/style.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Functions
style.h File Reference

Go to the source code of this file.

## Data Structures

struct | nation_style
struct | music_style

## Macros

#define | styles_iterate(_p)
#define | styles_iterate_end
#define | styles_re_active_iterate(_p)
#define | styles_re_active_iterate_end
#define | music_styles_iterate(_p)
#define | music_styles_iterate_end
#define | music_styles_re_active_iterate(_p) music_styles_iterate(_p)
#define | music_styles_re_active_iterate_end music_styles_iterate_end;

## Functions

void | styles_alloc (int count)
void | styles_free (void)
int | style_count (void)
int | style_number (const struct nation_style *pstyle)
int | style_index (const struct nation_style *pstyle)
struct nation_style * | style_by_number (int id)
const char * | style_name_translation (const struct nation_style *pstyle)
const char * | style_rule_name (const struct nation_style *pstyle)
struct nation_style * | style_by_rule_name (const char *name)
void | music_styles_alloc (int count)
void | music_styles_free (void)
int | music_style_number (const struct music_style *pms)
struct music_style * | music_style_by_number (int id)
struct music_style * | player_music_style (struct player *plr)
int | style_of_city (const struct city *pcity)
int | basic_city_style_for_style (struct nation_style *pstyle)
int | city_style (struct city *pcity)

## Macro Definition Documentation

## ◆ music_styles_iterate

#define music_styles_iterate | ( |  | _p | ) |

Value:
{ \
int _i_; \
for (_i_ = 0; _i_ < game.control.num_music_styles; _i_++) { \
struct music_style *_p = music_style_by_number(_i_); \
if (_p != NULL) {
incite_cost
char * incite_cost
Definition comments.c:74
game
struct civ_game game
Definition game.c:61
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
music_style
Definition style.h:29
packet_ruleset_control::num_music_styles
int num_music_styles
Definition packets_gen.h:1451
music_style_by_number
struct music_style * music_style_by_number(int id)
Definition style.c:171

Definition at line 72 of file style.h.

## ◆ music_styles_iterate_end

#define music_styles_iterate_end

Value:
} \
} \
}

Definition at line 79 of file style.h.

## ◆ music_styles_re_active_iterate

#define music_styles_re_active_iterate | ( |  | _p | ) | music_styles_iterate(_p)

Definition at line 85 of file style.h.

## ◆ music_styles_re_active_iterate_end

#define music_styles_re_active_iterate_end music_styles_iterate_end;

Definition at line 88 of file style.h.

## ◆ styles_iterate

#define styles_iterate | ( |  | _p | ) |

Value:
{ \
int _i_; \
for (_i_ = 0; _i_ < game.control.num_styles; _i_++) { \
struct nation_style *_p = style_by_number(_i_);
nation_style
Definition style.h:22
packet_ruleset_control::num_styles
int num_styles
Definition packets_gen.h:1450
style_by_number
struct nation_style * style_by_number(int id)
Definition style.c:88

Definition at line 46 of file style.h.

## ◆ styles_iterate_end

#define styles_iterate_end

Value:
} \
}

Definition at line 52 of file style.h.

## ◆ styles_re_active_iterate

#define styles_re_active_iterate | ( |  | _p | ) |

Value:
styles_iterate(_p) { \
if (!_p->ruledit_disabled) {
styles_iterate
#define styles_iterate(_p)
Definition style.h:46

Definition at line 56 of file style.h.

## ◆ styles_re_active_iterate_end

#define styles_re_active_iterate_end

Value:
} \
} styles_iterate_end;
styles_iterate_end
#define styles_iterate_end
Definition style.h:52

Definition at line 60 of file style.h.

## Function Documentation

## ◆ basic_city_style_for_style()

int basic_city_style_for_style | ( | struct nation_style * | pstyle | ) |

Return basic city style representing nation style.

Definition at line 210 of file style.c.

Referenced by create_races_dialog(), popup_races_dialog(), races_dialog::races_dialog(), sanity_check_ruleset_data(), and select_nation().

## ◆ city_style()

int city_style | ( | struct city * | pcity | ) |

Return citystyle of the city.

Definition at line 241 of file style.c.

Referenced by city_style_refresh(), get_sample_city_surface(), sg_load_player_city(), and sg_load_player_city().

## ◆ music_style_by_number()

struct music_style * music_style_by_number | ( | int | id | ) |

Return music style of given id.

Definition at line 171 of file style.c.

Referenced by handle_ruleset_music(), load_ruleset_styles(), and start_style_music().

## ◆ music_style_number()

int music_style_number | ( | const struct music_style * | pms | ) |

Return the music style id.

Definition at line 161 of file style.c.

Referenced by package_player_common().

## ◆ music_styles_alloc()

void music_styles_alloc | ( | int | count | ) |

Initialise music styles structures.

Definition at line 133 of file style.c.

Referenced by handle_ruleset_control(), and load_ruleset_styles().

## ◆ music_styles_free()

void music_styles_free | ( | void |  | ) |

Free the memory associated with music styles

Definition at line 148 of file style.c.

Referenced by game_ruleset_free().

## ◆ player_music_style()

struct music_style * player_music_style | ( | struct player * | plr | ) |

Return music style for player

Definition at line 185 of file style.c.

Referenced by package_player_common().

## ◆ style_by_number()

struct nation_style * style_by_number | ( | int | id | ) |

Return style of given id.

Definition at line 88 of file style.c.

Referenced by handle_nation_select_req(), handle_player_info(), handle_ruleset_nation(), handle_ruleset_style(), load_ruleset_nations(), sg_load_player_main(), sg_load_player_main(), universal_by_number(), and universal_value_initial().

## ◆ style_by_rule_name()

struct nation_style * style_by_rule_name | ( | const char * | name | ) |

Returns style matching rule name or NULL if there is no style with such name.

Definition at line 117 of file style.c.

Referenced by load_ruleset_nations(), playernation_command(), sg_load_player_main(), sg_load_player_main(), and universal_value_from_str().

## ◆ style_count()

int style_count | ( | void |  | ) |

Return the number of styles.

Definition at line 60 of file style.c.

## ◆ style_index()

int style_index | ( | const struct nation_style * | pstyle | ) |

Return the style index.

Definition at line 78 of file style.c.

Referenced by load_style_names(), and send_ruleset_styles().

## ◆ style_name_translation()

const char * style_name_translation | ( | const struct nation_style * | pstyle | ) |

Return the (translated) name of the style. You don't have to free the return pointer.

Definition at line 99 of file style.c.

Referenced by races_dialog::races_dialog(), req_text_insert(), universal_name_translation(), and worklist_item_postpone_req_vec().

## ◆ style_number()

int style_number | ( | const struct nation_style * | pstyle | ) |

Return the style id.

Definition at line 68 of file style.c.

Referenced by create_races_dialog(), nation_button_callback(), races_dialog::nation_selected(), package_player_common(), popup_races_dialog(), races_dialog::races_dialog(), races_nation_callback(), races_toggles_set_sensitive(), send_ruleset_nations(), and universal_number().

## ◆ style_of_city()

int style_of_city | ( | const struct city * | pcity | ) |

Evaluate which style should be used to draw a city.

Definition at line 202 of file style.c.

Referenced by get_citizen_sprite(), get_city_sprite(), popup_city_cma_dialog(), and real_city_dialog_popup().

## ◆ style_rule_name()

const char * style_rule_name | ( | const struct nation_style * | pstyle | ) |

Return the (untranslated) rule name of the style. You don't have to free the return pointer.

Definition at line 108 of file style.c.

Referenced by sanity_check_ruleset_data(), save_nation(), sg_load_player_main(), sg_load_player_main(), sg_save_player_main(), style_by_rule_name(), universal_kind_values(), and universal_rule_name().

## ◆ styles_alloc()

void styles_alloc | ( | int | count | ) |

Initialise styles structures.

Definition at line 36 of file style.c.

Referenced by handle_ruleset_control(), and load_style_names().

## ◆ styles_free()

void styles_free | ( | void |  | ) |

Free the memory associated with styles

Definition at line 51 of file style.c.

Referenced by game_ruleset_free().