Freeciv-3.3
|
Go to the source code of this file.
Enqueue a callback to be called during an idle moment. The 'callback' function should be called sometimes soon, and passed the 'data' pointer as its data.
Definition at line 370 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Wait for data on the given socket. Call input_from_server() when data is ready to be read.
This function is called after the client has successfully connected to the server.
Definition at line 306 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_copy | ( | struct canvas * | dest, |
struct canvas * | src, | ||
int | src_x, | ||
int | src_y, | ||
int | dest_x, | ||
int | dest_y, | ||
int | width, | ||
int | height | ||
) |
Copies an area from the source canvas to the destination canvas.
Definition at line 79 of file canvas.cpp.
Referenced by city_map::set_pixmap(), and setup_gui_funcs().
Create a canvas of the given size.
Definition at line 36 of file canvas.cpp.
Referenced by city_map::city_map(), units_select::create_pixmap(), impr_item::enterEvent(), impr_item::impr_item(), hud_unit_combat::init_images(), impr_item::leaveEvent(), choice_dialog::next_unit(), choice_dialog::prev_unit(), research_diagram::reset(), choice_dialog::set_layout(), city_map::set_pixmap(), help_widget::set_topic_extra(), help_widget::set_topic_unit(), setup_gui_funcs(), ss_report::ss_report(), terrain_canvas(), unit_item::unit_item(), and hud_units::update_actions().
void qtg_canvas_fill_sprite_area | ( | struct canvas * | pcanvas, |
struct sprite * | psprite, | ||
struct color * | pcolor, | ||
int | canvas_x, | ||
int | canvas_y | ||
) |
Fill the area covered by the sprite with the given color.
Definition at line 234 of file canvas.cpp.
Referenced by setup_gui_funcs().
Free any resources associated with this canvas and the canvas struct itself.
Definition at line 48 of file canvas.cpp.
Referenced by units_select::create_pixmap(), choice_dialog::next_unit(), choice_dialog::prev_unit(), choice_dialog::set_layout(), city_map::set_pixmap(), help_widget::set_topic_extra(), help_widget::set_topic_terrain(), help_widget::set_topic_unit(), setup_gui_funcs(), hud_units::update_actions(), city_map::~city_map(), and ss_report::~ss_report().
Initialize canvas as mapview.
Definition at line 72 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_curved_line | ( | struct canvas * | pcanvas, |
struct color * | pcolor, | ||
enum line_type | ltype, | ||
int | start_x, | ||
int | start_y, | ||
int | dx, | ||
int | dy | ||
) |
Draw a 1-pixel-width colored curved line onto the canvas.
Definition at line 286 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_line | ( | struct canvas * | pcanvas, |
struct color * | pcolor, | ||
enum line_type | ltype, | ||
int | start_x, | ||
int | start_y, | ||
int | dx, | ||
int | dy | ||
) |
Draw a 1-pixel-width colored line onto the canvas.
Definition at line 247 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_rectangle | ( | struct canvas * | pcanvas, |
struct color * | pcolor, | ||
int | canvas_x, | ||
int | canvas_y, | ||
int | width, | ||
int | height | ||
) |
Draw a filled-in colored rectangle onto canvas.
Definition at line 205 of file canvas.cpp.
Referenced by qtg_canvas_fill_sprite_area(), and setup_gui_funcs().
void qtg_canvas_put_sprite | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | sprite, | ||
int | offset_x, | ||
int | offset_y, | ||
int | width, | ||
int | height | ||
) |
Draw some or all of a sprite onto the canvas.
Definition at line 139 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_sprite_fogged | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | psprite, | ||
bool | fog, | ||
int | fog_x, | ||
int | fog_y | ||
) |
Draw a full sprite onto the canvas. If "fog" is specified draw it with fog.
Definition at line 188 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_sprite_full | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
struct sprite * | sprite | ||
) |
Draw a full sprite onto the canvas.
Definition at line 154 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_sprite_full_scaled | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
int | canvas_w, | ||
int | canvas_h, | ||
struct sprite * | sprite | ||
) |
Draw a full sprite onto the canvas, scaled to the canvas size.
Definition at line 168 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_put_text | ( | struct canvas * | pcanvas, |
int | canvas_x, | ||
int | canvas_y, | ||
enum client_font | font, | ||
struct color * | pcolor, | ||
const char * | text | ||
) |
Draw the text onto the canvas in the given color and font. The canvas position does not account for the ascent of the text; this function must take care of this manually. The text will not be nullptr but may be empty.
Definition at line 354 of file canvas.cpp.
Referenced by setup_gui_funcs().
Set canvas zoom for future drawing operations.
Definition at line 56 of file canvas.cpp.
Referenced by setup_gui_funcs().
Return whether the dialog for the given city is open.
Definition at line 3927 of file citydlg.cpp.
Referenced by qtg_real_city_dialog_refresh(), and setup_gui_funcs().
void qtg_close_connection_dialog | ( | ) |
Close and destroy the dialog. But only if we don't have a local server running (that we started).
Definition at line 39 of file connectdlg.cpp.
Referenced by setup_gui_funcs().
Allocate a color (adjusting it for our colormap if necessary on paletted systems) and return a pointer to it.
Definition at line 33 of file colors.cpp.
Referenced by setup_gui_funcs().
Free a previously allocated color. See qtg_color_alloc.
Definition at line 45 of file colors.cpp.
Referenced by setup_gui_funcs().
Create a new sprite with the given height, width and color.
Definition at line 181 of file sprite.cpp.
Referenced by city_production_delegate::paint(), and setup_gui_funcs().
struct sprite * qtg_crop_sprite | ( | struct sprite * | source, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
struct sprite * | mask, | ||
int | mask_offset_x, | ||
int | mask_offset_y, | ||
float | scale, | ||
bool | smooth | ||
) |
Create a new sprite by cropping and taking only the given portion of the image.
source gives the sprite that is to be cropped.
x,y, width, height gives the rectangle to be cropped. The pixel at position of the source sprite will be at (0,0) in the new sprite, and the new sprite will have dimensions (width, height).
mask gives an additional mask to be used for clipping the new sprite. Only the transparency value of the mask is used in crop_sprite. The formula is: dest_trans = src_trans * mask_trans. Note that because the transparency is expressed as an integer it is common to divide it by 256 afterwards.
mask_offset_x, mask_offset_y is the offset of the mask relative to the origin of the source image. The pixel at (mask_offset_x,mask_offset_y) in the mask image will be used to clip pixel (0,0) in the source image which is pixel (-x,-y) in the new image.
Definition at line 104 of file sprite.cpp.
Referenced by setup_gui_funcs().
Stub for editor function
Definition at line 516 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Stub for editor function
Definition at line 523 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_popdown_all | ( | ) |
Stub for editor function
Definition at line 510 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Stub for editor function
Definition at line 504 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_refresh | ( | ) |
Stub for editor function
Definition at line 498 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_tileset_changed | ( | ) |
Stub for editor function
Definition at line 492 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_endgame_report_dialog_player | ( | const struct packet_endgame_player * | packet | ) |
Received endgame report information about single player.
Definition at line 1791 of file repodlgs.cpp.
Referenced by setup_gui_funcs().
void qtg_endgame_report_dialog_start | ( | const struct packet_endgame_report * | packet | ) |
Show a dialog with player statistics at endgame.
Definition at line 1753 of file repodlgs.cpp.
Referenced by setup_gui_funcs().
Free a sprite and all associated image data.
Definition at line 172 of file sprite.cpp.
Referenced by city_production_delegate::paint(), and setup_gui_funcs().
enum client_pages qtg_get_current_client_page | ( | ) |
Returns current client page
Definition at line 122 of file pages.cpp.
Referenced by apply_notify_font(), qtg_real_conn_list_dialog_update(), and setup_gui_funcs().
Each gui has its own themes directories.
Returns an array containing these strings and sets array size in count. The caller is responsible for freeing the array and the paths.
Definition at line 120 of file themes.cpp.
Referenced by setup_gui_funcs().
enum gui_type qtg_get_gui_type | ( | ) |
Returns gui type of the client
Definition at line 547 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Find the dimensions of the sprite.
Definition at line 163 of file sprite.cpp.
Referenced by setup_gui_funcs().
Return the size of the given text in the given font. This size should include the ascent and descent of the text. Either of width or height may be nullptr in which case those values simply shouldn't be filled out.
Definition at line 331 of file canvas.cpp.
Referenced by setup_gui_funcs().
Return an array of names of usable themes in the given directory. Array size is stored in count. The caller is responsible for freeing the array and the names.
Definition at line 145 of file themes.cpp.
Referenced by setup_gui_funcs().
void qtg_gui_clear_theme | ( | ) |
Clears a theme (sets default system theme)
Definition at line 104 of file themes.cpp.
Referenced by qtg_gui_load_theme(), qtg_ui_main(), and setup_gui_funcs().
Loads a qt theme directory/theme_name
Definition at line 44 of file themes.cpp.
Referenced by setup_gui_funcs().
Updates a gui font style.
Definition at line 529 of file gui_main.cpp.
Referenced by apply_notify_font(), and setup_gui_funcs().
bool qtg_handmade_scenario_warning | ( | ) |
Give a warning when user is about to edit scenario with manually set properties.
Definition at line 4929 of file dialogs.cpp.
Referenced by setup_gui_funcs().
bool qtg_has_zoom_support | ( | ) |
This gui has zoom support.
Definition at line 64 of file canvas.cpp.
Referenced by setup_gui_funcs().
Handle the start of a diplomacy meeting - usually by popping up a diplomacy dialog.
Definition at line 944 of file diplodlg.cpp.
Referenced by plr_report::req_meeeting(), and setup_gui_funcs().
Insert build information to help
Definition at line 585 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Return whether the client supports given view type.
Definition at line 28 of file graphics.cpp.
Referenced by setup_gui_funcs().
Load the given graphics file into a sprite. This function loads an entire image file, which may later be broken up into individual sprites with crop_sprite().
Definition at line 67 of file sprite.cpp.
Referenced by setup_gui_funcs().
Creates a sprite with the number in it.
Definition at line 195 of file sprite.cpp.
Referenced by setup_gui_funcs().
Refresh map canvas size information
Definition at line 1459 of file mapview.cpp.
Referenced by setup_gui_funcs().
void qtg_options_extra_init | ( | ) |
Extra initializers for client options.
Definition at line 235 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_popdown_all_city_dialogs | ( | ) |
Close the dialogs for all cities.
Definition at line 3864 of file citydlg.cpp.
Referenced by unit_item::activate_and_close_dialog(), unit_item::mousePressEvent(), and setup_gui_funcs().
Close the dialog for the given city.
Definition at line 3852 of file citydlg.cpp.
Referenced by setup_gui_funcs().
void qtg_popup_combat_info | ( | int | attacker_unit_id, |
int | defender_unit_id, | ||
int | attacker_hp, | ||
int | defender_hp, | ||
bool | make_att_veteran, | ||
bool | make_def_veteran | ||
) |
Popup detailed information about battle or save information for some kind of statistics
Definition at line 4979 of file dialogs.cpp.
Referenced by setup_gui_funcs().
Prepare to clause creation or removal.
Definition at line 1030 of file diplodlg.cpp.
Referenced by setup_gui_funcs().
Pop up (or bring to the front) a dialog for the given city. It may or may not be modal.
Definition at line 3824 of file citydlg.cpp.
Referenced by city_widget::city_view(), notify_goto::inspect_city(), city_dialog::next_city(), city_dialog::prev_city(), and setup_gui_funcs().
Refresh (update) all data for the given city's dialog.
Definition at line 3872 of file citydlg.cpp.
Referenced by qtg_refresh_unit_city_dialogs(), and setup_gui_funcs().
Update the connected users list at pregame state.
Definition at line 281 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Update the economy report.
Definition at line 1687 of file repodlgs.cpp.
Referenced by setup_gui_funcs().
Called when the set of units in focus (get_units_in_focus()) changes. Standard updates like update_unit_info_label() are handled in the platform- independent code, so some clients will not need to do anything here.
Definition at line 354 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_real_output_window_append | ( | const char * | astring, |
const struct text_tag_list * | tags, | ||
int | conn_id | ||
) |
Appends the string to the chat output window. The string should be inserted on its own line, although it will have no newline.
Definition at line 765 of file chatline.cpp.
Referenced by real_luaconsole_append(), and setup_gui_funcs().
Update the science report.
Definition at line 1159 of file repodlgs.cpp.
Referenced by apply_font(), setup_gui_funcs(), and fc_client::switch_page().
void qtg_real_set_client_page | ( | enum client_pages | page | ) |
Sets the "page" that the client should show. See also pages_g.h.
Definition at line 104 of file pages.cpp.
Referenced by qtg_close_connection_dialog(), qtg_real_conn_list_dialog_update(), and setup_gui_funcs().
Update the units report.
Definition at line 1734 of file repodlgs.cpp.
Referenced by setup_gui_funcs().
Update a player's acceptance status of a treaty (traditionally shown with the thumbs-up/thumbs-down sprite).
Definition at line 919 of file diplodlg.cpp.
Referenced by setup_gui_funcs().
void qtg_recv_cancel_meeting | ( | struct treaty * | ptreaty, |
struct player * | they, | ||
struct player * | initiator | ||
) |
Update the diplomacy dialog when the meeting is canceled (the dialog should be closed).
Definition at line 1062 of file diplodlg.cpp.
Referenced by setup_gui_funcs().
Update the diplomacy dialog by adding a clause.
Definition at line 1038 of file diplodlg.cpp.
Referenced by setup_gui_funcs().
Update the diplomacy dialog by removing a clause.
Definition at line 1082 of file diplodlg.cpp.
Referenced by setup_gui_funcs().
Update city dialogs when the given unit's status changes. This typically means updating both the unit's home city (if any) and the city in which it is present (if any).
Definition at line 3911 of file citydlg.cpp.
Referenced by setup_gui_funcs().
void qtg_remove_net_input | ( | ) |
Stop waiting for any server network data. See add_net_input().
This function is called if the client disconnects from the server.
Definition at line 316 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_request_action_confirmation | ( | const char * | expl, |
struct act_confirmation_data * | data | ||
) |
Common code wants confirmation for an action.
Definition at line 5022 of file dialogs.cpp.
Referenced by setup_gui_funcs().
Unit wants to get into some transport on given tile.
Definition at line 4938 of file dialogs.cpp.
Referenced by unit_item::load_unit(), setup_gui_funcs(), and mr_menu::slot_board().
Display the science report. Optionally raise it. Typically triggered by F6.
Definition at line 1660 of file repodlgs.cpp.
Referenced by setup_gui_funcs(), and mr_menu::slot_show_research_tab().
void qtg_science_report_dialog_redraw | ( | ) |
Resize and redraw the requirement tree.
Definition at line 1809 of file repodlgs.cpp.
Referenced by setup_gui_funcs().
void qtg_server_connect | ( | ) |
Provide an interface for connecting to a Freeciv server.
Definition at line 77 of file connectdlg.cpp.
Referenced by setup_gui_funcs().
Set the list of available rulesets. The default ruleset should be "default", and if the user changes this then set_ruleset() should be called.
Definition at line 114 of file pages.cpp.
Referenced by setup_gui_funcs().
Set one of the unit icons (specified by idx) in the information area based on punit.
punit is the unit the information should be taken from. Use nullptr to clear the icon.
idx specified which icon should be modified. Use idx == -1 to indicate the icon for the active unit. Or idx in [0..num_units_below-1] for secondary (inactive) units on the same tile.
Definition at line 332 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Most clients use an arrow (e.g., sprites.right_arrow) to indicate when the units_below will not fit. This function is called to activate or deactivate the arrow.
Is disabled by default.
Definition at line 344 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_setup_gui_properties | ( | ) |
Define properties of this gui.
Definition at line 606 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_sound_bell | ( | ) |
Make a bell noise (beep). This provides low-level sound alerts even if there is no real sound support.
Definition at line 293 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_start_turn | ( | ) |
Loading tileset of the specified type
Definition at line 44 of file graphics.cpp.
Referenced by setup_gui_funcs().
void qtg_ui_exit | ( | ) |
Do any necessary UI-specific cleanup
Definition at line 271 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_ui_init | ( | ) |
Do any necessary pre-initialization of the UI, if necessary.
Definition at line 90 of file gui_main.cpp.
Referenced by setup_gui_funcs().
The main loop for the UI. This is called from main(), and when it exits the client will exit.
Definition at line 168 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_update_infra_dialog | ( | ) |
Update the timeout display. The timeout is the time until the turn ends, in seconds.
Definition at line 1086 of file mapview.cpp.
Referenced by setup_gui_funcs().
Got version message from metaserver thread.
Definition at line 833 of file chatline.cpp.
Referenced by server_scan_error(), and setup_gui_funcs().
Setup the gui callback table.
Definition at line 29 of file qtg_cxxside.cpp.