Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
cma_fe.c File Reference
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "events.h"
#include "game.h"
#include "chatline_g.h"
#include "citydlg_g.h"
#include "client_main.h"
#include "cma_fec.h"
#include "messagewin_g.h"
#include "options.h"
#include "cityrep.h"
#include "dialogs.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "helpdlg.h"
#include "inputdlg.h"
#include "cma_fe.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  _FcPresetRow
 
struct  _FcPresetRowClass
 

Macros

#define BUFFER_SIZE   64
 
#define SPECLIST_TAG   dialog
 
#define SPECLIST_TYPE   struct cma_dialog
 
#define dialog_list_iterate(dialoglist, pdialog)    TYPED_LIST_ITERATE(struct cma_dialog, dialoglist, pdialog)
 
#define dialog_list_iterate_end   LIST_ITERATE_END
 
#define FC_TYPE_PRESET_ROW   (fc_preset_row_get_type())
 

Functions

static struct cma_dialogget_cma_dialog (struct city *pcity)
 
static void update_cma_preset_list (struct cma_dialog *pdialog)
 
static gboolean cma_preset_key_pressed (GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer data)
 
static void cma_del_preset_callback (GtkWidget *w, gpointer data)
 
static void cma_preset_remove (struct cma_dialog *pdialog, int preset_index)
 
static void cma_preset_remove_response (GtkWidget *w, gint response, gpointer data)
 
static void cma_add_preset_callback (GtkWidget *w, gpointer data)
 
static void cma_preset_add_popup_callback (gpointer data, gint response, const char *input)
 
static void cma_active_callback (GtkWidget *w, gpointer data)
 
static void cma_activate_preset_callback (GtkSelectionModel *self, guint position, guint n_items, gpointer data)
 
static void hscale_changed (GtkWidget *get, gpointer data)
 
static void set_hscales (const struct cm_parameter *const parameter, struct cma_dialog *pdialog)
 
static void fc_preset_row_finalize (GObject *gobject)
 
static void fc_preset_row_class_init (FcPresetRowClass *klass)
 
static void fc_preset_row_init (FcPresetRow *self)
 
static FcPresetRowfc_preset_row_new (void)
 
void cma_fe_init (void)
 
void cma_fe_done (void)
 
void close_cma_dialog (struct city *pcity)
 
static void cma_dialog_destroy_callback (GtkWidget *w, gpointer data)
 
static gboolean button_press_callback (GtkGestureClick *gesture, int n_press, double x, double y)
 
static void help_callback (GtkWidget *w, gpointer data)
 
static void preset_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void preset_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
struct cma_dialogcreate_cma_dialog (struct city *pcity, bool tiny)
 
void refresh_cma_dialog (struct city *pcity, enum cma_refresh refresh)
 

Variables

static struct dialog_list * dialog_list
 
static int allow_refreshes = 1
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   64

Definition at line 48 of file cma_fe.c.

◆ dialog_list_iterate

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

Definition at line 54 of file cma_fe.c.

◆ dialog_list_iterate_end

#define dialog_list_iterate_end   LIST_ITERATE_END

Definition at line 56 of file cma_fe.c.

◆ FC_TYPE_PRESET_ROW

#define FC_TYPE_PRESET_ROW   (fc_preset_row_get_type())

Definition at line 88 of file cma_fe.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   dialog

Definition at line 50 of file cma_fe.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct cma_dialog

Definition at line 51 of file cma_fe.c.

Function Documentation

◆ button_press_callback()

static gboolean button_press_callback ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y 
)
static

User has pressed button in cma dialog

Definition at line 213 of file cma_fe.c.

◆ close_cma_dialog()

void close_cma_dialog ( struct city pcity)

only called when the city dialog is closed.

Definition at line 172 of file cma_fe.c.

◆ cma_activate_preset_callback()

static void cma_activate_preset_callback ( GtkSelectionModel self,
guint  position,
guint  n_items,
gpointer  data 
)
static

Callback for selecting a preset from the preset view

Definition at line 613 of file cma_fe.c.

◆ cma_active_callback()

static void cma_active_callback ( GtkWidget w,
gpointer  data 
)
static

Activates/deactivates agent control.

Definition at line 773 of file cma_fe.c.

◆ cma_add_preset_callback()

static void cma_add_preset_callback ( GtkWidget w,
gpointer  data 
)
static

Pops up a dialog to allow to name your new preset

Definition at line 637 of file cma_fe.c.

◆ cma_del_preset_callback()

static void cma_del_preset_callback ( GtkWidget w,
gpointer  data 
)
static

Callback for del_preset

Definition at line 712 of file cma_fe.c.

◆ cma_dialog_destroy_callback()

static void cma_dialog_destroy_callback ( GtkWidget w,
gpointer  data 
)
static

Destroy cma dialog

Definition at line 188 of file cma_fe.c.

◆ cma_fe_done()

void cma_fe_done ( void  )

Free resources allocated for cma front end system

Definition at line 164 of file cma_fe.c.

◆ cma_fe_init()

void cma_fe_init ( void  )

Initialize cma front end system

Definition at line 156 of file cma_fe.c.

◆ cma_preset_add_popup_callback()

static void cma_preset_add_popup_callback ( gpointer  data,
gint  response,
const char input 
)
static

Callback for the add_preset popup

Definition at line 660 of file cma_fe.c.

◆ cma_preset_key_pressed()

static gboolean cma_preset_key_pressed ( GtkEventControllerKey controller,
guint  keyval,
guint  keycode,
GdkModifierType  state,
gpointer  data 
)
static

Key pressed in preset list

Definition at line 684 of file cma_fe.c.

◆ cma_preset_remove()

static void cma_preset_remove ( struct cma_dialog pdialog,
int  preset_index 
)
static

Pops up a dialog to remove a preset

Definition at line 727 of file cma_fe.c.

◆ cma_preset_remove_response()

static void cma_preset_remove_response ( GtkWidget w,
gint  response,
gpointer  data 
)
static

Callback for the remove_preset popup

Definition at line 752 of file cma_fe.c.

◆ create_cma_dialog()

struct cma_dialog * create_cma_dialog ( struct city pcity,
bool  tiny 
)

Instantiates a new struct for each city_dialog window that is open.

Definition at line 283 of file cma_fe.c.

◆ fc_preset_row_class_init()

static void fc_preset_row_class_init ( FcPresetRowClass klass)
static

Initialization method for FcPresetRow class

Definition at line 125 of file cma_fe.c.

◆ fc_preset_row_finalize()

static void fc_preset_row_finalize ( GObject gobject)
static

Finalizing method for FcPresetRow class

Definition at line 109 of file cma_fe.c.

Referenced by fc_preset_row_class_init().

◆ fc_preset_row_init()

static void fc_preset_row_init ( FcPresetRow self)
static

Initialization method for FcPresetRow

Definition at line 136 of file cma_fe.c.

◆ fc_preset_row_new()

static FcPresetRow * fc_preset_row_new ( void  )
static

FcPresetRow creation method

Definition at line 144 of file cma_fe.c.

Referenced by update_cma_preset_list().

◆ get_cma_dialog()

struct cma_dialog * get_cma_dialog ( struct city pcity)
static

Return the cma_dialog for a given city.

Definition at line 199 of file cma_fe.c.

◆ help_callback()

static void help_callback ( GtkWidget w,
gpointer  data 
)
static

User has requested help

Definition at line 250 of file cma_fe.c.

◆ hscale_changed()

static void hscale_changed ( GtkWidget get,
gpointer  data 
)
static

Callback if we moved the sliders.

Definition at line 813 of file cma_fe.c.

◆ preset_factory_bind()

static void preset_factory_bind ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Wlmeta table cell bind function

Definition at line 258 of file cma_fe.c.

Referenced by create_cma_dialog().

◆ preset_factory_setup()

static void preset_factory_setup ( GtkSignalListItemFactory self,
GtkListItem list_item,
gpointer  user_data 
)
static

Wlmeta table cell setup function

Definition at line 273 of file cma_fe.c.

Referenced by create_cma_dialog().

◆ refresh_cma_dialog()

void refresh_cma_dialog ( struct city pcity,
enum cma_refresh  refresh 
)

Refreshes the cma dialog

Definition at line 538 of file cma_fe.c.

◆ set_hscales()

static void set_hscales ( const struct cm_parameter *const  parameter,
struct cma_dialog pdialog 
)
static

Called to adjust the sliders when a preset is selected notice that we don't want to call update_result here.

Definition at line 792 of file cma_fe.c.

◆ update_cma_preset_list()

static void update_cma_preset_list ( struct cma_dialog pdialog)
static

Fills in the preset list

Definition at line 589 of file cma_fe.c.

Variable Documentation

◆ allow_refreshes

int allow_refreshes = 1
static

Definition at line 60 of file cma_fe.c.

◆ dialog_list

struct dialog_list* dialog_list
static

Definition at line 58 of file cma_fe.c.