diff --git a/ChangeLog b/ChangeLog index 9a0154e097..88af10bdee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-10 Martin Nordholts + + * app/display/gimpdisplayshell-draw.[ch] + * app/display/gimpdisplayshell-render.[ch] + * app/display/gimpdisplayshell-transform.[ch] + * app/display/gimpdisplayshell-appearance.[ch]: Sprinkle as many + const qualifiers we can without any implementation changes. + 2008-08-10 Martin Nordholts * app/display/gimpdisplayshell-scroll.[ch]: gimp_display_shell_ -> @@ -6,7 +14,7 @@ * app/display/gimpnavigationeditor.c * app/display/gimpdisplayshell-draw.c - * app/display/gimpdisplayshell-scale.c + * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell-callbacks.c: Adapt to the name diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c index 9227175d65..1236d9d36d 100644 --- a/app/display/gimpdisplayshell-appearance.c +++ b/app/display/gimpdisplayshell-appearance.c @@ -126,7 +126,7 @@ gimp_display_shell_set_fullscreen (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_fullscreen (GimpDisplayShell *shell) +gimp_display_shell_get_fullscreen (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -160,7 +160,7 @@ gimp_display_shell_set_show_menubar (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_menubar (GimpDisplayShell *shell) +gimp_display_shell_get_show_menubar (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -208,7 +208,7 @@ gimp_display_shell_set_show_rulers (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_rulers (GimpDisplayShell *shell) +gimp_display_shell_get_show_rulers (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -266,7 +266,7 @@ gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_scrollbars (GimpDisplayShell *shell) +gimp_display_shell_get_show_scrollbars (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -294,7 +294,7 @@ gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_statusbar (GimpDisplayShell *shell) +gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -322,7 +322,7 @@ gimp_display_shell_set_show_selection (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_selection (GimpDisplayShell *shell) +gimp_display_shell_get_show_selection (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -350,7 +350,7 @@ gimp_display_shell_set_show_layer (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_layer (GimpDisplayShell *shell) +gimp_display_shell_get_show_layer (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -367,7 +367,7 @@ gimp_display_shell_set_show_transform (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_transform (GimpDisplayShell *shell) +gimp_display_shell_get_show_transform (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -399,7 +399,7 @@ gimp_display_shell_set_show_guides (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_guides (GimpDisplayShell *shell) +gimp_display_shell_get_show_guides (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -431,7 +431,7 @@ gimp_display_shell_set_show_grid (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_grid (GimpDisplayShell *shell) +gimp_display_shell_get_show_grid (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -463,7 +463,7 @@ gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell) +gimp_display_shell_get_show_sample_points (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -488,7 +488,7 @@ gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell) +gimp_display_shell_get_snap_to_grid (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -513,7 +513,7 @@ gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_snap_to_guides (GimpDisplayShell *shell) +gimp_display_shell_get_snap_to_guides (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -538,7 +538,7 @@ gimp_display_shell_set_snap_to_canvas (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_snap_to_canvas (GimpDisplayShell *shell) +gimp_display_shell_get_snap_to_canvas (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -563,7 +563,7 @@ gimp_display_shell_set_snap_to_vectors (GimpDisplayShell *shell, } gboolean -gimp_display_shell_get_snap_to_vectors (GimpDisplayShell *shell) +gimp_display_shell_get_snap_to_vectors (const GimpDisplayShell *shell) { g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE); @@ -630,9 +630,9 @@ gimp_display_shell_set_padding (GimpDisplayShell *shell, } void -gimp_display_shell_get_padding (GimpDisplayShell *shell, - GimpCanvasPaddingMode *padding_mode, - GimpRGB *padding_color) +gimp_display_shell_get_padding (const GimpDisplayShell *shell, + GimpCanvasPaddingMode *padding_mode, + GimpRGB *padding_color) { GimpDisplayOptions *options; diff --git a/app/display/gimpdisplayshell-appearance.h b/app/display/gimpdisplayshell-appearance.h index 26800c00e7..8db629004e 100644 --- a/app/display/gimpdisplayshell-appearance.h +++ b/app/display/gimpdisplayshell-appearance.h @@ -20,74 +20,74 @@ #define __GIMP_DISPLAY_SHELL_APPEARANCE_H__ -void gimp_display_shell_appearance_update (GimpDisplayShell *shell); +void gimp_display_shell_appearance_update (GimpDisplayShell *shell); -void gimp_display_shell_set_fullscreen (GimpDisplayShell *shell, - gboolean fullscreen); -gboolean gimp_display_shell_get_fullscreen (GimpDisplayShell *shell); +void gimp_display_shell_set_fullscreen (GimpDisplayShell *shell, + gboolean fullscreen); +gboolean gimp_display_shell_get_fullscreen (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_menubar (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_menubar (GimpDisplayShell *shell); +void gimp_display_shell_set_show_menubar (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_menubar (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_rulers (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_rulers (GimpDisplayShell *shell); +void gimp_display_shell_set_show_rulers (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_rulers (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_scrollbars (GimpDisplayShell *shell); +void gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_scrollbars (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_statusbar (GimpDisplayShell *shell); +void gimp_display_shell_set_show_statusbar (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_statusbar (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_selection (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_selection (GimpDisplayShell *shell); +void gimp_display_shell_set_show_selection (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_selection (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_layer (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_layer (GimpDisplayShell *shell); +void gimp_display_shell_set_show_layer (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_layer (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_transform (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_transform (GimpDisplayShell *shell); +void gimp_display_shell_set_show_transform (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_transform (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_grid (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_grid (GimpDisplayShell *shell); +void gimp_display_shell_set_show_grid (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_grid (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_guides (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_guides (GimpDisplayShell *shell); +void gimp_display_shell_set_show_guides (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_guides (const GimpDisplayShell *shell); -void gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell, - gboolean snap); -gboolean gimp_display_shell_get_snap_to_grid (GimpDisplayShell *shell); +void gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell, + gboolean snap); +gboolean gimp_display_shell_get_snap_to_grid (const GimpDisplayShell *shell); -void gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell, - gboolean show); -gboolean gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell); +void gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell, + gboolean show); +gboolean gimp_display_shell_get_show_sample_points (const GimpDisplayShell *shell); -void gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell, - gboolean snap); -gboolean gimp_display_shell_get_snap_to_guides (GimpDisplayShell *shell); +void gimp_display_shell_set_snap_to_guides (GimpDisplayShell *shell, + gboolean snap); +gboolean gimp_display_shell_get_snap_to_guides (const GimpDisplayShell *shell); -void gimp_display_shell_set_snap_to_canvas (GimpDisplayShell *shell, - gboolean snap); -gboolean gimp_display_shell_get_snap_to_canvas (GimpDisplayShell *shell); +void gimp_display_shell_set_snap_to_canvas (GimpDisplayShell *shell, + gboolean snap); +gboolean gimp_display_shell_get_snap_to_canvas (const GimpDisplayShell *shell); -void gimp_display_shell_set_snap_to_vectors (GimpDisplayShell *shell, - gboolean snap); -gboolean gimp_display_shell_get_snap_to_vectors (GimpDisplayShell *shell); +void gimp_display_shell_set_snap_to_vectors (GimpDisplayShell *shell, + gboolean snap); +gboolean gimp_display_shell_get_snap_to_vectors (const GimpDisplayShell *shell); -void gimp_display_shell_set_padding (GimpDisplayShell *shell, - GimpCanvasPaddingMode mode, - const GimpRGB *color); -void gimp_display_shell_get_padding (GimpDisplayShell *shell, - GimpCanvasPaddingMode *mode, - GimpRGB *color); +void gimp_display_shell_set_padding (GimpDisplayShell *shell, + GimpCanvasPaddingMode mode, + const GimpRGB *color); +void gimp_display_shell_get_padding (const GimpDisplayShell *shell, + GimpCanvasPaddingMode *mode, + GimpRGB *color); #endif /* __GIMP_DISPLAY_SHELL_APPEARANCE_H__ */ diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index b58c9f961f..cb16d2e369 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -64,9 +64,9 @@ static GdkGC * gimp_display_shell_get_pen_gc (GimpDisplayShell *shell, /* public functions */ void -gimp_display_shell_draw_guide (GimpDisplayShell *shell, - GimpGuide *guide, - gboolean active) +gimp_display_shell_draw_guide (const GimpDisplayShell *shell, + GimpGuide *guide, + gboolean active) { gint position; gint x1, y1, x2, y2; @@ -108,7 +108,7 @@ gimp_display_shell_draw_guide (GimpDisplayShell *shell, } void -gimp_display_shell_draw_guides (GimpDisplayShell *shell) +gimp_display_shell_draw_guides (const GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -340,9 +340,9 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell, } void -gimp_display_shell_draw_sample_point (GimpDisplayShell *shell, - GimpSamplePoint *sample_point, - gboolean active) +gimp_display_shell_draw_sample_point (const GimpDisplayShell *shell, + GimpSamplePoint *sample_point, + gboolean active) { GimpCanvasStyle style; gdouble x, y; @@ -406,7 +406,7 @@ gimp_display_shell_draw_sample_point (GimpDisplayShell *shell, } void -gimp_display_shell_draw_sample_points (GimpDisplayShell *shell) +gimp_display_shell_draw_sample_points (const GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -425,8 +425,8 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell) } void -gimp_display_shell_draw_vector (GimpDisplayShell *shell, - GimpVectors *vectors) +gimp_display_shell_draw_vector (const GimpDisplayShell *shell, + GimpVectors *vectors) { GimpStroke *stroke = NULL; @@ -464,7 +464,7 @@ gimp_display_shell_draw_vector (GimpDisplayShell *shell, } void -gimp_display_shell_draw_vectors (GimpDisplayShell *shell) +gimp_display_shell_draw_vectors (const GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -486,7 +486,7 @@ gimp_display_shell_draw_vectors (GimpDisplayShell *shell) } void -gimp_display_shell_draw_cursor (GimpDisplayShell *shell) +gimp_display_shell_draw_cursor (const GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); @@ -496,11 +496,11 @@ gimp_display_shell_draw_cursor (GimpDisplayShell *shell) } void -gimp_display_shell_draw_area (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h) +gimp_display_shell_draw_area (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h) { gint sx, sy; gint sw, sh; diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h index 77afd03122..046334a048 100644 --- a/app/display/gimpdisplayshell-draw.h +++ b/app/display/gimpdisplayshell-draw.h @@ -20,31 +20,31 @@ #define __GIMP_DISPLAY_SHELL_DRAW_H__ -void gimp_display_shell_draw_guide (GimpDisplayShell *shell, - GimpGuide *guide, - gboolean active); -void gimp_display_shell_draw_guides (GimpDisplayShell *shell); -void gimp_display_shell_draw_grid (GimpDisplayShell *shell, - const GdkRectangle *area); -void gimp_display_shell_draw_pen (GimpDisplayShell *shell, - const GimpVector2 *points, - gint num_points, - GimpContext *context, - GimpActiveColor color, - gint width); -void gimp_display_shell_draw_sample_point (GimpDisplayShell *shell, - GimpSamplePoint *sample_point, - gboolean active); -void gimp_display_shell_draw_sample_points (GimpDisplayShell *shell); -void gimp_display_shell_draw_vector (GimpDisplayShell *shell, - GimpVectors *vectors); -void gimp_display_shell_draw_vectors (GimpDisplayShell *shell); -void gimp_display_shell_draw_cursor (GimpDisplayShell *shell); -void gimp_display_shell_draw_area (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h); +void gimp_display_shell_draw_guide (const GimpDisplayShell *shell, + GimpGuide *guide, + gboolean active); +void gimp_display_shell_draw_guides (const GimpDisplayShell *shell); +void gimp_display_shell_draw_grid (GimpDisplayShell *shell, + const GdkRectangle *area); +void gimp_display_shell_draw_pen (GimpDisplayShell *shell, + const GimpVector2 *points, + gint num_points, + GimpContext *context, + GimpActiveColor color, + gint width); +void gimp_display_shell_draw_sample_point (const GimpDisplayShell *shell, + GimpSamplePoint *sample_point, + gboolean active); +void gimp_display_shell_draw_sample_points (const GimpDisplayShell *shell); +void gimp_display_shell_draw_vector (const GimpDisplayShell *shell, + GimpVectors *vectors); +void gimp_display_shell_draw_vectors (const GimpDisplayShell *shell); +void gimp_display_shell_draw_cursor (const GimpDisplayShell *shell); +void gimp_display_shell_draw_area (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h); #endif /* __GIMP_DISPLAY_SHELL_DRAW_H__ */ diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index 59e6030410..0f72f51465 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -64,49 +64,49 @@ typedef void (* RenderFunc) (RenderInfo *info); struct _RenderInfo { - GimpDisplayShell *shell; - TileManager *src_tiles; - const guchar *src; - guchar *dest; - gboolean src_is_premult; - gint x, y; - gint w, h; - gdouble scalex; - gdouble scaley; - gint src_x; - gint src_y; - gint dest_bpp; - gint dest_bpl; - gint dest_width; + const GimpDisplayShell *shell; + TileManager *src_tiles; + const guchar *src; + guchar *dest; + gboolean src_is_premult; + gint x, y; + gint w, h; + gdouble scalex; + gdouble scaley; + gint src_x; + gint src_y; + gint dest_bpp; + gint dest_bpl; + gint dest_width; - gint zoom_quality; + gint zoom_quality; /* Bresenham helpers */ - gint x_dest_inc; /* amount to increment for each dest. pixel */ - gint x_src_dec; /* amount to decrement for each source pixel */ - gint64 dx_start; /* pixel fraction for first pixel */ + gint x_dest_inc; /* amount to increment for each dest. pixel */ + gint x_src_dec; /* amount to decrement for each source pixel */ + gint64 dx_start; /* pixel fraction for first pixel */ - gint y_dest_inc; - gint y_src_dec; - gint64 dy_start; + gint y_dest_inc; + gint y_src_dec; + gint64 dy_start; - gint footprint_x; - gint footprint_y; - gint footshift_x; - gint footshift_y; + gint footprint_x; + gint footprint_y; + gint footshift_x; + gint footshift_y; - gint64 dy; + gint64 dy; }; -static void gimp_display_shell_render_info_scale (RenderInfo *info, - GimpDisplayShell *shell, - TileManager *tiles, - gint level, - gboolean is_premult); +static void gimp_display_shell_render_info_scale (RenderInfo *info, + const GimpDisplayShell *shell, + TileManager *tiles, + gint level, + gboolean is_premult); -static void gimp_display_shell_render_setup_notify (GObject *config, - GParamSpec *param_spec, - Gimp *gimp); +static void gimp_display_shell_render_setup_notify (GObject *config, + GParamSpec *param_spec, + Gimp *gimp); static guchar *tile_buf = NULL; @@ -189,20 +189,20 @@ gimp_display_shell_render_setup_notify (GObject *config, /* Render Image functions */ -static void render_image_rgb_a (RenderInfo *info); -static void render_image_gray_a (RenderInfo *info); +static void render_image_rgb_a (RenderInfo *info); +static void render_image_gray_a (RenderInfo *info); -static const guchar * render_image_tile_fault (RenderInfo *info); +static const guchar * render_image_tile_fault (RenderInfo *info); -static void gimp_display_shell_render_highlight (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h, - GdkRectangle *highlight); -static void gimp_display_shell_render_mask (GimpDisplayShell *shell, - RenderInfo *info); +static void gimp_display_shell_render_highlight (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h, + GdkRectangle *highlight); +static void gimp_display_shell_render_mask (const GimpDisplayShell *shell, + RenderInfo *info); /*****************************************************************/ @@ -213,12 +213,12 @@ static void gimp_display_shell_render_mask (GimpDisplayShell *shell, /*****************************************************************/ void -gimp_display_shell_render (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h, - GdkRectangle *highlight) +gimp_display_shell_render (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h, + GdkRectangle *highlight) { GimpProjection *projection; GimpImage *image; @@ -343,12 +343,12 @@ gimp_display_shell_render (GimpDisplayShell *shell, /* This function highlights the given area by dimming all pixels outside. */ static void -gimp_display_shell_render_highlight (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h, - GdkRectangle *highlight) +gimp_display_shell_render_highlight (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h, + GdkRectangle *highlight) { guchar *buf = shell->render_buf; GdkRectangle rect; @@ -407,8 +407,8 @@ gimp_display_shell_render_highlight (GimpDisplayShell *shell, } static void -gimp_display_shell_render_mask (GimpDisplayShell *shell, - RenderInfo *info) +gimp_display_shell_render_mask (const GimpDisplayShell *shell, + RenderInfo *info) { gint y, ye; gint x, xe; @@ -592,11 +592,11 @@ render_image_rgb_a (RenderInfo *info) } static void -gimp_display_shell_render_info_scale (RenderInfo *info, - GimpDisplayShell *shell, - TileManager *tiles, - gint level, - gboolean is_premult) +gimp_display_shell_render_info_scale (RenderInfo *info, + const GimpDisplayShell *shell, + TileManager *tiles, + gint level, + gboolean is_premult) { info->src_tiles = tiles; info->src_is_premult = is_premult; diff --git a/app/display/gimpdisplayshell-render.h b/app/display/gimpdisplayshell-render.h index 1901a8bae8..4a868602b5 100644 --- a/app/display/gimpdisplayshell-render.h +++ b/app/display/gimpdisplayshell-render.h @@ -20,15 +20,15 @@ #define __GIMP_DISPLAY_SHELL_RENDER_H__ -void gimp_display_shell_render_init (Gimp *gimp); -void gimp_display_shell_render_exit (Gimp *gimp); +void gimp_display_shell_render_init (Gimp *gimp); +void gimp_display_shell_render_exit (Gimp *gimp); -void gimp_display_shell_render (GimpDisplayShell *shell, - gint x, - gint y, - gint w, - gint h, - GdkRectangle *highlight); +void gimp_display_shell_render (const GimpDisplayShell *shell, + gint x, + gint y, + gint w, + gint h, + GdkRectangle *highlight); #endif /* __GIMP_DISPLAY_SHELL_RENDER_H__ */ diff --git a/app/display/gimpdisplayshell-transform.c b/app/display/gimpdisplayshell-transform.c index c9b7d8f0a8..27785d5a40 100644 --- a/app/display/gimpdisplayshell-transform.c +++ b/app/display/gimpdisplayshell-transform.c @@ -45,9 +45,9 @@ * objects can be rendered at the correct points on the display. **/ void -gimp_display_shell_transform_coordinate (GimpDisplayShell *shell, - GimpCoords *image_coords, - GimpCoords *display_coords) +gimp_display_shell_transform_coordinate (const GimpDisplayShell *shell, + GimpCoords *image_coords, + GimpCoords *display_coords) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -79,9 +79,9 @@ gimp_display_shell_transform_coordinate (GimpDisplayShell *shell, * points on the display can be mapped to points in the image. **/ void -gimp_display_shell_untransform_coordinate (GimpDisplayShell *shell, - GimpCoords *display_coords, - GimpCoords *image_coords) +gimp_display_shell_untransform_coordinate (const GimpDisplayShell *shell, + GimpCoords *display_coords, + GimpCoords *image_coords) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -104,12 +104,12 @@ gimp_display_shell_untransform_coordinate (GimpDisplayShell *shell, } void -gimp_display_shell_transform_xy (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gint *nx, - gint *ny, - gboolean use_offsets) +gimp_display_shell_transform_xy (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gint *nx, + gint *ny, + gboolean use_offsets) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -165,13 +165,13 @@ gimp_display_shell_transform_xy (GimpDisplayShell *shell, * in the image. **/ void -gimp_display_shell_untransform_xy (GimpDisplayShell *shell, - gint x, - gint y, - gint *nx, - gint *ny, - gboolean round, - gboolean use_offsets) +gimp_display_shell_untransform_xy (const GimpDisplayShell *shell, + gint x, + gint y, + gint *nx, + gint *ny, + gboolean round, + gboolean use_offsets) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -225,12 +225,12 @@ gimp_display_shell_untransform_xy (GimpDisplayShell *shell, * except that it returns its results as doubles rather than ints. **/ void -gimp_display_shell_transform_xy_f (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gdouble *nx, - gdouble *ny, - gboolean use_offsets) +gimp_display_shell_transform_xy_f (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gdouble *nx, + gdouble *ny, + gboolean use_offsets) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -272,12 +272,12 @@ gimp_display_shell_transform_xy_f (GimpDisplayShell *shell, * ints, and consequently there is no option related to rounding. **/ void -gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gdouble *nx, - gdouble *ny, - gboolean use_offsets) +gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gdouble *nx, + gdouble *ny, + gboolean use_offsets) { gint scaled_viewport_offset_x; gint scaled_viewport_offset_y; @@ -317,11 +317,11 @@ gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell, * objects can be rendered at the correct points on the display. **/ void -gimp_display_shell_transform_points (GimpDisplayShell *shell, - const GimpVector2 *points, - GdkPoint *coords, - gint n_points, - gboolean use_offsets) +gimp_display_shell_transform_points (const GimpDisplayShell *shell, + const GimpVector2 *points, + GdkPoint *coords, + gint n_points, + gboolean use_offsets) { gint offset_x = 0; gint offset_y = 0; @@ -371,11 +371,11 @@ gimp_display_shell_transform_points (GimpDisplayShell *shell, * objects can be rendered at the correct points on the display. **/ void -gimp_display_shell_transform_coords (GimpDisplayShell *shell, - const GimpCoords *image_coords, - GdkPoint *disp_coords, - gint n_coords, - gboolean use_offsets) +gimp_display_shell_transform_coords (const GimpDisplayShell *shell, + const GimpCoords *image_coords, + GdkPoint *disp_coords, + gint n_coords, + gboolean use_offsets) { gint offset_x = 0; gint offset_y = 0; @@ -425,11 +425,11 @@ gimp_display_shell_transform_coords (GimpDisplayShell *shell, * objects can be rendered at the correct points on the display. **/ void -gimp_display_shell_transform_segments (GimpDisplayShell *shell, - const BoundSeg *src_segs, - GdkSegment *dest_segs, - gint n_segs, - gboolean use_offsets) +gimp_display_shell_transform_segments (const GimpDisplayShell *shell, + const BoundSeg *src_segs, + GdkSegment *dest_segs, + gint n_segs, + gboolean use_offsets) { gint offset_x = 0; gint offset_y = 0; @@ -489,11 +489,11 @@ gimp_display_shell_transform_segments (GimpDisplayShell *shell, * that corresponds to the display viewport. **/ void -gimp_display_shell_untransform_viewport (GimpDisplayShell *shell, - gint *x, - gint *y, - gint *width, - gint *height) +gimp_display_shell_untransform_viewport (const GimpDisplayShell *shell, + gint *x, + gint *y, + gint *width, + gint *height) { gint x1, y1, x2, y2; diff --git a/app/display/gimpdisplayshell-transform.h b/app/display/gimpdisplayshell-transform.h index d13d9a84a0..4a5e746123 100644 --- a/app/display/gimpdisplayshell-transform.h +++ b/app/display/gimpdisplayshell-transform.h @@ -20,61 +20,61 @@ #define __GIMP_DISPLAY_SHELL_TRANSFORM_H__ -void gimp_display_shell_transform_coordinate (GimpDisplayShell *shell, - GimpCoords *image_coords, - GimpCoords *display_coords); -void gimp_display_shell_untransform_coordinate (GimpDisplayShell *shell, - GimpCoords *display_coords, - GimpCoords *image_coords); +void gimp_display_shell_transform_coordinate (const GimpDisplayShell *shell, + GimpCoords *image_coords, + GimpCoords *display_coords); +void gimp_display_shell_untransform_coordinate (const GimpDisplayShell *shell, + GimpCoords *display_coords, + GimpCoords *image_coords); -void gimp_display_shell_transform_xy (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gint *nx, - gint *ny, - gboolean use_offsets); -void gimp_display_shell_untransform_xy (GimpDisplayShell *shell, - gint x, - gint y, - gint *nx, - gint *ny, - gboolean round, - gboolean use_offsets); +void gimp_display_shell_transform_xy (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gint *nx, + gint *ny, + gboolean use_offsets); +void gimp_display_shell_untransform_xy (const GimpDisplayShell *shell, + gint x, + gint y, + gint *nx, + gint *ny, + gboolean round, + gboolean use_offsets); -void gimp_display_shell_transform_xy_f (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gdouble *nx, - gdouble *ny, - gboolean use_offsets); -void gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell, - gdouble x, - gdouble y, - gdouble *nx, - gdouble *ny, - gboolean use_offsets); +void gimp_display_shell_transform_xy_f (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gdouble *nx, + gdouble *ny, + gboolean use_offsets); +void gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell, + gdouble x, + gdouble y, + gdouble *nx, + gdouble *ny, + gboolean use_offsets); -void gimp_display_shell_transform_points (GimpDisplayShell *shell, - const GimpVector2 *points, - GdkPoint *coords, - gint n_points, - gboolean use_offsets); -void gimp_display_shell_transform_coords (GimpDisplayShell *shell, - const GimpCoords *image_coords, - GdkPoint *disp_coords, - gint n_coords, - gboolean use_offsets); -void gimp_display_shell_transform_segments (GimpDisplayShell *shell, - const BoundSeg *src_segs, - GdkSegment *dest_segs, - gint n_segs, - gboolean use_offsets); +void gimp_display_shell_transform_points (const GimpDisplayShell *shell, + const GimpVector2 *points, + GdkPoint *coords, + gint n_points, + gboolean use_offsets); +void gimp_display_shell_transform_coords (const GimpDisplayShell *shell, + const GimpCoords *image_coords, + GdkPoint *disp_coords, + gint n_coords, + gboolean use_offsets); +void gimp_display_shell_transform_segments (const GimpDisplayShell *shell, + const BoundSeg *src_segs, + GdkSegment *dest_segs, + gint n_segs, + gboolean use_offsets); -void gimp_display_shell_untransform_viewport (GimpDisplayShell *shell, - gint *x, - gint *y, - gint *width, - gint *height); +void gimp_display_shell_untransform_viewport (const GimpDisplayShell *shell, + gint *x, + gint *y, + gint *width, + gint *height); #endif /* __GIMP_DISPLAY_SHELL_TRANSFORM_H__ */