static void gd_update(DisplayChangeListener *dcl,

                      DisplayState *ds, int x, int y, int w, int h)

{

    GtkDisplayState *s = ds->opaque;

    int x1, x2, y1, y2;

    int mx, my;

    int fbw, fbh;

    int ww, wh;



    DPRINTF("update(x=%d, y=%d, w=%d, h=%d)\n", x, y, w, h);



    x1 = floor(x * s->scale_x);

    y1 = floor(y * s->scale_y);



    x2 = ceil(x * s->scale_x + w * s->scale_x);

    y2 = ceil(y * s->scale_y + h * s->scale_y);



    fbw = ds_get_width(s->ds) * s->scale_x;

    fbh = ds_get_height(s->ds) * s->scale_y;



    gdk_drawable_get_size(gtk_widget_get_window(s->drawing_area), &ww, &wh);



    mx = my = 0;

    if (ww > fbw) {

        mx = (ww - fbw) / 2;

    }

    if (wh > fbh) {

        my = (wh - fbh) / 2;

    }



    gtk_widget_queue_draw_area(s->drawing_area, mx + x1, my + y1, (x2 - x1), (y2 - y1));

}

static void gd_update(DisplayChangeListener *dcl,

                      DisplayState *ds, int x, int y, int w, int h)

{

    GtkDisplayState *s = ds->opaque;

    int x1, x2, y1, y2;

    int mx, my;

    int fbw, fbh;

    int ww, wh;



    DPRINTF("update(x=%d, y=%d, w=%d, h=%d)\n", x, y, w, h);



    x1 = floor(x * s->scale_x);

    y1 = floor(y * s->scale_y);



    x2 = ceil(x * s->scale_x + w * s->scale_x);

    y2 = ceil(y * s->scale_y + h * s->scale_y);



    fbw = ds_get_width(s->ds) * s->scale_x;

    fbh = ds_get_height(s->ds) * s->scale_y;



    gdk_drawable_get_size(gtk_widget_get_window(s->drawing_area), &ww, &wh);



    mx = my = 0;

    if (ww > fbw) {

        mx = (ww - fbw) / 2;

    }

    if (wh > fbh) {

        my = (wh - fbh) / 2;

    }



    gtk_widget_queue_draw_area(s->drawing_area, mx + x1, my + y1, (x2 - x1), (y2 - y1));

}

    GtkDisplayState *s = ds->opaque;     GtkDisplayState *s = ds->opaque;
static void FUNC_0(DisplayChangeListener *VAR_0,

                      DisplayState *VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5)

{

    GtkDisplayState *s = VAR_1->opaque;

    int VAR_6, VAR_7, VAR_8, VAR_9;

    int VAR_10, VAR_11;

    int VAR_12, VAR_13;

    int VAR_14, VAR_15;



    DPRINTF("update(VAR_2=%d, VAR_3=%d, VAR_4=%d, VAR_5=%d)\n", VAR_2, VAR_3, VAR_4, VAR_5);



    VAR_6 = floor(VAR_2 * s->scale_x);

    VAR_8 = floor(VAR_3 * s->scale_y);



    VAR_7 = ceil(VAR_2 * s->scale_x + VAR_4 * s->scale_x);

    VAR_9 = ceil(VAR_3 * s->scale_y + VAR_5 * s->scale_y);



    VAR_12 = ds_get_width(s->VAR_1) * s->scale_x;

    VAR_13 = ds_get_height(s->VAR_1) * s->scale_y;



    gdk_drawable_get_size(gtk_widget_get_window(s->drawing_area), &VAR_14, &VAR_15);



    VAR_10 = VAR_11 = 0;

    if (VAR_14 > VAR_12) {

        VAR_10 = (VAR_14 - VAR_12) / 2;

    }

    if (VAR_15 > VAR_13) {

        VAR_11 = (VAR_15 - VAR_13) / 2;

    }



    gtk_widget_queue_draw_area(s->drawing_area, VAR_10 + VAR_6, VAR_11 + VAR_8, (VAR_7 - VAR_6), (VAR_9 - VAR_8));

}

static void FUNC_0(DisplayChangeListener *VAR_0,
DisplayState *VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5)
{ GtkDisplayState *s = VAR_1->opaque; int VAR_6, VAR_7, VAR_8, VAR_9; int VAR_10, VAR_11; int VAR_12, VAR_13; int VAR_14, VAR_15; DPRINTF("update(VAR_2=%d, VAR_3=%d, VAR_4=%d, VAR_5=%d)\n", VAR_2, VAR_3, VAR_4, VAR_5); VAR_6 = floor(VAR_2 * s->scale_x); VAR_8 = floor(VAR_3 * s->scale_y); VAR_7 = ceil(VAR_2 * s->scale_x + VAR_4 * s->scale_x); VAR_9 = ceil(VAR_3 * s->scale_y + VAR_5 * s->scale_y); VAR_12 = ds_get_width(s->VAR_1) * s->scale_x; VAR_13 = ds_get_height(s->VAR_1) * s->scale_y; gdk_drawable_get_size(gtk_widget_get_window(s->drawing_area), &VAR_14, &VAR_15); VAR_10 = VAR_11 = 0; if (VAR_14 > VAR_12) { VAR_10 = (VAR_14 - VAR_12) / 2; } if (VAR_15 > VAR_13) { VAR_11 = (VAR_15 - VAR_13) / 2; } gtk_widget_queue_draw_area(s->drawing_area, VAR_10 + VAR_6, VAR_11 + VAR_8, (VAR_7 - VAR_6), (VAR_9 - VAR_8)); }