Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #673887 ยป 0031-Use-gtk_drawing_area_set_draw_func-for-map-canvases.patch

Marko Lindqvist, 2017-06-04 09:03 PM

View differences:

client/gui-gtk-4.0/gui_main.c
gtk_container_add(GTK_CONTAINER(overview_scrolled_window),
overview_canvas);
g_signal_connect(overview_canvas, "draw",
G_CALLBACK(overview_canvas_draw), NULL);
gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(overview_canvas),
overview_canvas_draw, NULL, NULL);
g_signal_connect(overview_canvas, "motion_notify_event",
G_CALLBACK(move_overviewcanvas), NULL);
......
gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL);
gtk_grid_attach(GTK_GRID(map_widget), map_vertical_scrollbar, 1, 0, 1, 1);
g_signal_connect(map_canvas, "draw",
G_CALLBACK(map_canvas_draw), NULL);
gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(map_canvas), map_canvas_draw,
NULL, NULL);
g_signal_connect(map_canvas, "configure_event",
G_CALLBACK(map_canvas_configure), NULL);
client/gui-gtk-4.0/mapview.c
/**************************************************************************
Redraw overview canvas
**************************************************************************/
gboolean overview_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
void overview_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
int width, int height, gpointer data)
{
gpointer source = (can_client_change_view()) ?
(gpointer)gui_options.overview.window : NULL;
......
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
}
return TRUE;
}
/****************************************************************************
......
/**************************************************************************
Redraw map canvas.
**************************************************************************/
gboolean map_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data)
void map_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
int width, int height, gpointer data)
{
if (can_client_change_view() && !map_is_empty() && !mapview_is_frozen()) {
/* First we mark the area to be updated as dirty. Then we unqueue
......
cairo_set_source_surface(cr, mapview.store->surface, 0, 0);
cairo_paint(cr);
}
return TRUE;
}
/**************************************************************************
client/gui-gtk-4.0/mapview.h
#define CURSOR_INTERVAL 200 /* milliseconds */
gboolean overview_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data);
gboolean map_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data);
void overview_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
int width, int height, gpointer data);
void map_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
int width, int height, gpointer data);
gboolean map_canvas_configure(GtkWidget *w, GdkEventConfigure *ev,
gpointer data);
    (1-1/1)