Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
events.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "support.h"
#include "events.h"

Go to the source code of this file.

Macros

#define GEN_EV(event, section, descr)   { #event, NULL, section, descr, NULL, event }
 

Enumerations

enum  event_section_n {
  E_S_ADVANCE , E_S_BUILD , E_S_CITY , E_S_D_ME ,
  E_S_D_THEM , E_S_GLOBAL , E_S_HUT , E_S_NATION ,
  E_S_TREATY , E_S_UNIT , E_S_VOTE , E_S_WONDER ,
  E_S_XYZZY
}
 

Functions

const charget_event_message_text (enum event_type event)
 
static int compar_event_message_texts (const void *i1, const void *i2)
 
const charget_event_tag (enum event_type event)
 
bool is_city_event (enum event_type event)
 
void events_init (void)
 
void events_free (void)
 

Variables

static const charevent_sections []
 
struct { 
 
   const char *   enum_name 
 
   char *   tag_name 
 
   enum event_section_n   esn 
 
   char *   descr_orig 
 
   char *   full_descr 
 
   enum event_type   event 
 
events [] 
 
static int event_to_index [E_COUNT]
 
enum event_type sorted_events [E_COUNT]
 

Macro Definition Documentation

◆ GEN_EV

#define GEN_EV (   event,
  section,
  descr 
)    { #event, NULL, section, descr, NULL, event }

Definition at line 68 of file events.c.

Enumeration Type Documentation

◆ event_section_n

Enumerator
E_S_ADVANCE 
E_S_BUILD 
E_S_CITY 
E_S_D_ME 
E_S_D_THEM 
E_S_GLOBAL 
E_S_HUT 
E_S_NATION 
E_S_TREATY 
E_S_UNIT 
E_S_VOTE 
E_S_WONDER 
E_S_XYZZY 

Definition at line 30 of file events.c.

Function Documentation

◆ compar_event_message_texts()

static int compar_event_message_texts ( const void i1,
const void i2 
)
static

Comparison function for qsort; i1 and i2 are pointers to an event (enum event_type).

Definition at line 264 of file events.c.

Referenced by events_init().

◆ events_free()

void events_free ( void  )

Free events.

Definition at line 377 of file events.c.

◆ events_init()

void events_init ( void  )

Initialize events. Now also initialise sorted_events[].

Definition at line 331 of file events.c.

Referenced by message_options_init().

◆ get_event_message_text()

const char * get_event_message_text ( enum event_type  event)

Returns the translated description of the given event.

Definition at line 247 of file events.c.

Referenced by compar_event_message_texts(), create_messageopt_dialog(), and message_dlg::fill_data().

◆ get_event_tag()

const char * get_event_tag ( enum event_type  event)

Returns a string for the sound to be used for this message type.

Definition at line 276 of file events.c.

Referenced by play_sound_for_event(), and tileset_lookup_sprite_tags().

◆ is_city_event()

bool is_city_event ( enum event_type  event)

Does the event affect a city if there's one at the event location.

Definition at line 291 of file events.c.

Referenced by meswin_double_click().

Variable Documentation

◆ descr_orig

char* descr_orig

Definition at line 79 of file events.c.

Referenced by events_init().

◆ enum_name

const char* enum_name

Definition at line 76 of file events.c.

Referenced by _by_name(), and events_init().

◆ esn

Definition at line 78 of file events.c.

Referenced by events_init().

◆ event

Definition at line 81 of file events.c.

Referenced by api_notify_embassies_msg(), api_notify_event_msg(), api_notify_research_embassies_msg(), api_notify_research_msg(), change_build_target(), client_handle_packet(), units_select::closeEvent(), connection_list_event(), unit_item::contextMenuEvent(), fc_sidewidget::contextMenuEvent(), create_event(), hud_action::enterEvent(), fc_sidewidget::enterEvent(), chat_input::event(), fc_client::event(), event_after(), chatwdg::eventFilter(), city_dialog::eventFilter(), events_init(), FilterMouseMotionEvents(), force_exit_from_event_loop(), get_event_message_text(), get_event_sprite(), get_event_tag(), handle_event(), illegal_action_msg(), is_city_event(), keyboard_handler(), units_select::keyPressEvent(), hud_message_box::keyPressEvent(), unit_hud_selector::keyPressEvent(), map_view::keyPressEvent(), leave_mapcanvas(), hud_action::leaveEvent(), fc_sidewidget::leaveEvent(), message_options_load(), message_options_save(), meswin_add(), meswin_double_click(), motion_notify_event(), impr_item::mouseDoubleClickEvent(), qfc_dialog::mouseMoveEvent(), notify_dialog::mouseMoveEvent(), map_view::mouseMoveEvent(), resize_widget::mouseMoveEvent(), move_widget::mouseMoveEvent(), minimap_view::mouseMoveEvent(), info_tab::mouseMoveEvent(), fc_double_edge::mouseMoveEvent(), research_diagram::mouseMoveEvent(), unit_item::mousePressEvent(), city_map::mousePressEvent(), production_widget::mousePressEvent(), qfc_dialog::mousePressEvent(), notify_dialog::mousePressEvent(), units_select::mousePressEvent(), scale_widget::mousePressEvent(), resize_widget::mousePressEvent(), move_widget::mousePressEvent(), close_widget::mousePressEvent(), minimap_view::mousePressEvent(), info_tab::mousePressEvent(), plr_widget::mousePressEvent(), fc_double_edge::mousePressEvent(), research_diagram::mousePressEvent(), fc_sidewidget::mousePressEvent(), map_view::mouseReleaseEvent(), notify_conn(), notify_conn_early(), notify_embassies(), notify_player(), notify_research(), notify_research_embassies(), notify_team(), option_button_press_callback(), package_event(), package_event_full(), page_conn_etype(), map_view::paint(), fc_sidewidget::paint(), fc_sidebar::paint(), chatwdg::paintEvent(), qfc_dialog::paintEvent(), units_select::paintEvent(), goto_dialog::paintEvent(), scale_widget::paintEvent(), map_view::paintEvent(), info_tile::paintEvent(), minimap_view::paintEvent(), messagewdg::paintEvent(), fc_sidewidget::paintEvent(), fc_sidebar::paintEvent(), xvote::paintEvent(), receive_packet_chat_msg_100(), receive_packet_early_chat_msg_100(), receive_packet_page_msg_100(), fc_game_tab_widget::resizeEvent(), right_notebook_button_release(), science_diagram_button_release_callback(), fc_client::timerEvent(), tolua_server_notify_embassies_msg00(), tolua_server_notify_event_msg00(), tolua_server_notify_research_embassies_msg00(), tolua_server_notify_research_msg00(), vpackage_event(), unit_item::wheelEvent(), unit_info::wheelEvent(), impr_item::wheelEvent(), impr_info::wheelEvent(), units_select::wheelEvent(), minimap_view::wheelEvent(), and unittype_item::wheelEvent().

◆ event_sections

const char* event_sections[]
static
Initial value:
= {
N_("Technology: %s"),
N_("Improvement: %s"),
N_("City: %s"),
N_("Diplomat Action: %s"),
N_("Enemy Diplomat: %s"),
N_("Global: %s"),
N_("Hut: %s"),
N_("Nation: %s"),
N_("Treaty: %s"),
N_("Unit: %s"),
N_("Vote: %s"),
N_("Wonder: %s"),
}
char * incite_cost
Definition comments.c:76
#define N_(String)
Definition fcintl.h:69

Definition at line 49 of file events.c.

Referenced by events_init().

◆ event_to_index

int event_to_index[E_COUNT]
static

Definition at line 239 of file events.c.

Referenced by events_init(), get_event_message_text(), and get_event_tag().

◆ [struct]

struct { ... } events[]

◆ full_descr

char* full_descr

Definition at line 80 of file events.c.

Referenced by events_free(), and events_init().

◆ sorted_events

enum event_type sorted_events[E_COUNT]

Definition at line 241 of file events.c.

Referenced by events_init().

◆ tag_name

char* tag_name