Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
wldlg.c File Reference
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "city.h"
#include "packets.h"
#include "worklist.h"
#include "citydlg_common.h"
#include "client_main.h"
#include "climisc.h"
#include "global_worklist.h"
#include "options.h"
#include "text.h"
#include "tilespec.h"
#include "canvas.h"
#include "citydlg.h"
#include "graphics.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "helpdlg.h"
#include "inputdlg.h"
#include "wldlg.h"

Go to the source code of this file.

Data Structures

struct  _FcWorklistRow
 
struct  _FcWorklistClass
 
struct  _FcWlmetaRow
 
struct  _FcWlmetaClass
 
struct  worklist_data
 

Macros

#define FC_TYPE_WORKLIST_ROW   (fc_worklist_row_get_type())
 
#define FC_TYPE_WLMETA_ROW   (fc_wlmeta_row_get_type())
 

Enumerations

enum  { WORKLISTS_NEW , WORKLISTS_DELETE , WORKLISTS_PROPERTIES , WORKLISTS_CLOSE }
 

Functions

static void reset_global_worklist (GtkWidget *editor, struct global_worklist *pgwl)
 
static void popup_worklist (struct global_worklist *pgwl)
 
static void popdown_worklist (struct global_worklist *pgwl)
 
static void dst_row_callback_depr (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
 
static void fc_worklist_row_class_init (FcWorklistRowClass *klass)
 
static void fc_worklist_row_init (FcWorklistRow *self)
 
static void fc_wlmeta_row_class_init (FcWlmetaRowClass *klass)
 
static void fc_wlmeta_row_init (FcWlmetaRow *self)
 
static FcWlmetaRowfc_wlmeta_row_new (void)
 
void blank_max_unit_size (void)
 
static void update_max_unit_size (void)
 
static void worklists_destroy_callback (GtkWidget *w, gpointer data)
 
void update_worklist_report_dialog (void)
 
static void worklists_response (GtkWidget *w, gint response)
 
static void cell_edited (GtkEditable *self, gpointer data)
 
static void wlmeta_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void wlmeta_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static GtkWidgetcreate_worklists_report (void)
 
void popup_worklists_report (void)
 
static void commit_worklist (struct worklist_data *ptr)
 
void add_worklist_dnd_target (GtkWidget *w, gboolean(drag_drop_cb)(GtkDropTarget *target, const GValue *value, double x, double y, gpointer data), gpointer data)
 
static GtkWidgetget_worklist (int global_worklist_id)
 
static void insert_worklist (int global_worklist_id, GtkWidget *editor)
 
static void delete_worklist (int global_worklist_id)
 
static void worklist_destroy (GtkWidget *editor, gpointer data)
 
static void menu_item_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static GMenucreate_wl_menu (struct worklist_data *ptr)
 
static void wl_help_from_iter (GtkTreeModel *model, GtkTreeIter *it)
 
static void help_callback (GtkWidget *w, gpointer data)
 
static void change_callback (GtkWidget *w, gpointer data)
 
static void future_callback (GtkToggleButton *toggle, gpointer data)
 
static void queue_bubble_up (struct worklist_data *ptr)
 
static void queue_remove (struct worklist_data *ptr)
 
static void queue_bubble_down (struct worklist_data *ptr)
 
static void queue_insert (struct worklist_data *ptr, bool prepend)
 
static void queue_prepend (struct worklist_data *ptr)
 
static void queue_append (struct worklist_data *ptr)
 
static void src_row_callback_depr (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
 
static gboolean src_key_press_callback (GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer data)
 
static gboolean dst_key_press_callback (GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer data)
 
static void src_selection_callback_depr (GtkTreeSelection *selection, gpointer data)
 
static void dst_selection_callback_depr (GtkTreeSelection *selection, gpointer data)
 
static void cell_render_func (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *model, GtkTreeIter *it, gpointer data)
 
static void populate_view (GtkTreeView *view, struct city **ppcity, GtkTreeViewColumn **pcol)
 
static gboolean wl_right_button_up (GtkGestureClick *gesture, int n_press, double x, double y)
 
static gboolean drag_drop (GtkDropTarget *target, const GValue *value, double x, double y, gpointer data)
 
static void worklist_factory_bind (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
static void worklist_factory_setup (GtkSignalListItemFactory *self, GtkListItem *list_item, gpointer user_data)
 
GtkWidgetcreate_worklist (void)
 
static GdkContentProviderdrag_prepare (GtkDragSource *source, double x, double y, gpointer data)
 
static void drag_begin (GtkDragSource *source, GdkDrag *drag, gpointer *data)
 
void reset_city_worklist (GtkWidget *editor, struct city *pcity)
 
void refresh_worklist (GtkWidget *editor)
 

Variables

static GtkWidgetworklists_shell
 
static GListStoreworklists_store
 
static GtkSingleSelectionworklists_selection
 
static int max_unit_height = -1
 
static int max_unit_width = -1
 
static GHashTablehash
 

Macro Definition Documentation

◆ FC_TYPE_WLMETA_ROW

#define FC_TYPE_WLMETA_ROW   (fc_wlmeta_row_get_type())

Definition at line 96 of file wldlg.c.

◆ FC_TYPE_WORKLIST_ROW

#define FC_TYPE_WORKLIST_ROW   (fc_worklist_row_get_type())

Definition at line 76 of file wldlg.c.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
WORKLISTS_NEW 
WORKLISTS_DELETE 
WORKLISTS_PROPERTIES 
WORKLISTS_CLOSE 

Definition at line 57 of file wldlg.c.

Function Documentation

◆ add_worklist_dnd_target()

void add_worklist_dnd_target ( GtkWidget w,
gboolean(drag_drop_cb)(GtkDropTarget *target, const GValue *value, double x, double y, gpointer data)  ,
gpointer  data 
)

Add drag&drop target

Definition at line 425 of file wldlg.c.

◆ blank_max_unit_size()

void blank_max_unit_size ( void  )

Illegal initialization value for max unit size variables

Definition at line 176 of file wldlg.c.

◆ cell_edited()

static void cell_edited ( GtkEditable self,
gpointer  data 
)
static

Worklist cell edited

Definition at line 277 of file wldlg.c.

◆ cell_render_func()

static void cell_render_func ( GtkTreeViewColumn col,
GtkCellRenderer rend,
GtkTreeModel model,
GtkTreeIter it,
gpointer  data 
)
static

Render worklist cell

Definition at line 1051 of file wldlg.c.

◆ change_callback()

static void change_callback ( GtkWidget w,
gpointer  data 
)
static

"Change Production" clicked

Definition at line 682 of file wldlg.c.

◆ commit_worklist()

static void commit_worklist ( struct worklist_data ptr)
static

Commit worklist data to worklist

Definition at line 1754 of file wldlg.c.

◆ create_wl_menu()

static GMenu * create_wl_menu ( struct worklist_data ptr)
static

Open menu for adding items to worklist

Definition at line 582 of file wldlg.c.

◆ create_worklist()

GtkWidget * create_worklist ( void  )

Worklist editor shell.

Definition at line 1245 of file wldlg.c.

◆ create_worklists_report()

static GtkWidget * create_worklists_report ( void  )
static

Bring up the global worklist report.

Definition at line 322 of file wldlg.c.

◆ delete_worklist()

static void delete_worklist ( int  global_worklist_id)
static

Remove worklist from hash

Definition at line 469 of file wldlg.c.

◆ drag_begin()

static void drag_begin ( GtkDragSource source,
GdkDrag drag,
gpointer data 
)
static

Set drag icon

Definition at line 1523 of file wldlg.c.

◆ drag_drop()

static gboolean drag_drop ( GtkDropTarget target,
const GValue value,
double  x,
double  y,
gpointer  data 
)
static

Receive drag&drop

Definition at line 1198 of file wldlg.c.

◆ drag_prepare()

static GdkContentProvider * drag_prepare ( GtkDragSource source,
double  x,
double  y,
gpointer  data 
)
static

Prepare data for drag&drop

Definition at line 1497 of file wldlg.c.

◆ dst_key_press_callback()

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

Key press for destination

Definition at line 936 of file wldlg.c.

◆ dst_row_callback_depr()

static void dst_row_callback_depr ( GtkTreeView view,
GtkTreePath path,
GtkTreeViewColumn col,
gpointer  data 
)
static

Destination row activated

Definition at line 891 of file wldlg.c.

Referenced by create_worklist(), and queue_remove().

◆ dst_selection_callback_depr()

static void dst_selection_callback_depr ( GtkTreeSelection selection,
gpointer  data 
)
static

Selection from destination

Definition at line 1018 of file wldlg.c.

Referenced by create_worklist().

◆ fc_wlmeta_row_class_init()

static void fc_wlmeta_row_class_init ( FcWlmetaRowClass klass)
static

FcWorklistRow creation method Initialization method for FcWlmetaRow class

Definition at line 149 of file wldlg.c.

◆ fc_wlmeta_row_init()

static void fc_wlmeta_row_init ( FcWlmetaRow self)
static

Initialization method for FcWlmetaRow

Definition at line 157 of file wldlg.c.

◆ fc_wlmeta_row_new()

static FcWlmetaRow * fc_wlmeta_row_new ( void  )
static

FcWlmetaRow creation method

Definition at line 164 of file wldlg.c.

Referenced by update_worklist_report_dialog().

◆ fc_worklist_row_class_init()

static void fc_worklist_row_class_init ( FcWorklistRowClass klass)
static

Initialization method for FcWorklistRow class

Definition at line 119 of file wldlg.c.

◆ fc_worklist_row_init()

static void fc_worklist_row_init ( FcWorklistRow self)
static

Initialization method for FcWorklistRow

Definition at line 127 of file wldlg.c.

◆ future_callback()

static void future_callback ( GtkToggleButton toggle,
gpointer  data 
)
static

Showing of future targets toggled

Definition at line 705 of file wldlg.c.

◆ get_worklist()

static GtkWidget * get_worklist ( int  global_worklist_id)
static

Get worklist by id

Definition at line 443 of file wldlg.c.

◆ help_callback()

static void help_callback ( GtkWidget w,
gpointer  data 
)
static

Help button clicked

Definition at line 662 of file wldlg.c.

◆ insert_worklist()

static void insert_worklist ( int  global_worklist_id,
GtkWidget editor 
)
static

Insert worklist to editor

Definition at line 458 of file wldlg.c.

◆ menu_item_callback()

static void menu_item_callback ( GSimpleAction action,
GVariant parameter,
gpointer  data 
)
static

Item activated from menu

Definition at line 543 of file wldlg.c.

◆ popdown_worklist()

static void popdown_worklist ( struct global_worklist pgwl)
static

Close worklist

Definition at line 512 of file wldlg.c.

◆ populate_view()

static void populate_view ( GtkTreeView view,
struct city **  ppcity,
GtkTreeViewColumn **  pcol 
)
static

Populate view with buildable item information

Definition at line 1109 of file wldlg.c.

◆ popup_worklist()

static void popup_worklist ( struct global_worklist pgwl)
static

Worklist editor window used by the global worklist report.

Definition at line 479 of file wldlg.c.

◆ popup_worklists_report()

void popup_worklists_report ( void  )

Open worklists report

Definition at line 383 of file wldlg.c.

◆ queue_append()

static void queue_append ( struct worklist_data ptr)
static

Append item to worklist

Definition at line 849 of file wldlg.c.

◆ queue_bubble_down()

static void queue_bubble_down ( struct worklist_data ptr)
static

Move item down in queue

Definition at line 765 of file wldlg.c.

◆ queue_bubble_up()

static void queue_bubble_up ( struct worklist_data ptr)
static

Move item up in worklist

Definition at line 718 of file wldlg.c.

◆ queue_insert()

static void queue_insert ( struct worklist_data ptr,
bool  prepend 
)
static

Insert item to queue

Definition at line 796 of file wldlg.c.

◆ queue_prepend()

static void queue_prepend ( struct worklist_data ptr)
static

Prepend item to worklist

Definition at line 841 of file wldlg.c.

◆ queue_remove()

static void queue_remove ( struct worklist_data ptr)
static

Removal of the item requested

Definition at line 750 of file wldlg.c.

◆ refresh_worklist()

void refresh_worklist ( GtkWidget editor)

Refresh worklist info

Definition at line 1612 of file wldlg.c.

◆ reset_city_worklist()

void reset_city_worklist ( GtkWidget editor,
struct city pcity 
)

Reset worklist for city

Definition at line 1561 of file wldlg.c.

◆ reset_global_worklist()

static void reset_global_worklist ( GtkWidget editor,
struct global_worklist pgwl 
)
static

Reset one of the global worklists

Definition at line 1589 of file wldlg.c.

◆ src_key_press_callback()

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

Key press for source

Definition at line 910 of file wldlg.c.

◆ src_row_callback_depr()

static void src_row_callback_depr ( GtkTreeView view,
GtkTreePath path,
GtkTreeViewColumn col,
gpointer  data 
)
static

Source row activated

Definition at line 857 of file wldlg.c.

Referenced by create_worklist().

◆ src_selection_callback_depr()

static void src_selection_callback_depr ( GtkTreeSelection selection,
gpointer  data 
)
static

Selection from source

Definition at line 987 of file wldlg.c.

Referenced by create_worklist().

◆ update_max_unit_size()

static void update_max_unit_size ( void  )
static

Setup max unit sprite size.

Definition at line 185 of file wldlg.c.

◆ update_worklist_report_dialog()

void update_worklist_report_dialog ( void  )

Refresh worklists, both global and those of open city dialogs.

Definition at line 213 of file wldlg.c.

◆ wl_help_from_iter()

static void wl_help_from_iter ( GtkTreeModel model,
GtkTreeIter it 
)
static

Open help dialog for the cid pointed by iterator.

Definition at line 639 of file wldlg.c.

◆ wl_right_button_up()

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

Open help dialog for the worklist item.

Definition at line 1172 of file wldlg.c.

◆ wlmeta_factory_bind()

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

Wlmeta table cell bind function

Definition at line 294 of file wldlg.c.

Referenced by create_worklists_report().

◆ wlmeta_factory_setup()

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

Wlmeta table cell setup function

Definition at line 312 of file wldlg.c.

Referenced by create_worklists_report().

◆ worklist_destroy()

static void worklist_destroy ( GtkWidget editor,
gpointer  data 
)
static

Destroy worklist

Definition at line 527 of file wldlg.c.

◆ worklist_factory_bind()

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

Worklist table cell bind function

Definition at line 1220 of file wldlg.c.

Referenced by create_worklist().

◆ worklist_factory_setup()

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

Worklist table cell setup function

Definition at line 1235 of file wldlg.c.

Referenced by create_worklist().

◆ worklists_destroy_callback()

static void worklists_destroy_callback ( GtkWidget w,
gpointer  data 
)
static

Worklists dialog being destroyed

Definition at line 205 of file wldlg.c.

◆ worklists_response()

static void worklists_response ( GtkWidget w,
gint  response 
)
static

User has responded to worklist report

Definition at line 233 of file wldlg.c.

Variable Documentation

◆ hash

GHashTable* hash
static

Definition at line 418 of file wldlg.c.

◆ max_unit_height

int max_unit_height = -1
static

Definition at line 67 of file wldlg.c.

◆ max_unit_width

int max_unit_width = -1
static

Definition at line 67 of file wldlg.c.

◆ worklists_selection

GtkSingleSelection* worklists_selection
static

Definition at line 65 of file wldlg.c.

Referenced by create_worklists_report(), and worklists_response().

◆ worklists_shell

GtkWidget* worklists_shell
static

Definition at line 55 of file wldlg.c.

◆ worklists_store

GListStore* worklists_store
static

Definition at line 64 of file wldlg.c.