77 static bool flip =
FALSE;
83 if ((do_restore && flip) || !do_restore) {
84 static GtkCssProvider *tdb_provider = NULL;
87 if (tdb_provider == NULL) {
88 tdb_provider = gtk_css_provider_new();
90 gtk_css_provider_load_from_data(tdb_provider,
92 "color: rgba(235, 127, 235, 255);\n"
93 "background-color: rgba(127, 127, 127, 255);\n"
99 gtk_style_context_add_provider(scontext,
100 GTK_STYLE_PROVIDER(tdb_provider),
101 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
105 gtk_style_context_add_class(scontext,
"lighted");
107 gtk_style_context_remove_class(scontext,
"lighted");
123 _(
"Time to forced turn change,\n"
124 "or estimated time to finish turn change "
128 _(
"Turn timeout disabled.\n"
129 "Between turns this shows estimated time "
130 "to finish turn change processing."));
143 if (pplayer != NULL) {
150 c = g_utf8_get_char_validated(
name, -1);
151 if ((gunichar) -1 != c && (gunichar) -2 != c) {
152 const char *obstext = NULL;
156 obstext =
_(
" (observer)");
157 obstextlen = strlen(obstext);
165 len = g_unichar_to_utf8(g_unichar_toupper(c),
nation);
167 next = g_utf8_find_next_char(
name, NULL);
171 if (obstext != NULL) {
174 gtk_label_set_text(GTK_LABEL(label),
nation);
177 gtk_label_set_text(GTK_LABEL(label),
name);
180 gtk_label_set_text(GTK_LABEL(label),
"-");
191 if (NULL != pplayer) {
207 for (; d < 10; d++) {
218 _(
"Shows your current luxury/science/tax rates; "
219 "click to toggle them."));
279 gtk_label_set_text(GTK_LABEL(label),
339 static struct canvas store;
363 cairo_set_source_surface(cr,
surface, 0, 0);
448 gdk_window_invalidate_rect(gtk_widget_get_window(
map_canvas), &rectangle,
FALSE);
458 gdk_window_invalidate_rect(gtk_widget_get_window(
map_canvas), NULL,
FALSE);
505 store.
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
510 gtk_image_set_from_surface(p, store.
surface);
511 cairo_surface_destroy(store.
surface);
522 int *upkeep_cost,
int happy_cost)
527 store.
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
533 upkeep_cost, happy_cost);
535 gtk_image_set_from_surface(p, store.
surface);
536 cairo_surface_destroy(store.
surface);
547 GdkDrawingContext *ctx;
553 ctx = gdk_window_begin_draw_frame(pixmap,
554 gdk_window_get_clip_region(pixmap));
555 cr = gdk_drawing_context_get_cairo_context(ctx);
559 gdk_window_end_draw_frame(pixmap, ctx);
571 int sswidth, ssheight;
572 const double bright = 0.65;
582 cairo_surface_t *fog_surface;
584 unsigned char *mask_in;
585 unsigned char *mask_out;
589 fogcol->
color.alpha = 0.0;
591 fog_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, sswidth, ssheight);
595 mask_in = cairo_image_surface_get_data(ssprite->
surface);
596 mask_out = cairo_image_surface_get_data(fog_surface);
598 for (i = 0; i < sswidth; i++) {
599 for (j = 0; j < ssheight; j++) {
604 mask_out[(j * sswidth + i) * 4 + 3]
605 = (1-bright) * mask_in[(j * sswidth + i) * 4 + 3];
607 mask_out[(j * sswidth + i) * 4 + 0]
608 = (1-bright) * mask_in[(j * sswidth + i) * 4 + 0];
613 cairo_surface_mark_dirty(fog_surface);
616 cr = cairo_create(fogged->
surface);
617 cairo_set_source_surface(cr, ssprite->
surface, 0, 0);
621 cairo_set_source_surface(cr, fog_surface, 0, 0);
627 fogged, 0, 0, sswidth, ssheight);
630 cairo_surface_destroy(fog_surface);
635 ssprite, 0, 0, sswidth, ssheight);
658 gdouble ov_scroll_x, ov_scroll_y;
659 GtkAdjustment *ov_hadj, *ov_vadj;
661 ov_hadj = gtk_scrolled_window_get_hadjustment(
663 ov_vadj = gtk_scrolled_window_get_vadjustment(
667 gtk_adjustment_get_upper(ov_hadj)
668 - gtk_adjustment_get_page_size(ov_hadj));
670 gtk_adjustment_get_upper(ov_vadj)
671 - gtk_adjustment_get_page_size(ov_vadj));
673 gtk_adjustment_set_value(ov_hadj, ov_scroll_x);
674 gtk_adjustment_set_value(ov_vadj, ov_scroll_y);
682 int scroll_x, scroll_y;
685 gtk_adjustment_set_value(
map_hadj, scroll_x);
686 gtk_adjustment_set_value(
map_vadj, scroll_y);
697 float xmin, ymin, xmax, ymax;
698 int xsize, ysize, xstep, ystep;
703 map_hadj = gtk_adjustment_new(-1, xmin, xmax, xstep, xsize, xsize);
704 map_vadj = gtk_adjustment_new(-1, ymin, ymax, ystep, ysize, ysize);
709 g_signal_connect(
map_hadj,
"value_changed",
711 GINT_TO_POINTER(
TRUE));
712 g_signal_connect(
map_vadj,
"value_changed",
714 GINT_TO_POINTER(
FALSE));
722 int scroll_x, scroll_y;
731 scroll_x = gtk_adjustment_get_value(adj);
733 scroll_y = gtk_adjustment_get_value(adj);
750 double dashes[2] = {4.0, 4.0};
753 GdkDrawingContext *ctx;
756 if (w == 0 || h == 0) {
766 ctx = gdk_window_begin_draw_frame(wndw,
767 gdk_window_get_clip_region(wndw));
768 cr = gdk_drawing_context_get_cairo_context(ctx);
769 gdk_cairo_set_source_rgba(cr, &
pcolor->color);
770 cairo_set_line_width(cr, 2.0);
771 cairo_set_dash(cr, dashes, 2, 0);
772 cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
775 gdk_window_end_draw_frame(wndw, ctx);
790#ifndef FREECIV_MSWINDOWS
795 gtk_window_set_icon(GTK_WINDOW(
toplevel), pixbuf);
796 g_object_unref(pixbuf);
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
struct canvas int int canvas_y
struct canvas int canvas_x
struct canvas int int struct sprite int int int width
struct canvas int int struct sprite bool fog
bool client_is_observer(void)
bool can_client_change_view(void)
struct sprite * client_warming_sprite(void)
struct sprite * client_cooling_sprite(void)
struct sprite * client_research_sprite(void)
struct sprite * client_government_sprite(void)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
void update_unit_pix_label(struct unit_list *punitlist)
void control_mouse_cursor(struct tile *ptile)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
bool get_turn_done_button_state()
int current_turn_timeout(void)
#define FC_STATIC_CANVAS_INIT
void reset_city_dialogs(void)
struct color * color_alloc(int r, int g, int b)
void color_free(struct color *color)
void editgui_tileset_changed(void)
static GtkWidget * source
GdkCursor * fc_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES]
GtkWidget * map_vertical_scrollbar
GtkWidget * main_label_info
GtkWidget * unit_info_label
GtkWidget * timeout_label
GtkWidget * overview_scrolled_window
GtkWidget * government_label
GtkWidget * turn_done_button
void reset_unit_table(void)
GtkWidget * unit_info_frame
GtkWidget * overview_canvas
GtkWidget * map_horizontal_scrollbar
GtkWidget * econ_label[10]
GtkWidget * government_ebox
int overview_canvas_store_width
int overview_canvas_store_height
GtkWidget * main_frame_civ_name
#define GUI_GTK_OPTION(optname)
void update_timeout_label(void)
void update_info_label(void)
void update_turn_done_button(bool do_restore)
void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar)
void tileset_changed(void)
void put_cross_overlay_tile(struct tile *ptile)
void draw_selection_rectangle(int canvas_x, int canvas_y, int w, int h)
void update_map_canvas_scrollbars_size(void)
void get_overview_area_dimensions(int *width, int *height)
void mapview_freeze(void)
GdkPixbuf * get_thumb_pixbuf(int onoff)
void update_unit_info_label(struct unit_list *punits)
void update_overview_scroll_window_pos(int x, int y)
void update_city_descriptions(void)
gboolean map_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
void pixmap_put_overlay_tile(GdkWindow *pixmap, float zoom, int canvas_x, int canvas_y, struct sprite *ssprite)
void put_unit_image_city_overlays(struct unit *punit, GtkImage *p, int height, int *upkeep_cost, int happy_cost)
void pixmap_put_overlay_tile_draw(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *ssprite, bool fog)
void update_map_canvas_scrollbars(void)
bool mapview_is_frozen(void)
static gboolean anim_cursor_cb(gpointer data)
void overview_size_changed(void)
void map_canvas_size_refresh(void)
static int cursor_timer_id
static GtkAdjustment * map_vadj
static int mapview_frozen_level
struct canvas * get_overview_window(void)
gboolean map_canvas_configure(GtkWidget *w, GdkEventConfigure *ev, gpointer data)
void put_unit_image(struct unit *punit, GtkImage *p, int height)
void update_mouse_cursor(enum cursor_type new_cursor_type)
static GtkAdjustment * map_hadj
void set_indicator_icons(struct sprite *bulb, struct sprite *sol, struct sprite *flake, struct sprite *gov)
gboolean overview_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
void science_report_dialog_redraw(void)
void get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
void free_sprite(struct sprite *s)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
void blank_max_unit_size(void)
#define fc_assert(condition)
const char * get_timeout_label_text()
void update_map_canvas_visible(void)
void put_unit(const struct unit *punit, struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y)
void get_mapview_scroll_pos(int *scroll_x, int *scroll_y)
void get_mapview_scroll_window(float *xmin, float *ymin, float *xmax, float *ymax, int *xsize, int *ysize)
void unqueue_mapview_updates(bool write_to_screen)
void get_mapview_scroll_step(int *xstep, int *ystep)
void set_mapview_scroll_pos(int scroll_x, int scroll_y, float zoom)
void put_unit_city_overlays(struct unit *punit, struct canvas *pcanvas, int canvas_x, int canvas_y, int *upkeep_cost, int happy_cost)
void update_animation(void)
bool map_canvas_resized(int width, int height)
bool tile_to_canvas_pos(float *canvas_x, float *canvas_y, float zoom, const struct tile *ptile)
const char * nation_plural_for_player(const struct player *pplayer)
struct client_options gui_options
#define GUI_GTK_OVERVIEW_MIN_XSIZE
#define GUI_GTK_OVERVIEW_MIN_YSIZE
const char * get_government_tooltip(void)
const char * get_nuclear_winter_tooltip(void)
const char * get_bulb_tooltip(void)
const char * get_info_label_text(bool)
const char * get_global_warming_tooltip(void)
cairo_surface_t * surface
struct player_economic economic
struct nation_type * nation
cairo_surface_t * surface
static bool is_bigendian(void)
#define sz_strlcat(dest, src)
const char * get_unit_info_label_text2(struct unit_list *punits, int linebreaks)
const char * get_unit_info_label_text1(struct unit_list *punits)
struct sprite * get_attention_crosshair_sprite(const struct tileset *t)
int tileset_full_tile_height(const struct tileset *t)
int tileset_unit_layout_offset_y(const struct tileset *t)
struct sprite * get_treaty_thumb_sprite(const struct tileset *t, bool on_off)
struct sprite * get_icon_sprite(const struct tileset *t, enum icon_type icon)
int tileset_full_tile_width(const struct tileset *t)
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)
#define NUM_CURSOR_FRAMES