Commit a535e425 authored by Michael Natterer's avatar Michael Natterer 😴

libgimpwidgets: move all GimpPreviewArea members to private

parent 677c2bb8
This diff is collapsed.
......@@ -42,19 +42,6 @@ struct _GimpPreviewArea
GtkDrawingArea parent_instance;
GimpPreviewAreaPrivate *priv;
/* FIXME MOVE TO PRIVATE */
GimpCheckSize check_size;
GimpCheckType check_type;
gint width;
gint height;
gint rowstride;
gint offset_x;
gint offset_y;
gint max_width;
gint max_height;
guchar *buf;
guchar *colormap;
};
struct _GimpPreviewAreaClass
......@@ -128,6 +115,9 @@ void gimp_preview_area_set_colormap (GimpPreviewArea *area,
void gimp_preview_area_set_color_config (GimpPreviewArea *area,
GimpColorConfig *config);
void gimp_preview_area_get_size (GimpPreviewArea *area,
gint *width,
gint *height);
void gimp_preview_area_set_max_size (GimpPreviewArea *area,
gint width,
gint height);
......
......@@ -566,6 +566,9 @@ gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
GtkWidget *area;
GdkCursor *cursor;
GtkBorder border;
GimpCheckType check_type;
gint area_width;
gint area_height;
gint x, y;
gdouble h, v;
......@@ -584,9 +587,13 @@ gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
gtk_container_add (GTK_CONTAINER (outer), inner);
gtk_widget_show (inner);
g_object_get (gimp_preview->area,
"check-type", &check_type,
NULL);
area = g_object_new (GIMP_TYPE_PREVIEW_AREA,
"check-size", GIMP_CHECK_SIZE_SMALL_CHECKS,
"check-type", GIMP_PREVIEW_AREA (gimp_preview->area)->check_type,
"check-type", check_type,
NULL);
gtk_container_add (GTK_CONTAINER (inner), area);
......@@ -618,8 +625,11 @@ gimp_scrolled_preview_nav_button_press (GtkWidget *widget,
(gtk_adjustment_get_page_size (adj) /
gtk_adjustment_get_upper (adj)) / 2.0);
x += event->x - h * (gdouble) GIMP_PREVIEW_AREA (area)->width;
y += event->y - v * (gdouble) GIMP_PREVIEW_AREA (area)->height;
gimp_preview_area_get_size (GIMP_PREVIEW_AREA (area),
&area_width, &area_height);
x += event->x - h * (gdouble) area_width;
y += event->y - v * (gdouble) area_height;
gtk_style_context_get_border (context, 0, &border);
......
......@@ -1463,17 +1463,21 @@ preview_update_size (GimpPreviewArea *preview)
static void
preview_update (GimpPreviewArea *preview)
{
gint preview_width;
gint preview_height;
gint width;
gint height;
gint32 pos;
gint x, y;
gint bitspp = 0;
width = MIN (runtime->image_width, preview->width);
height = MIN (runtime->image_height, preview->height);
gimp_preview_area_get_size (preview, &preview_width, &preview_height);
width = MIN (runtime->image_width, preview_width);
height = MIN (runtime->image_height, preview_height);
gimp_preview_area_fill (preview,
0, 0, preview->width, preview->height,
0, 0, preview_width, preview_height,
255, 255, 255);
switch (runtime->image_type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment