Freeciv-3.1
|
Go to the source code of this file.
void qtg_add_idle_callback | ( | void(callback)(void *) | , |
void * | data | ||
) |
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 363 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_add_net_input | ( | int | sock | ) |
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 299 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 78 of file canvas.cpp.
Referenced by city_map::set_pixmap(), and setup_gui_funcs().
struct canvas * qtg_canvas_create | ( | int | width, |
int | height | ||
) |
Create a canvas of the given size.
Definition at line 35 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 214 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_free | ( | struct canvas * | store | ) |
Free any resources associated with this canvas and the canvas struct itself.
Definition at line 47 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().
void qtg_canvas_mapview_init | ( | struct canvas * | store | ) |
Initialize canvas as mapview.
Definition at line 71 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 266 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 227 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 185 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 138 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 168 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 153 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 NULL but may be empty.
Definition at line 334 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_canvas_set_zoom | ( | struct canvas * | store, |
float | zoom | ||
) |
Set canvas zoom for future drawing operations.
Definition at line 55 of file canvas.cpp.
Referenced by setup_gui_funcs().
Return whether the dialog for the given city is open.
Definition at line 3824 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().
struct color * qtg_color_alloc | ( | int | r, |
int | g, | ||
int | b | ||
) |
Allocate a color (adjusting it for our colormap if necessary on paletted systems) and return a pointer to it.
Definition at line 29 of file colors.cpp.
Referenced by setup_gui_funcs().
void qtg_color_free | ( | struct color * | pcolor | ) |
Free a previously allocated color. See qtg_color_alloc.
Definition at line 41 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().
void qtg_editgui_notify_object_changed | ( | int | objtype, |
int | object_id, | ||
bool | removal | ||
) |
Stub for editor function
Definition at line 509 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_notify_object_created | ( | int | tag, |
int | id | ||
) |
Stub for editor function
Definition at line 516 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_popdown_all | ( | ) |
Stub for editor function
Definition at line 503 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_popup_properties | ( | const struct tile_list * | tiles, |
int | objtype | ||
) |
Stub for editor function
Definition at line 497 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_refresh | ( | ) |
Stub for editor function
Definition at line 491 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_editgui_tileset_changed | ( | ) |
Stub for editor function
Definition at line 485 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_free_sprite | ( | struct sprite * | s | ) |
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 120 of file pages.cpp.
Referenced by apply_notify_font(), qtg_real_conn_list_dialog_update(), and setup_gui_funcs().
char ** qtg_get_gui_specific_themes_directories | ( | int * | count | ) |
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 540 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_get_sprite_dimensions | ( | struct sprite * | sprite, |
int * | width, | ||
int * | height | ||
) |
Find the dimensions of the sprite.
Definition at line 163 of file sprite.cpp.
Referenced by setup_gui_funcs().
void qtg_get_text_size | ( | int * | width, |
int * | height, | ||
enum client_font | font, | ||
const char * | text | ||
) |
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 NULL in which case those values simply shouldn't be filled out.
Definition at line 311 of file canvas.cpp.
Referenced by setup_gui_funcs().
char ** qtg_get_usable_themes_in_directory | ( | const char * | directory, |
int * | count | ||
) |
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().
void qtg_gui_load_theme | ( | const char * | directory, |
const char * | theme_name | ||
) |
Loads a qt theme directory/theme_name
Definition at line 44 of file themes.cpp.
Referenced by setup_gui_funcs().
void qtg_gui_update_font | ( | const char * | font_name, |
const char * | font_value | ||
) |
Updates a gui font style.
Definition at line 522 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 4750 of file dialogs.cpp.
Referenced by setup_gui_funcs().
bool qtg_has_zoom_support | ( | ) |
This gui has zoom support.
Definition at line 63 of file canvas.cpp.
Referenced by setup_gui_funcs().
void qtg_insert_client_build_info | ( | char * | outbuf, |
size_t | outlen | ||
) |
Insert build information to help
Definition at line 578 of file gui_main.cpp.
Referenced by setup_gui_funcs().
bool qtg_is_view_supported | ( | enum ts_type | type | ) |
Return whether the client supports given view type.
Definition at line 28 of file graphics.cpp.
Referenced by setup_gui_funcs().
struct sprite * qtg_load_gfxfile | ( | const char * | filename | ) |
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().
struct sprite * qtg_load_gfxnumber | ( | int | num | ) |
Creates a sprite with the number in it.
Definition at line 195 of file sprite.cpp.
Referenced by setup_gui_funcs().
void qtg_map_canvas_size_refresh | ( | void | ) |
Refresh map canvas size information
Definition at line 1461 of file mapview.cpp.
Referenced by setup_gui_funcs().
void qtg_options_extra_init | ( | ) |
Extra initializers for client options.
Definition at line 228 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 3761 of file citydlg.cpp.
Referenced by unit_item::activate_and_close_dialog(), unit_item::mousePressEvent(), and setup_gui_funcs().
void qtg_popdown_city_dialog | ( | struct city * | pcity | ) |
Close the dialog for the given city.
Definition at line 3749 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 4800 of file dialogs.cpp.
Referenced by setup_gui_funcs().
void qtg_real_city_dialog_popup | ( | struct city * | pcity | ) |
Pop up (or bring to the front) a dialog for the given city. It may or may not be modal.
Definition at line 3721 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().
void qtg_real_city_dialog_refresh | ( | struct city * | pcity | ) |
Refresh (update) all data for the given city's dialog.
Definition at line 3769 of file citydlg.cpp.
Referenced by qtg_refresh_unit_city_dialogs(), and setup_gui_funcs().
void qtg_real_conn_list_dialog_update | ( | void * | unused | ) |
Update the connected users list at pregame state.
Definition at line 274 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_real_focus_units_changed | ( | void | ) |
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 347 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 740 of file chatline.cpp.
Referenced by real_luaconsole_append(), and setup_gui_funcs().
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 102 of file pages.cpp.
Referenced by qtg_close_connection_dialog(), qtg_real_conn_list_dialog_update(), and setup_gui_funcs().
void qtg_refresh_unit_city_dialogs | ( | struct unit * | punit | ) |
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 3808 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 309 of file gui_main.cpp.
Referenced by setup_gui_funcs().
Unit wants to get into some transport on given tile.
Definition at line 4759 of file dialogs.cpp.
Referenced by unit_item::load_unit(), setup_gui_funcs(), and mr_menu::slot_board().
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().
void qtg_set_rulesets | ( | int | num_rulesets, |
char ** | rulesets | ||
) |
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 112 of file pages.cpp.
Referenced by setup_gui_funcs().
void qtg_set_unit_icon | ( | int | idx, |
struct unit * | punit | ||
) |
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 NULL 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 325 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_set_unit_icons_more_arrow | ( | bool | onoff | ) |
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 337 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 286 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_start_turn | ( | ) |
void qtg_tileset_type_set | ( | enum ts_type | type | ) |
Loading tileset of the specified type
Definition at line 42 of file graphics.cpp.
Referenced by setup_gui_funcs().
void qtg_ui_exit | ( | ) |
Do any necessary UI-specific cleanup
Definition at line 264 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 91 of file gui_main.cpp.
Referenced by setup_gui_funcs().
int qtg_ui_main | ( | int | argc, |
char * | argv[] | ||
) |
The main loop for the UI. This is called from main(), and when it exits the client will exit.
Definition at line 169 of file gui_main.cpp.
Referenced by setup_gui_funcs().
void qtg_update_infra_dialog | ( | ) |
void qtg_update_timeout_label | ( | void | ) |
Update the timeout display. The timeout is the time until the turn ends, in seconds.
Definition at line 1088 of file mapview.cpp.
Referenced by setup_gui_funcs().
void qtg_version_message | ( | const char * | vertext | ) |
Got version message from metaserver thread.
Definition at line 808 of file chatline.cpp.
Referenced by server_scan_error(), and setup_gui_funcs().
void setup_gui_funcs | ( | void | ) |
Setup the gui callback table.
Definition at line 29 of file qtg_cxxside.cpp.