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

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions | Variables
messagewin.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <gtk/gtk.h>`
`#include "fcintl.h"`
`#include "log.h"`
`#include "events.h"`
`#include "game.h"`
`#include "map.h"`
`#include "player.h"`
`#include "options.h"`
`#include "chatline.h"`
`#include "citydlg.h"`
`#include "gui_main.h"`
`#include "gui_stuff.h"`
`#include "mapview.h"`
`#include "messagewin.h"`

Go to the source code of this file.

## Data Structures

struct | meswin_dialog

## Enumerations

enum | meswin_columns { MESWIN_COL_ICON , MESWIN_COL_MESSAGE , MESWIN_COL_WEIGHT , MESWIN_COL_STYLE , MESWIN_COL_ID , MESWIN_COL_NUM }
enum | meswin_responses { MESWIN_RES_GOTO = 1 , MESWIN_RES_POPUP_CITY }

## Functions

static GtkListStore * | meswin_dialog_store_new (void)
static void | meswin_dialog_visited_get_attr (bool visited, gint *weight, gint *style)
static void | meswin_dialog_set_visited (GtkTreeModel *model, GtkTreeIter *iter, bool visited)
static void | meswin_dialog_refresh (struct meswin_dialog *pdialog)
static void | meswin_dialog_selection_callback (GtkTreeSelection *selection, gpointer data)
static void | meswin_dialog_row_activated_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
static gboolean | meswin_dialog_button_press_callback (GtkWidget *widget, GdkEventButton *ev, gpointer data)
static void | meswin_dialog_response_callback (struct gui_dialog *pgui_dialog, int response, gpointer data)
static void | meswin_dialog_init (struct meswin_dialog *pdialog)
static void | meswin_dialog_free (struct meswin_dialog *pdialog)
void | meswin_dialog_popup (bool raise)
void | meswin_dialog_popdown (void)
bool | meswin_dialog_is_open (void)
void | real_meswin_dialog_update (void *unused)

## Variables

static struct meswin_dialog | meswin = { NULL, }

## Enumeration Type Documentation

## ◆ meswin_columns

enum meswin_columns

Enumerator
MESWIN_COL_ICON |
MESWIN_COL_MESSAGE |
MESWIN_COL_WEIGHT |
MESWIN_COL_STYLE |
MESWIN_COL_ID |
MESWIN_COL_NUM |

Definition at line 53 of file messagewin.c.

## ◆ meswin_responses

enum meswin_responses

Enumerator
MESWIN_RES_GOTO |
MESWIN_RES_POPUP_CITY |

Definition at line 65 of file messagewin.c.

## Function Documentation

## ◆ meswin_dialog_button_press_callback()

static gboolean meswin_dialog_button_press_callback | ( | GtkWidget * | widget,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Mouse button press handler for the message window treeview. We only care about right clicks on a row; this action centers on the tile associated with the event at that row (if applicable).

Definition at line 247 of file messagewin.c.

Referenced by meswin_dialog_init().

## ◆ meswin_dialog_free()

static void meswin_dialog_free | ( | struct meswin_dialog * | pdialog | ) |

static

Closes a message window dialog.

Definition at line 404 of file messagewin.c.

Referenced by meswin_dialog_popdown().

## ◆ meswin_dialog_init()

static void meswin_dialog_init | ( | struct meswin_dialog * | pdialog | ) |

static

Initilialize a message window dialog.

Definition at line 319 of file messagewin.c.

Referenced by meswin_dialog_popup().

## ◆ meswin_dialog_is_open()

bool meswin_dialog_is_open | ( | void |  | ) |

Return TRUE iff the message window is open.

Definition at line 443 of file messagewin.c.

Referenced by main_key_down_handler(), meswin_dialog_update(), popup_optiondlg(), and toggle_msg_window_callback().

## ◆ meswin_dialog_popdown()

void meswin_dialog_popdown | ( | void |  | ) |

Closes the message window dialog.

Definition at line 432 of file messagewin.c.

Referenced by main_key_down_handler(), popdown_all_game_dialogs(), popup_conn_list_dialog(), popup_connection_dialog(), toggle_msg_window_callback(), and ui_main().

## ◆ meswin_dialog_popup()

void meswin_dialog_popup | ( | bool | raise | ) |

Popup the dialog inside the main-window, and optionally raise it.

Definition at line 417 of file messagewin.c.

Referenced by exit_meta_server_dlg_callback(), main_key_down_handler(), meswin_dialog_update(), popdown_optiondlg(), popup_connection_dialog(), real_meswin_dialog_update(), report_messages_callback(), report_messages_callback(), setup_widgets(), show_main_page(), and toggle_msg_window_callback().

## ◆ meswin_dialog_refresh()

static void meswin_dialog_refresh | ( | struct meswin_dialog * | pdialog | ) |

static

Refresh a message window dialog.

Definition at line 119 of file messagewin.c.

Referenced by meswin_dialog_init(), and real_meswin_dialog_update().

## ◆ meswin_dialog_response_callback()

static void meswin_dialog_response_callback | ( | struct gui_dialog * | pgui_dialog,
|  | int | response,
|  | gpointer | data
| ) |  |

static

Dialog response callback.

Definition at line 280 of file messagewin.c.

Referenced by meswin_dialog_init().

## ◆ meswin_dialog_row_activated_callback()

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

static

A row has been activated by the user.

Definition at line 221 of file messagewin.c.

Referenced by meswin_dialog_init().

## ◆ meswin_dialog_selection_callback()

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

static

Selection changed callback.

Definition at line 196 of file messagewin.c.

Referenced by meswin_dialog_init().

## ◆ meswin_dialog_set_visited()

static void meswin_dialog_set_visited | ( | GtkTreeModel * | model,
|  | GtkTreeIter * | iter,
|  | bool | visited
| ) |  |

static

Set the visited state of the store.

Definition at line 102 of file messagewin.c.

Referenced by meswin_dialog_response_callback(), and meswin_dialog_row_activated_callback().

## ◆ meswin_dialog_store_new()

static GtkListStore * meswin_dialog_store_new | ( | void |  | ) |

static

Create a tree model for the message window.

Definition at line 75 of file messagewin.c.

Referenced by meswin_dialog_init().

## ◆ meswin_dialog_visited_get_attr()

static void meswin_dialog_visited_get_attr | ( | bool | visited,
|  | gint * | weight,
|  | gint * | style
| ) |  |

static

Get the pango attributes for the visited state.

Definition at line 88 of file messagewin.c.

Referenced by meswin_dialog_refresh(), and meswin_dialog_set_visited().

## ◆ real_meswin_dialog_update()

void real_meswin_dialog_update | ( | void * | unused | ) |

Update the message window dialog.

Definition at line 451 of file messagewin.c.

Referenced by meswin_dialog_popup(), and meswin_dialog_update().

## Variable Documentation

## ◆ meswin

struct meswin_dialog meswin = { NULL, }

static

Definition at line 70 of file messagewin.c.

Referenced by meswin_dialog_is_open(), meswin_dialog_popdown(), meswin_dialog_popup(), and real_meswin_dialog_update().