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 (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
void happiness_dialog_init (void)
 
void happiness_dialog_done (void)
 
static void refresh_feeling_surface (GtkWidget *pic, 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 309 of file happiness.c.

◆ 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 168 of file happiness.c.

◆ get_happiness_dialog()

static struct happiness_dialog * get_happiness_dialog ( struct city pcity)
static

Return happiness dialog for a city

Definition at line 99 of file happiness.c.

◆ 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 336 of file happiness.c.

◆ happiness_dialog_done()

void happiness_dialog_done ( void  )

Remove happiness dialog

Definition at line 91 of file happiness.c.

◆ happiness_dialog_init()

void happiness_dialog_init ( void  )

Create happiness dialog

Definition at line 83 of file happiness.c.

◆ refresh_feeling_surface()

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

Refresh citizens surface

Definition at line 267 of file happiness.c.

◆ refresh_happiness_dialog()

void refresh_happiness_dialog ( struct city pcity)

Refresh whole happiness dialog

Definition at line 295 of file happiness.c.

◆ show_happiness_popup()

static gboolean show_happiness_popup ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)
static

Popup for the happiness display.

Definition at line 113 of file happiness.c.

Variable Documentation

◆ dialog_list

struct dialog_list* dialog_list
static

Definition at line 71 of file happiness.c.