Freeciv-3.1
Loading...
Searching...
No Matches
Data Structures | 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  worklist_data
 

Enumerations

enum  { WORKLISTS_NEW , WORKLISTS_DELETE , WORKLISTS_PROPERTIES , WORKLISTS_CLOSE }
 
enum  { TARGET_GTK_TREE_MODEL_ROW }
 

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 (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
 
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 (GtkCellRendererText *cell, const gchar *spath, const gchar *text, gpointer data)
 
static GtkWidget * create_worklists_report (void)
 
void popup_worklists_report (void)
 
static void commit_worklist (struct worklist_data *ptr)
 
void add_worklist_dnd_target (GtkWidget *w)
 
static GtkWidget * get_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 (GtkMenuItem *item, struct worklist_data *ptr)
 
static void popup_add_menu (GtkMenuShell *menu, gpointer data)
 
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 (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
 
static gboolean src_key_press_callback (GtkWidget *w, GdkEventKey *ev, gpointer data)
 
static gboolean dst_key_press_callback (GtkWidget *w, GdkEventKey *ev, gpointer data)
 
static void src_selection_callback (GtkTreeSelection *selection, gpointer data)
 
static void dst_selection_callback (GtkTreeSelection *selection, gpointer data)
 
static gboolean dst_dnd_callback (GtkWidget *w, GdkDragContext *context, struct worklist_data *ptr)
 
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)
 
GtkWidget * create_worklist (void)
 
void reset_city_worklist (GtkWidget *editor, struct city *pcity)
 
void refresh_worklist (GtkWidget *editor)
 

Variables

static GtkWidget * worklists_shell
 
static GtkWidget * worklists_list
 
static GtkListStore * worklists_store
 
static int max_unit_height = -1
 
static int max_unit_width = -1
 
static GHashTable * hash
 
static GtkTargetEntry wl_dnd_targets []
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WORKLISTS_NEW 
WORKLISTS_DELETE 
WORKLISTS_PROPERTIES 
WORKLISTS_CLOSE 

Definition at line 58 of file wldlg.c.

◆ anonymous enum

anonymous enum
Enumerator
TARGET_GTK_TREE_MODEL_ROW 

Definition at line 326 of file wldlg.c.

Function Documentation

◆ add_worklist_dnd_target()

void add_worklist_dnd_target ( GtkWidget *  w)

Add drag&drop target

Definition at line 338 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 79 of file wldlg.c.

◆ cell_edited()

static void cell_edited ( GtkCellRendererText *  cell,
const gchar *  spath,
const gchar *  text,
gpointer  data 
)
static

Worklist cell edited

Definition at line 184 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 933 of file wldlg.c.

◆ change_callback()

static void change_callback ( GtkWidget *  w,
gpointer  data 
)
static

"Change Production" clicked

Definition at line 555 of file wldlg.c.

◆ commit_worklist()

static void commit_worklist ( struct worklist_data ptr)
static

Commit worklist data to worklist

Definition at line 1468 of file wldlg.c.

◆ create_worklist()

GtkWidget * create_worklist ( void  )

Worklist editor shell.

Definition at line 1052 of file wldlg.c.

◆ create_worklists_report()

static GtkWidget * create_worklists_report ( void  )
static

Bring up the global worklist report.

Definition at line 212 of file wldlg.c.

◆ delete_worklist()

static void delete_worklist ( int  global_worklist_id)
static

Remove worklist from hash

Definition at line 374 of file wldlg.c.

◆ dst_dnd_callback()

static gboolean dst_dnd_callback ( GtkWidget *  w,
GdkDragContext *  context,
struct worklist_data ptr 
)
static

Drag&drop to destination

Definition at line 923 of file wldlg.c.

◆ dst_key_press_callback()

static gboolean dst_key_press_callback ( GtkWidget *  w,
GdkEventKey *  ev,
gpointer  data 
)
static

Key press for destination

Definition at line 809 of file wldlg.c.

◆ dst_row_callback()

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

Destination row activated

Definition at line 765 of file wldlg.c.

◆ dst_selection_callback()

static void dst_selection_callback ( GtkTreeSelection *  selection,
gpointer  data 
)
static

Selection from destination

Definition at line 890 of file wldlg.c.

◆ future_callback()

static void future_callback ( GtkToggleButton *  toggle,
gpointer  data 
)
static

Showing of future targets toggled

Definition at line 578 of file wldlg.c.

◆ get_worklist()

static GtkWidget * get_worklist ( int  global_worklist_id)
static

Get worklist by id

Definition at line 348 of file wldlg.c.

◆ help_callback()

static void help_callback ( GtkWidget *  w,
gpointer  data 
)
static

Help button clicked

Definition at line 520 of file wldlg.c.

◆ insert_worklist()

static void insert_worklist ( int  global_worklist_id,
GtkWidget *  editor 
)
static

Insert worklist to editor

Definition at line 363 of file wldlg.c.

◆ menu_item_callback()

static void menu_item_callback ( GtkMenuItem *  item,
struct worklist_data ptr 
)
static

Item activated from menu

Definition at line 450 of file wldlg.c.

◆ popdown_worklist()

static void popdown_worklist ( struct global_worklist pgwl)
static

Close worklist

Definition at line 419 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 990 of file wldlg.c.

◆ popup_add_menu()

static void popup_add_menu ( GtkMenuShell *  menu,
gpointer  data 
)
static

Open menu for adding items to worklist

Definition at line 486 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 384 of file wldlg.c.

◆ popup_worklists_report()

void popup_worklists_report ( void  )

Open worklists report

Definition at line 286 of file wldlg.c.

◆ queue_append()

static void queue_append ( struct worklist_data ptr)
static

Append item to worklist

Definition at line 723 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 638 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 591 of file wldlg.c.

◆ queue_insert()

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

Insert item to queue

Definition at line 669 of file wldlg.c.

◆ queue_prepend()

static void queue_prepend ( struct worklist_data ptr)
static

Prepend item to worklist

Definition at line 715 of file wldlg.c.

◆ queue_remove()

static void queue_remove ( struct worklist_data ptr)
static

Removal of the item requested

Definition at line 623 of file wldlg.c.

◆ refresh_worklist()

void refresh_worklist ( GtkWidget *  editor)

Refresh worklist info

Definition at line 1325 of file wldlg.c.

◆ reset_city_worklist()

void reset_city_worklist ( GtkWidget *  editor,
struct city pcity 
)

Reset worklist for city

Definition at line 1277 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 1302 of file wldlg.c.

◆ src_key_press_callback()

static gboolean src_key_press_callback ( GtkWidget *  w,
GdkEventKey *  ev,
gpointer  data 
)
static

Key press for source

Definition at line 784 of file wldlg.c.

◆ src_row_callback()

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

Source row activated

Definition at line 731 of file wldlg.c.

◆ src_selection_callback()

static void src_selection_callback ( GtkTreeSelection *  selection,
gpointer  data 
)
static

Selection from source

Definition at line 859 of file wldlg.c.

◆ update_max_unit_size()

static void update_max_unit_size ( void  )
static

Setup max unit sprite size.

Definition at line 88 of file wldlg.c.

◆ update_worklist_report_dialog()

void update_worklist_report_dialog ( void  )

Refresh global worklists list

Definition at line 115 of file wldlg.c.

◆ worklist_destroy()

static void worklist_destroy ( GtkWidget *  editor,
gpointer  data 
)
static

Destroy worklist

Definition at line 434 of file wldlg.c.

◆ worklists_destroy_callback()

static void worklists_destroy_callback ( GtkWidget *  w,
gpointer  data 
)
static

Worklists dialog being destroyed

Definition at line 107 of file wldlg.c.

◆ worklists_response()

static void worklists_response ( GtkWidget *  w,
gint  response 
)
static

User has responded to worklist report

Definition at line 133 of file wldlg.c.

Variable Documentation

◆ hash

GHashTable* hash
static

Definition at line 321 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.

◆ wl_dnd_targets

GtkTargetEntry wl_dnd_targets[]
static
Initial value:
= {
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_APP, TARGET_GTK_TREE_MODEL_ROW },
}
@ TARGET_GTK_TREE_MODEL_ROW
Definition wldlg.c:326

Definition at line 330 of file wldlg.c.

◆ worklists_list

GtkWidget* worklists_list
static

Definition at line 56 of file wldlg.c.

◆ worklists_shell

GtkWidget* worklists_shell
static

Definition at line 55 of file wldlg.c.

◆ worklists_store

GtkListStore* worklists_store
static

Definition at line 65 of file wldlg.c.