Freeciv-3.3
|
#include <stdarg.h>
#include <stdio.h>
#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 "options.h"
#include "colors.h"
#include "gui_main.h"
#include "gui_stuff.h"
Go to the source code of this file.
Data Structures | |
struct | blocking_dialog_data |
Variables | |
static GList * | dialog_list |
static GtkSizeGroup * | gui_action |
static GtkCssProvider * | dlg_tab_provider = NULL |
Called when a dialog button is activated.
Definition at line 637 of file gui_stuff.c.
GtkTreeViewColumn * add_treeview_column | ( | GtkWidget * | view, |
const char * | title, | ||
GType | gtype, | ||
int | model_index | ||
) |
Convenience function to add a column to a GtkTreeView. Returns the added column, or NULL if an error occurred.
Definition at line 1051 of file gui_stuff.c.
Create an auxiliary menubar (i.e., not the main menubar at the top of the window).
Definition at line 244 of file gui_stuff.c.
Referenced by create_city_report_menu(), create_diplomacy_dialog(), create_players_dialog(), and create_worklist().
Present a blocking dialog and wait for response
Definition at line 1136 of file gui_stuff.c.
Referenced by confirm_cancel_pact(), economy_report_command_callback(), popup_disband_dialog(), popup_musicset_suggestion_dialog(), popup_soundset_suggestion_dialog(), popup_theme_suggestion_dialog(), popup_tileset_suggestion_dialog(), popup_upgrade_dialog(), select_impr_or_unit_callback(), show_tileset_error(), tool_value_selector_run(), try_to_set_editor_tool(), and units_report_command_callback().
Received a response to a blocking dialog
Definition at line 1124 of file gui_stuff.c.
Referenced by blocking_dialog().
|
static |
Someone has clicked on a label in a notebook
Definition at line 471 of file gui_stuff.c.
Generic close callback for all dialogs
Definition at line 254 of file gui_stuff.c.
Temporarily disable signal invocation of the given callback for the given GObject. Re-enable the signal with enable_gobject_callback.
Definition at line 1018 of file gui_stuff.c.
Prepare dialog tab style provider.
Definition at line 1083 of file gui_stuff.c.
Re-enable a signal callback blocked by disable_gobject_callback.
Definition at line 1034 of file gui_stuff.c.
Draw widget now
Definition at line 52 of file gui_stuff.c.
Changes the label (with mnemonic) on an existing stockbutton. See gtk_stockbutton_new().
Definition at line 85 of file gui_stuff.c.
gint gtk_tree_selection_get_row | ( | GtkTreeSelection * | selection | ) |
Return the selected row in a GtkTreeSelection. If no row is selected return -1.
Definition at line 203 of file gui_stuff.c.
void gtk_tree_view_focus | ( | GtkTreeView * | view | ) |
Give focus to view
Definition at line 225 of file gui_stuff.c.
GtkWidget * gui_dialog_add_action_widget | ( | struct gui_dialog * | dlg, |
GtkWidget * | widget | ||
) |
Adds a widget to a dialog.
Definition at line 690 of file gui_stuff.c.
Referenced by create_city_report_dialog(), create_players_dialog(), and gui_dialog_pack_button().
GtkWidget * gui_dialog_add_button | ( | struct gui_dialog * | dlg, |
const char * | icon_name, | ||
const char * | text, | ||
int | response | ||
) |
Adds a button to a dialog.
Definition at line 675 of file gui_stuff.c.
void gui_dialog_add_content_widget | ( | struct gui_dialog * | dlg, |
GtkWidget * | wdg | ||
) |
Add widget to the gui_dialog grid
Definition at line 1105 of file gui_stuff.c.
Referenced by create_city_report_dialog(), create_diplomacy_dialog(), create_messageopt_dialog(), create_players_dialog(), create_spaceship_dialog(), diplomacy_main_create(), economy_report_init(), endgame_report_init(), gui_dialog_new(), luaconsole_dialog_create(), meswin_dialog_init(), popup_find_dialog(), popup_notify_dialog(), science_report_init(), and units_report_init().
void gui_dialog_alert | ( | struct gui_dialog * | dlg | ) |
Alert the user to an important event.
Definition at line 819 of file gui_stuff.c.
Emit a delete event response on dialog deletion in case the end-user needs to know when a deletion took place. Popup dialog version
Definition at line 351 of file gui_stuff.c.
|
static |
Emit a delete event response on dialog deletion in case the end-user needs to know when a deletion took place. TAB version
Definition at line 367 of file gui_stuff.c.
void gui_dialog_destroy | ( | struct gui_dialog * | dlg | ) |
Destroy a dialog.
Definition at line 882 of file gui_stuff.c.
Destroy all dialogs.
Definition at line 902 of file gui_stuff.c.
|
static |
Cleanups the leftovers after a dialog is destroyed.
Definition at line 308 of file gui_stuff.c.
Default dialog response handler. Destroys the dialog.
Definition at line 299 of file gui_stuff.c.
|
static |
Changes a tab into a window.
Definition at line 428 of file gui_stuff.c.
GtkWidget * gui_dialog_get_toplevel | ( | struct gui_dialog * | dlg | ) |
Get the dialog's toplevel window.
Definition at line 725 of file gui_stuff.c.
|
static |
Allow the user to close a dialog using Escape or CTRL+W.
Definition at line 390 of file gui_stuff.c.
void gui_dialog_new | ( | struct gui_dialog ** | pdlg, |
GtkNotebook * | notebook, | ||
gpointer | user_data, | ||
bool | check_top | ||
) |
Creates a new dialog. It will be a tab or a window depending on the current user setting of 'enable_tabs' gtk-gui option. Sets pdlg to point to the dialog once it is create, Zeroes pdlg on dialog destruction. user_data will be passed through response function check_top indicates if the layout decision should depend on the parent.
Definition at line 490 of file gui_stuff.c.
|
static |
Places a button into a dialog, taking care of setting up signals, etc.
Definition at line 650 of file gui_stuff.c.
void gui_dialog_present | ( | struct gui_dialog * | dlg | ) |
Notify the user the dialog has changed.
Definition at line 769 of file gui_stuff.c.
void gui_dialog_raise | ( | struct gui_dialog * | dlg | ) |
Raise dialog to top.
Definition at line 796 of file gui_stuff.c.
|
static |
Emit a dialog response.
Definition at line 289 of file gui_stuff.c.
void gui_dialog_response_set_callback | ( | struct gui_dialog * | dlg, |
GUI_DIALOG_RESPONSE_FUN | fun | ||
) |
Set the response callback for a dialog.
Definition at line 916 of file gui_stuff.c.
void gui_dialog_set_default_size | ( | struct gui_dialog * | dlg, |
int | width, | ||
int | height | ||
) |
Sets the dialog's default size (applies to toplevel windows only).
Definition at line 847 of file gui_stuff.c.
void gui_dialog_set_response_sensitive | ( | struct gui_dialog * | dlg, |
int | response, | ||
bool | setting | ||
) |
Change the sensitivity of a dialog button.
Definition at line 703 of file gui_stuff.c.
void gui_dialog_set_return_dialog | ( | struct gui_dialog * | dlg, |
struct gui_dialog * | return_dialog | ||
) |
When the dlg dialog is destroyed the return_dialog will be raised
Definition at line 925 of file gui_stuff.c.
void gui_dialog_set_title | ( | struct gui_dialog * | dlg, |
const char * | title | ||
) |
Changes a dialog's title.
Definition at line 863 of file gui_stuff.c.
void gui_dialog_show_all | ( | struct gui_dialog * | dlg | ) |
Show the dialog contents, but not the dialog per se.
Definition at line 733 of file gui_stuff.c.
|
static |
Resets tab colour on tab activation.
Definition at line 410 of file gui_stuff.c.
Updates a gui font style.
Definition at line 938 of file gui_stuff.c.
void gui_update_font_full | ( | const char * | font_name, |
const char * | font_value, | ||
PangoFontDescription ** | font_desc | ||
) |
Update a font option which is not attached to a widget.
Definition at line 1001 of file gui_stuff.c.
Create new icon button with label.
Current implementation sets either icon or label, preferring label, never both. Caller should not rely on that, though.
Definition at line 63 of file gui_stuff.c.
Returns gettext-converted list of n strings. The individual strings in the list are as returned by gettext(). In case of no NLS, the strings will be the original strings, so caller should ensure that the originals persist for as long as required. (For no NLS, still allocate the list, for consistency.)
(This is not directly gui/gtk related, but it fits in here because so far it is used for doing i18n for gtk titles...)
Definition at line 100 of file gui_stuff.c.
void itree_begin | ( | GtkTreeModel * | model, |
ITree * | it | ||
) |
Set itree to the beginning
Definition at line 116 of file gui_stuff.c.
Return whether itree end has been reached
Definition at line 125 of file gui_stuff.c.
Get values from itree
Definition at line 153 of file gui_stuff.c.
gboolean itree_is_selected | ( | GtkTreeSelection * | selection, |
ITree * | it | ||
) |
Return whether current itree item is selected
Definition at line 178 of file gui_stuff.c.
Make itree to go forward one step
Definition at line 133 of file gui_stuff.c.
void itree_select | ( | GtkTreeSelection * | selection, |
ITree * | it | ||
) |
Add current itree item to selection
Definition at line 186 of file gui_stuff.c.
Store values to itree
Definition at line 141 of file gui_stuff.c.
void itree_unselect | ( | GtkTreeSelection * | selection, |
ITree * | it | ||
) |
Remove current itree item from selection
Definition at line 194 of file gui_stuff.c.
This function handles new windows which are subwindows to the toplevel window. It must be called on every dialog in the game, so fullscreen windows are handled properly by the window manager.
Definition at line 264 of file gui_stuff.c.
void tstore_append | ( | GtkTreeStore * | store, |
ITree * | it, | ||
ITree * | parent | ||
) |
Append one item to the end of tree store
Definition at line 165 of file gui_stuff.c.
Nullify GtkWidget pointer when widget is destroyed
Definition at line 1155 of file gui_stuff.c.
Referenced by create_goto_dialog(), create_multiplier_dialog(), create_races_dialog(), create_rates_dialog(), luaconsole_dialog_create(), popup_quit_dialog(), popup_revolution_dialog(), save_game_dialog_popup(), save_mapimg_dialog_popup(), and save_scenario_dialog_popup().
Get child widget for a widget whose own type is not known (without further GTK_IS_...() checks) in the caller side.
Definition at line 1164 of file gui_stuff.c.
|
static |
Definition at line 42 of file gui_stuff.c.
|
static |
Definition at line 46 of file gui_stuff.c.
|
static |
Definition at line 44 of file gui_stuff.c.