Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-gtk-4.0/wldlg.c File Reference

Freeciv-3.2

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 }

## 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, gboolean(drag_drop_cb)(GtkDropTarget *target, const GValue *value, double x, double y, gpointer data), gpointer data)
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 (GSimpleAction *action, GVariant *parameter, gpointer data)
static GMenu * | create_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 (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 (GtkTreeSelection *selection, gpointer data)
static void | dst_selection_callback (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)
GtkWidget * | create_worklist (void)
static GdkContentProvider * | drag_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 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

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
WORKLISTS_NEW |
WORKLISTS_DELETE |
WORKLISTS_PROPERTIES |
WORKLISTS_CLOSE |

Definition at line 58 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 329 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 187 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 955 of file wldlg.c.

## ◆ change_callback()

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

static

"Change Production" clicked

Definition at line 586 of file wldlg.c.

## ◆ commit_worklist()

static void commit_worklist | ( | struct worklist_data * | ptr | ) |

static

Commit worklist data to worklist

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

Referenced by create_worklist(), and refresh_worklist().

## ◆ create_worklist()

GtkWidget * create_worklist | ( | void |  | ) |

Worklist editor shell.

Definition at line 1124 of file wldlg.c.

## ◆ create_worklists_report()

static GtkWidget * create_worklists_report | ( | void |  | ) |

static

Bring up the global worklist report.

Definition at line 217 of file wldlg.c.

## ◆ delete_worklist()

static void delete_worklist | ( | int | global_worklist_id | ) |

static

Remove worklist from hash

Definition at line 373 of file wldlg.c.

## ◆ drag_begin()

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

static

Set drag icon

Definition at line 1395 of file wldlg.c.

Referenced by reset_city_worklist().

## ◆ drag_drop()

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

static

Receive drag&drop

Definition at line 1102 of file wldlg.c.

Referenced by create_worklist().

## ◆ drag_prepare()

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

static

Prepare data for drag&drop

Definition at line 1369 of file wldlg.c.

Referenced by reset_city_worklist().

## ◆ 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 840 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 795 of file wldlg.c.

## ◆ dst_selection_callback()

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

static

Selection from destination

Definition at line 922 of file wldlg.c.

## ◆ future_callback()

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

static

Showing of future targets toggled

Definition at line 609 of file wldlg.c.

## ◆ get_worklist()

static GtkWidget * get_worklist | ( | int | global_worklist_id | ) |

static

Get worklist by id

Definition at line 347 of file wldlg.c.

## ◆ help_callback()

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

static

Help button clicked

Definition at line 566 of file wldlg.c.

## ◆ insert_worklist()

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

static

Insert worklist to editor

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

## ◆ popdown_worklist()

static void popdown_worklist | ( | struct global_worklist * | pgwl | ) |

static

Close worklist

Definition at line 416 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 1013 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 383 of file wldlg.c.

## ◆ popup_worklists_report()

void popup_worklists_report | ( | void |  | ) |

Open worklists report

Definition at line 287 of file wldlg.c.

## ◆ queue_append()

static void queue_append | ( | struct worklist_data * | ptr | ) |

static

Append item to worklist

Definition at line 753 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 669 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 622 of file wldlg.c.

## ◆ queue_insert()

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

static

Insert item to queue

Definition at line 700 of file wldlg.c.

## ◆ queue_prepend()

static void queue_prepend | ( | struct worklist_data * | ptr | ) |

static

Prepend item to worklist

Definition at line 745 of file wldlg.c.

## ◆ queue_remove()

static void queue_remove | ( | struct worklist_data * | ptr | ) |

static

Removal of the item requested

Definition at line 654 of file wldlg.c.

## ◆ refresh_worklist()

void refresh_worklist | ( | GtkWidget * | editor | ) |

Refresh worklist info

Definition at line 1484 of file wldlg.c.

## ◆ reset_city_worklist()

void reset_city_worklist | ( | GtkWidget * | editor,
|  | struct city * | pcity
| ) |  |

Reset worklist for city

Definition at line 1433 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 1461 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 814 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 761 of file wldlg.c.

## ◆ src_selection_callback()

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

static

Selection from source

Definition at line 891 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 worklists, both global and those of open city dialogs.

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

Referenced by help_callback(), and wl_right_button_up().

## ◆ 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 1076 of file wldlg.c.

Referenced by create_worklist().

## ◆ worklist_destroy()

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

static

Destroy worklist

Definition at line 431 of file wldlg.c.

## ◆ worklists_destroy_callback()

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

static

Worklists dialog being destroyed

Definition at line 108 of file wldlg.c.

## ◆ worklists_response()

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

static

User has responded to worklist report

Definition at line 136 of file wldlg.c.

## Variable Documentation

## ◆ hash

GHashTable* hash

static

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