Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
happiness.c File Reference
#include <gtk/gtk.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "city.h"
#include "game.h"
#include "government.h"
#include "text.h"
#include "tilespec.h"
#include "graphics.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "happiness.h"
#include "mapview.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  happiness_dialog
 

Macros

#define HAPPINESS_PIX_WIDTH   30
 
#define FEELING_WIDTH   (HAPPINESS_PIX_WIDTH * tileset_small_sprite_width(tileset))
 
#define FEELING_HEIGHT   (tileset_small_sprite_height(tileset))
 
#define NUM_HAPPINESS_MODIFIERS   6
 
#define SPECLIST_TAG   dialog
 
#define SPECLIST_TYPE   struct happiness_dialog
 
#define dialog_list_iterate(dialoglist, pdialog)    TYPED_LIST_ITERATE(struct happiness_dialog, dialoglist, pdialog)
 
#define dialog_list_iterate_end   LIST_ITERATE_END
 

Enumerations

enum  {
  CITIES , LUXURIES , BUILDINGS , NATIONALITY ,
  UNITS , WONDERS
}
 

Functions

static struct happiness_dialogget_happiness_dialog (struct city *pcity)
 
static struct happiness_dialogcreate_happiness_dialog (struct city *pcity, bool low_dlg, GtkWidget *win)
 
static gboolean show_happiness_popup (GtkWidget *w, GdkEventButton *ev, gpointer data)
 
static gboolean show_happiness_button_release (GtkWidget *w, GdkEventButton *ev, gpointer data)
 
void happiness_dialog_init (void)
 
void happiness_dialog_done (void)
 
static void refresh_feeling_surface (cairo_surface_t *dst, struct city *pcity, enum citizen_feeling index)
 
void refresh_happiness_dialog (struct city *pcity)
 
void close_happiness_dialog (struct city *pcity)
 
GtkWidgetget_top_happiness_display (struct city *pcity, bool low_dlg, GtkWidget *win)
 

Variables

static struct dialog_list * dialog_list
 

Macro Definition Documentation

◆ dialog_list_iterate

#define dialog_list_iterate (   dialoglist,
  pdialog 
)     TYPED_LIST_ITERATE(struct happiness_dialog, dialoglist, pdialog)

Definition at line 67 of file happiness.c.

◆ dialog_list_iterate_end

#define dialog_list_iterate_end   LIST_ITERATE_END

Definition at line 69 of file happiness.c.

◆ FEELING_HEIGHT

#define FEELING_HEIGHT   (tileset_small_sprite_height(tileset))

Definition at line 46 of file happiness.c.

◆ FEELING_WIDTH

Definition at line 45 of file happiness.c.

◆ HAPPINESS_PIX_WIDTH

#define HAPPINESS_PIX_WIDTH   30

Definition at line 43 of file happiness.c.

◆ NUM_HAPPINESS_MODIFIERS

#define NUM_HAPPINESS_MODIFIERS   6

Definition at line 48 of file happiness.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   dialog

Definition at line 63 of file happiness.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct happiness_dialog

Definition at line 64 of file happiness.c.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
CITIES 
LUXURIES 
BUILDINGS 
NATIONALITY 
UNITS 
WONDERS 

Definition at line 50 of file happiness.c.

Function Documentation

◆ close_happiness_dialog()

void close_happiness_dialog ( struct city pcity)

Close happiness dialog of given city

Definition at line 330 of file happiness.c.

Referenced by city_destroy_callback(), and switch_city_callback().

◆ create_happiness_dialog()

static struct happiness_dialog * create_happiness_dialog ( struct city pcity,
bool  low_dlg,
GtkWidget win 
)
static

Create the happiness notebook page.

Definition at line 198 of file happiness.c.

Referenced by get_top_happiness_display().

◆ get_happiness_dialog()

static struct happiness_dialog * get_happiness_dialog ( struct city pcity)
static

Return happiness dialog for a city

Definition at line 102 of file happiness.c.

Referenced by close_happiness_dialog(), and refresh_happiness_dialog().

◆ get_top_happiness_display()

GtkWidget * get_top_happiness_display ( struct city pcity,
bool  low_dlg,
GtkWidget win 
)

Create happiness dialog and get its widget

Definition at line 356 of file happiness.c.

Referenced by create_and_append_happiness_page(), and switch_city_callback().

◆ happiness_dialog_done()

void happiness_dialog_done ( void  )

Remove happiness dialog

Definition at line 94 of file happiness.c.

Referenced by ui_main().

◆ happiness_dialog_init()

void happiness_dialog_init ( void  )

Create happiness dialog

Definition at line 86 of file happiness.c.

Referenced by activate_gui(), and ui_main().

◆ refresh_feeling_surface()

static void refresh_feeling_surface ( cairo_surface_t dst,
struct city pcity,
enum citizen_feeling  index 
)
static

Refresh citizens surface

Definition at line 292 of file happiness.c.

Referenced by refresh_happiness_dialog().

◆ refresh_happiness_dialog()

void refresh_happiness_dialog ( struct city pcity)

Refresh whole happiness dialog

Definition at line 317 of file happiness.c.

Referenced by create_happiness_dialog(), and real_city_dialog_refresh().

◆ show_happiness_button_release()

static gboolean show_happiness_button_release ( GtkWidget w,
GdkEventButton ev,
gpointer  data 
)
static

Clear the happiness popup.

Definition at line 185 of file happiness.c.

Referenced by show_happiness_popup().

◆ show_happiness_popup()

static gboolean show_happiness_popup ( GtkWidget w,
GdkEventButton ev,
gpointer  data 
)
static

Popup for the happiness display.

Definition at line 116 of file happiness.c.

Referenced by create_happiness_dialog().

Variable Documentation

◆ dialog_list

struct dialog_list* dialog_list
static