diff options
author | Michael Natterer <mitch@imendio.com> | 2008-01-15 15:32:37 +0000 |
---|---|---|
committer | Michael Natterer <mitch@src.gnome.org> | 2008-01-15 15:32:37 +0000 |
commit | 8243e3d4152193addb53c2b9cffc1b48e144efc8 (patch) | |
tree | f4b02f16c0506ab522799735e563675a61176b75 /gdk | |
parent | 7a658c13896c43790ab65c6b05f0b807a76d5ea3 (diff) | |
download | gtk+-8243e3d4152193addb53c2b9cffc1b48e144efc8.tar.gz |
gdk/gdkdisplay.h gdk/gdkdrawable.h gdk/gdkevents.h gdk/gdkpango.h
2008-01-15 Michael Natterer <mitch@imendio.com>
* gdk/gdkdisplay.h
* gdk/gdkdrawable.h
* gdk/gdkevents.h
* gdk/gdkpango.h
* gdk/gdkregion.h
* gdk/gdkrgb.h
* gdk/gdkwindow.h: made more struct pointer and array parameters
const. GDK should now be constified as far as possible without
breaking source compatibility. Includes some minor cleanup like
indentation and s/nfoo/n_foo/ (bug #508544).
* gdk/gdkdisplay.c
* gdk/gdkdraw.c
* gdk/gdkevents.c
* gdk/gdkpango.c
* gdk/gdkregion-generic.c
* gdk/gdkrgb.c
* gdk/directfb/gdkdisplay-directfb.c
* gdk/directfb/gdkwindow-directfb.c
* gdk/quartz/gdkdisplay-quartz.c
* gdk/quartz/gdkwindow-quartz.c
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkwindow-win32.c
* gdk/x11/gdkdisplay-x11.c
* gdk/x11/gdkwindow-x11.c: changed accordingly.
svn path=/trunk/; revision=19372
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/directfb/gdkdisplay-directfb.c | 10 | ||||
-rw-r--r-- | gdk/directfb/gdkwindow-directfb.c | 6 | ||||
-rw-r--r-- | gdk/gdkdisplay.c | 4 | ||||
-rw-r--r-- | gdk/gdkdisplay.h | 20 | ||||
-rw-r--r-- | gdk/gdkdraw.c | 129 | ||||
-rw-r--r-- | gdk/gdkdrawable.h | 42 | ||||
-rw-r--r-- | gdk/gdkevents.c | 34 | ||||
-rw-r--r-- | gdk/gdkevents.h | 22 | ||||
-rw-r--r-- | gdk/gdkpango.c | 6 | ||||
-rw-r--r-- | gdk/gdkpango.h | 4 | ||||
-rw-r--r-- | gdk/gdkregion-generic.c | 32 | ||||
-rw-r--r-- | gdk/gdkregion.h | 2 | ||||
-rw-r--r-- | gdk/gdkrgb.c | 330 | ||||
-rw-r--r-- | gdk/gdkrgb.h | 12 | ||||
-rw-r--r-- | gdk/gdkwindow.h | 8 | ||||
-rw-r--r-- | gdk/quartz/gdkdisplay-quartz.c | 10 | ||||
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 6 | ||||
-rw-r--r-- | gdk/win32/gdkdisplay-win32.c | 10 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 10 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 6 |
21 files changed, 361 insertions, 348 deletions
diff --git a/gdk/directfb/gdkdisplay-directfb.c b/gdk/directfb/gdkdisplay-directfb.c index 04275fee27..3ea40032dd 100644 --- a/gdk/directfb/gdkdisplay-directfb.c +++ b/gdk/directfb/gdkdisplay-directfb.c @@ -250,11 +250,11 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display) } void -gdk_display_store_clipboard (GdkDisplay *display, - GdkWindow *clipboard_window, - guint32 time_, - GdkAtom *targets, - gint n_targets) +gdk_display_store_clipboard (GdkDisplay *display, + GdkWindow *clipboard_window, + guint32 time_, + const GdkAtom *targets, + gint n_targets) { g_warning("gdk_display_store_clipboard Unimplemented function \n"); diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c index 122d54ed2b..25d8ecc724 100644 --- a/gdk/directfb/gdkwindow-directfb.c +++ b/gdk/directfb/gdkwindow-directfb.c @@ -1707,9 +1707,9 @@ gdk_window_set_hints (GdkWindow *window, } void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) +gdk_window_set_geometry_hints (GdkWindow *window, + const GdkGeometry *geometry, + GdkWindowHints geom_mask) { g_return_if_fail (GDK_IS_WINDOW (window)); diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index 36d46ca050..769d086960 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -251,8 +251,8 @@ gdk_display_peek_event (GdkDisplay *display) * Since: 2.2 **/ void -gdk_display_put_event (GdkDisplay *display, - GdkEvent *event) +gdk_display_put_event (GdkDisplay *display, + const GdkEvent *event) { g_return_if_fail (GDK_IS_DISPLAY (display)); g_return_if_fail (event != NULL); diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index b55b312257..f2eef22535 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -122,10 +122,10 @@ void gdk_display_close (GdkDisplay *display); GList * gdk_display_list_devices (GdkDisplay *display); -GdkEvent* gdk_display_get_event (GdkDisplay *display); -GdkEvent* gdk_display_peek_event (GdkDisplay *display); -void gdk_display_put_event (GdkDisplay *display, - GdkEvent *event); +GdkEvent* gdk_display_get_event (GdkDisplay *display); +GdkEvent* gdk_display_peek_event (GdkDisplay *display); +void gdk_display_put_event (GdkDisplay *display, + const GdkEvent *event); void gdk_display_add_client_message_filter (GdkDisplay *display, GdkAtom message_type, @@ -172,12 +172,12 @@ gboolean gdk_display_supports_selection_notification (GdkDisplay *display); gboolean gdk_display_request_selection_notification (GdkDisplay *display, GdkAtom selection); -gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display); -void gdk_display_store_clipboard (GdkDisplay *display, - GdkWindow *clipboard_window, - guint32 time_, - GdkAtom *targets, - gint n_targets); +gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display); +void gdk_display_store_clipboard (GdkDisplay *display, + GdkWindow *clipboard_window, + guint32 time_, + const GdkAtom *targets, + gint n_targets); gboolean gdk_display_supports_shapes (GdkDisplay *display); gboolean gdk_display_supports_input_shapes (GdkDisplay *display); diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 39c8f7f22f..66cac1629d 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -467,22 +467,23 @@ gdk_draw_arc (GdkDrawable *drawable, * necessary. * @points: an array of #GdkPoint structures specifying the points making * up the polygon. - * @npoints: the number of points. + * @n_points: the number of points. * * Draws an outlined or filled polygon. **/ void -gdk_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - GdkPoint *points, - gint npoints) +gdk_draw_polygon (GdkDrawable *drawable, + GdkGC *gc, + gboolean filled, + const GdkPoint *points, + gint n_points) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); g_return_if_fail (GDK_IS_GC (gc)); GDK_DRAWABLE_GET_CLASS (drawable)->draw_polygon (drawable, gc, filled, - points, npoints); + (GdkPoint *) points, + n_points); } /* gdk_draw_string @@ -741,17 +742,17 @@ gdk_draw_image (GdkDrawable *drawable, **/ void gdk_draw_pixbuf (GdkDrawable *drawable, - GdkGC *gc, - GdkPixbuf *pixbuf, - gint src_x, - gint src_y, - gint dest_x, - gint dest_y, - gint width, - gint height, - GdkRgbDither dither, - gint x_dither, - gint y_dither) + GdkGC *gc, + const GdkPixbuf *pixbuf, + gint src_x, + gint src_y, + gint dest_x, + gint dest_y, + gint width, + gint height, + GdkRgbDither dither, + gint x_dither, + gint y_dither) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); g_return_if_fail (gc == NULL || GDK_IS_GC (gc)); @@ -765,7 +766,8 @@ gdk_draw_pixbuf (GdkDrawable *drawable, if (height == -1) height = gdk_pixbuf_get_height (pixbuf); - GDK_DRAWABLE_GET_CLASS (drawable)->draw_pixbuf (drawable, gc, pixbuf, + GDK_DRAWABLE_GET_CLASS (drawable)->draw_pixbuf (drawable, gc, + (GdkPixbuf *) pixbuf, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither); @@ -776,26 +778,27 @@ gdk_draw_pixbuf (GdkDrawable *drawable, * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap). * @gc: a #GdkGC. * @points: an array of #GdkPoint structures. - * @npoints: the number of points to be drawn. + * @n_points: the number of points to be drawn. * * Draws a number of points, using the foreground color and other * attributes of the #GdkGC. **/ void -gdk_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) +gdk_draw_points (GdkDrawable *drawable, + GdkGC *gc, + const GdkPoint *points, + gint n_points) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail ((points != NULL) && (npoints > 0)); + g_return_if_fail ((points != NULL) && (n_points > 0)); g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (npoints >= 0); + g_return_if_fail (n_points >= 0); - if (npoints == 0) + if (n_points == 0) return; - GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, points, npoints); + GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, + (GdkPoint *) points, n_points); } /** @@ -804,27 +807,28 @@ gdk_draw_points (GdkDrawable *drawable, * @gc: a #GdkGC. * @segs: an array of #GdkSegment structures specifying the start and * end points of the lines to be drawn. - * @nsegs: the number of line segments to draw, i.e. the size of the + * @n_segs: the number of line segments to draw, i.e. the size of the * @segs array. * * Draws a number of unconnected lines. **/ void -gdk_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs) +gdk_draw_segments (GdkDrawable *drawable, + GdkGC *gc, + const GdkSegment *segs, + gint n_segs) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - if (nsegs == 0) + if (n_segs == 0) return; g_return_if_fail (segs != NULL); g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (nsegs >= 0); + g_return_if_fail (n_segs >= 0); - GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, segs, nsegs); + GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, + (GdkSegment *) segs, n_segs); } /** @@ -832,7 +836,7 @@ gdk_draw_segments (GdkDrawable *drawable, * @drawable: a #GdkDrawable (a #GdkWindow or a #GdkPixmap). * @gc: a #GdkGC. * @points: an array of #GdkPoint structures specifying the endpoints of the - * @npoints: the size of the @points array. + * @n_points: the size of the @points array. * * Draws a series of lines connecting the given points. * The way in which joins between lines are draw is determined by the @@ -840,30 +844,31 @@ gdk_draw_segments (GdkDrawable *drawable, * gdk_gc_set_line_attributes(). **/ void -gdk_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) +gdk_draw_lines (GdkDrawable *drawable, + GdkGC *gc, + const GdkPoint *points, + gint n_points) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); g_return_if_fail (points != NULL); g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (npoints >= 0); + g_return_if_fail (n_points >= 0); - if (npoints == 0) + if (n_points == 0) return; - GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, points, npoints); + GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, + (GdkPoint *) points, n_points); } static void -real_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gdouble x, - gdouble y, - PangoGlyphString *glyphs) +real_draw_glyphs (GdkDrawable *drawable, + GdkGC *gc, + const PangoMatrix *matrix, + PangoFont *font, + gdouble x, + gdouble y, + PangoGlyphString *glyphs) { cairo_t *cr; @@ -948,13 +953,13 @@ gdk_draw_glyphs (GdkDrawable *drawable, * Since: 2.6 **/ void -gdk_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) +gdk_draw_glyphs_transformed (GdkDrawable *drawable, + GdkGC *gc, + const PangoMatrix *matrix, + PangoFont *font, + gint x, + gint y, + PangoGlyphString *glyphs) { g_return_if_fail (GDK_IS_DRAWABLE (drawable)); g_return_if_fail (GDK_IS_GC (gc)); @@ -979,10 +984,10 @@ gdk_draw_glyphs_transformed (GdkDrawable *drawable, * Since: 2.6 **/ void -gdk_draw_trapezoids (GdkDrawable *drawable, - GdkGC *gc, - GdkTrapezoid *trapezoids, - gint n_trapezoids) +gdk_draw_trapezoids (GdkDrawable *drawable, + GdkGC *gc, + const GdkTrapezoid *trapezoids, + gint n_trapezoids) { cairo_t *cr; int i; diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index ccaa364416..bbd6a4dc37 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -109,7 +109,7 @@ struct _GdkDrawableClass GdkGC *gc, GdkSegment *segs, gint nsegs); - void (*draw_lines) (GdkDrawable *drawable, + void (*draw_lines) (GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints); @@ -276,8 +276,8 @@ void gdk_draw_arc (GdkDrawable *drawable, void gdk_draw_polygon (GdkDrawable *drawable, GdkGC *gc, gboolean filled, - GdkPoint *points, - gint npoints); + const GdkPoint *points, + gint n_points); #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) /* Used by gtk_default_draw_string () */ void gdk_draw_string (GdkDrawable *drawable, @@ -325,19 +325,19 @@ void gdk_draw_image (GdkDrawable *drawable, gint height); void gdk_draw_points (GdkDrawable *drawable, GdkGC *gc, - GdkPoint *points, - gint npoints); + const GdkPoint *points, + gint n_points); void gdk_draw_segments (GdkDrawable *drawable, GdkGC *gc, - GdkSegment *segs, - gint nsegs); + const GdkSegment *segs, + gint n_segs); void gdk_draw_lines (GdkDrawable *drawable, GdkGC *gc, - GdkPoint *points, - gint npoints); + const GdkPoint *points, + gint n_points); void gdk_draw_pixbuf (GdkDrawable *drawable, GdkGC *gc, - GdkPixbuf *pixbuf, + const GdkPixbuf *pixbuf, gint src_x, gint src_y, gint dest_x, @@ -380,17 +380,17 @@ void gdk_draw_layout_with_colors (GdkDrawable *drawable, const GdkColor *foreground, const GdkColor *background); -void gdk_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); -void gdk_draw_trapezoids (GdkDrawable *drawable, - GdkGC *gc, - GdkTrapezoid *trapezoids, - gint n_trapezoids); +void gdk_draw_glyphs_transformed (GdkDrawable *drawable, + GdkGC *gc, + const PangoMatrix *matrix, + PangoFont *font, + gint x, + gint y, + PangoGlyphString *glyphs); +void gdk_draw_trapezoids (GdkDrawable *drawable, + GdkGC *gc, + const GdkTrapezoid *trapezoids, + gint n_trapezoids); #ifndef GDK_DISABLE_DEPRECATED #define gdk_draw_pixmap gdk_draw_drawable diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index f81d5eb363..b7b49b140a 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -237,7 +237,7 @@ gdk_event_peek (void) * queue if event->any.window is %NULL. See gdk_display_put_event(). **/ void -gdk_event_put (GdkEvent *event) +gdk_event_put (const GdkEvent *event) { GdkDisplay *display; @@ -332,7 +332,7 @@ gdk_event_new (GdkEventType type) } static gboolean -gdk_event_is_allocated (GdkEvent *event) +gdk_event_is_allocated (const GdkEvent *event) { if (event_hash) return g_hash_table_lookup (event_hash, event) != NULL; @@ -351,7 +351,7 @@ gdk_event_is_allocated (GdkEvent *event) * gdk_event_free(). **/ GdkEvent* -gdk_event_copy (GdkEvent *event) +gdk_event_copy (const GdkEvent *event) { GdkEventPrivate *new_private; GdkEvent *new_event; @@ -499,7 +499,7 @@ gdk_event_free (GdkEvent *event) * Return value: time stamp field from @event **/ guint32 -gdk_event_get_time (GdkEvent *event) +gdk_event_get_time (const GdkEvent *event) { if (event) switch (event->type) @@ -570,8 +570,8 @@ gdk_event_get_time (GdkEvent *event) * Return value: %TRUE if there was a state field in the event **/ gboolean -gdk_event_get_state (GdkEvent *event, - GdkModifierType *state) +gdk_event_get_state (const GdkEvent *event, + GdkModifierType *state) { g_return_val_if_fail (state != NULL, FALSE); @@ -646,9 +646,9 @@ gdk_event_get_state (GdkEvent *event, * Return value: %TRUE if the event delivered event window coordinates **/ gboolean -gdk_event_get_coords (GdkEvent *event, - gdouble *x_win, - gdouble *y_win) +gdk_event_get_coords (const GdkEvent *event, + gdouble *x_win, + gdouble *y_win) { gdouble x = 0, y = 0; gboolean fetched = TRUE; @@ -705,9 +705,9 @@ gdk_event_get_coords (GdkEvent *event, * Return value: %TRUE if the event delivered root window coordinates **/ gboolean -gdk_event_get_root_coords (GdkEvent *event, - gdouble *x_root, - gdouble *y_root) +gdk_event_get_root_coords (const GdkEvent *event, + gdouble *x_root, + gdouble *y_root) { gdouble x = 0, y = 0; gboolean fetched = TRUE; @@ -770,9 +770,9 @@ gdk_event_get_root_coords (GdkEvent *event, * Return value: %TRUE if the specified axis was found, otherwise %FALSE **/ gboolean -gdk_event_get_axis (GdkEvent *event, - GdkAxisUse axis_use, - gdouble *value) +gdk_event_get_axis (const GdkEvent *event, + GdkAxisUse axis_use, + gdouble *value) { gdouble *axes; GdkDevice *device; @@ -856,7 +856,7 @@ gdk_event_get_axis (GdkEvent *event, * Since: 2.12 **/ void -gdk_event_request_motions (GdkEventMotion *event) +gdk_event_request_motions (const GdkEventMotion *event) { g_return_if_fail (event != NULL); if (event->type == GDK_MOTION_NOTIFY && event->is_hint) @@ -904,7 +904,7 @@ gdk_event_set_screen (GdkEvent *event, * Since: 2.2 **/ GdkScreen * -gdk_event_get_screen (GdkEvent *event) +gdk_event_get_screen (const GdkEvent *event) { if (gdk_event_is_allocated (event)) { diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 5a30e99a32..809992cf70 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -511,32 +511,32 @@ GdkEvent* gdk_event_get (void); GdkEvent* gdk_event_peek (void); GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window); -void gdk_event_put (GdkEvent *event); +void gdk_event_put (const GdkEvent *event); GdkEvent* gdk_event_new (GdkEventType type); -GdkEvent* gdk_event_copy (GdkEvent *event); +GdkEvent* gdk_event_copy (const GdkEvent *event); void gdk_event_free (GdkEvent *event); -guint32 gdk_event_get_time (GdkEvent *event); -gboolean gdk_event_get_state (GdkEvent *event, +guint32 gdk_event_get_time (const GdkEvent *event); +gboolean gdk_event_get_state (const GdkEvent *event, GdkModifierType *state); -gboolean gdk_event_get_coords (GdkEvent *event, +gboolean gdk_event_get_coords (const GdkEvent *event, gdouble *x_win, gdouble *y_win); -gboolean gdk_event_get_root_coords (GdkEvent *event, +gboolean gdk_event_get_root_coords (const GdkEvent *event, gdouble *x_root, gdouble *y_root); -gboolean gdk_event_get_axis (GdkEvent *event, +gboolean gdk_event_get_axis (const GdkEvent *event, GdkAxisUse axis_use, gdouble *value); -void gdk_event_request_motions (GdkEventMotion *event); +void gdk_event_request_motions (const GdkEventMotion *event); void gdk_event_handler_set (GdkEventFunc func, gpointer data, GDestroyNotify notify); -void gdk_event_set_screen (GdkEvent *event, - GdkScreen *screen); -GdkScreen *gdk_event_get_screen (GdkEvent *event); +void gdk_event_set_screen (GdkEvent *event, + GdkScreen *screen); +GdkScreen *gdk_event_get_screen (const GdkEvent *event); void gdk_set_show_events (gboolean show_events); gboolean gdk_get_show_events (void); diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index 6bc0cffdf2..1caec30e93 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -1214,7 +1214,7 @@ static GdkRegion* layout_iter_get_line_clip_region (PangoLayoutIter *iter, gint x_origin, gint y_origin, - gint *index_ranges, + const gint *index_ranges, gint n_ranges) { PangoLayoutLine *line; @@ -1297,7 +1297,7 @@ GdkRegion* gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, gint x_origin, gint y_origin, - gint *index_ranges, + const gint *index_ranges, gint n_ranges) { GdkRegion *clip_region; @@ -1341,7 +1341,7 @@ GdkRegion* gdk_pango_layout_get_clip_region (PangoLayout *layout, gint x_origin, gint y_origin, - gint *index_ranges, + const gint *index_ranges, gint n_ranges) { PangoLayoutIter *iter; diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h index b2fef357ca..ce6bf848f6 100644 --- a/gdk/gdkpango.h +++ b/gdk/gdkpango.h @@ -119,12 +119,12 @@ void gdk_pango_context_set_colormap (PangoContext *context, GdkRegion *gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, gint x_origin, gint y_origin, - gint *index_ranges, + const gint *index_ranges, gint n_ranges); GdkRegion *gdk_pango_layout_get_clip_region (PangoLayout *layout, gint x_origin, gint y_origin, - gint *index_ranges, + const gint *index_ranges, gint n_ranges); diff --git a/gdk/gdkregion-generic.c b/gdk/gdkregion-generic.c index f8f54a3f48..178468332c 100644 --- a/gdk/gdkregion-generic.c +++ b/gdk/gdkregion-generic.c @@ -1689,17 +1689,16 @@ gdk_region_rect_in (const GdkRegion *region, static void -gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, - GdkSpan *spans, - int n_spans, - GdkSpanFunc function, - gpointer data) +gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, + const GdkSpan *spans, + int n_spans, + GdkSpanFunc function, + gpointer data) { gint i, left, right, y; gint clipped_left, clipped_right; GdkRegionBox *pbox; GdkRegionBox *pboxEnd; - GdkSpan out_span; if (!region->numRects) return; @@ -1729,6 +1728,8 @@ gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, if ((right > pbox->x1) && (left < pbox->x2)) { + GdkSpan out_span; + clipped_left = MAX (left, pbox->x1); clipped_right = MIN (right, pbox->x2); @@ -1753,20 +1754,19 @@ gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, * Calls a function on each span in the intersection of @region and @spans. */ void -gdk_region_spans_intersect_foreach (GdkRegion *region, - GdkSpan *spans, - int n_spans, - gboolean sorted, - GdkSpanFunc function, - gpointer data) +gdk_region_spans_intersect_foreach (GdkRegion *region, + const GdkSpan *spans, + int n_spans, + gboolean sorted, + GdkSpanFunc function, + gpointer data) { gint left, right, y; gint clipped_left, clipped_right; GdkRegionBox *pbox; GdkRegionBox *pboxEnd; - GdkSpan *span, *tmpspan; - GdkSpan *end_span; - GdkSpan out_span; + const GdkSpan *span, *tmpspan; + const GdkSpan *end_span; g_return_if_fail (region != NULL); g_return_if_fail (spans != NULL); @@ -1825,6 +1825,8 @@ gdk_region_spans_intersect_foreach (GdkRegion *region, if ((right > pbox->x1) && (left < pbox->x2)) { + GdkSpan out_span; + clipped_left = MAX (left, pbox->x1); clipped_right = MIN (right, pbox->x2); diff --git a/gdk/gdkregion.h b/gdk/gdkregion.h index f8a97f6114..e2c1a76560 100644 --- a/gdk/gdkregion.h +++ b/gdk/gdkregion.h @@ -97,7 +97,7 @@ void gdk_region_xor (GdkRegion *source1, const GdkRegion *source2); void gdk_region_spans_intersect_foreach (GdkRegion *region, - GdkSpan *spans, + const GdkSpan *spans, int n_spans, gboolean sorted, GdkSpanFunc function, diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c index 6b9b84c761..2e93ef3744 100644 --- a/gdk/gdkrgb.c +++ b/gdk/gdkrgb.c @@ -50,7 +50,7 @@ typedef struct _GdkRgbCmapInfo GdkRgbCmapInfo; typedef void (*GdkRgbConvFunc) (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap); @@ -849,13 +849,13 @@ gdk_rgb_find_color (GdkColormap *colormap, GdkColor *color) static void gdk_rgb_convert_8 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; guchar *colorcube = image_info->colorcube; @@ -925,13 +925,13 @@ gdk_rgb_convert_8 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_8 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; guchar *colorcube = image_info->colorcube; @@ -1298,13 +1298,13 @@ gdk_rgb_preprocess_dm_565 (void) static void gdk_rgb_convert_8_d666 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint dith; @@ -1338,14 +1338,14 @@ gdk_rgb_convert_8_d666 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_8_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint dith; @@ -1383,13 +1383,13 @@ gdk_rgb_convert_8_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_8_indexed (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar c; guchar *lut; GdkRgbCmapInfo *cmap_info = gdk_rgb_cmap_get_info (cmap, image_info); @@ -1416,13 +1416,13 @@ gdk_rgb_convert_8_indexed (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray8 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; bptr = buf; @@ -1448,13 +1448,13 @@ gdk_rgb_convert_gray8 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray8_gray (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int y; gint bpl; guchar *obuf; - guchar *bptr; + const guchar *bptr; bptr = buf; bpl = image->bpl; @@ -1483,13 +1483,13 @@ gdk_rgb_convert_gray8_gray (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar r, g, b; bptr = buf; @@ -1580,13 +1580,13 @@ gdk_rgb_convert_565 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar r, g, b; bptr = buf; @@ -1614,13 +1614,13 @@ gdk_rgb_convert_565 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565_gray (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar g; bptr = buf; @@ -1682,13 +1682,13 @@ gdk_rgb_convert_565_gray (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565_gray (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar g; bptr = buf; @@ -1713,13 +1713,13 @@ gdk_rgb_convert_565_gray (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565_br (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar r, g, b; bptr = buf; @@ -1751,15 +1751,15 @@ gdk_rgb_convert_565_br (GdkRgbInfo *image_info, GdkImage *image, #ifdef HAIRY_CONVERT_565 static void gdk_rgb_convert_565_d (GdkRgbInfo *image_info, GdkImage *image, - gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, - gint x_align, gint y_align, GdkRgbCmap *cmap) + gint x0, gint y0, gint width, gint height, + const guchar *buf, int rowstride, + gint x_align, gint y_align, GdkRgbCmap *cmap) { /* Now this is what I'd call some highly tuned code! */ int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; width += x_align; height += y_align; @@ -1877,13 +1877,13 @@ gdk_rgb_convert_565_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_565_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr; + const guchar *bptr; width += x_align; height += y_align; @@ -1922,13 +1922,13 @@ gdk_rgb_convert_565_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_555 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar r, g, b; bptr = buf; @@ -1954,13 +1954,13 @@ gdk_rgb_convert_555 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_555_br (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; guchar r, g, b; bptr = buf; @@ -1990,13 +1990,13 @@ gdk_rgb_convert_555_br (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_888_msb (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int y; guchar *obuf; gint bpl; - guchar *bptr; + const guchar *bptr; bptr = buf; bpl = image->bpl; @@ -2018,13 +2018,13 @@ gdk_rgb_convert_888_msb (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_888_lsb (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; int r, g, b; bptr = buf; @@ -2092,13 +2092,13 @@ gdk_rgb_convert_888_lsb (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_888_lsb (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; int r, g, b; bptr = buf; @@ -2128,13 +2128,13 @@ gdk_rgb_convert_888_lsb (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_0888 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int y, w; guchar *obuf, *p; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; bptr = buf; bpl = image->bpl; @@ -2163,13 +2163,13 @@ gdk_rgb_convert_0888 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_0888_medialib (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int y, w; guchar *obuf, *p; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; bptr = buf; bpl = image->bpl; @@ -2184,13 +2184,13 @@ gdk_rgb_convert_0888_medialib (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_0888_br (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int y, w; guchar *obuf, *p; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; bptr = buf; bpl = image->bpl; @@ -2217,13 +2217,13 @@ gdk_rgb_convert_0888_br (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_8880_br (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; int r, g, b; bptr = buf; @@ -2250,14 +2250,14 @@ gdk_rgb_convert_8880_br (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_truecolor_lsb (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint r_right, r_left; gint g_right, g_left; @@ -2304,14 +2304,14 @@ gdk_rgb_convert_truecolor_lsb (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_truecolor_lsb_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint r_right, r_left, r_prec; gint g_right, g_left, g_prec; @@ -2369,14 +2369,14 @@ gdk_rgb_convert_truecolor_lsb_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_truecolor_msb (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint r_right, r_left; gint g_right, g_left; @@ -2423,14 +2423,14 @@ gdk_rgb_convert_truecolor_msb (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_truecolor_msb_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; guchar *obuf, *obptr; gint bpl; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint r_right, r_left, r_prec; gint g_right, g_left, g_prec; @@ -2489,14 +2489,14 @@ gdk_rgb_convert_truecolor_msb_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_4 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint dith; @@ -2529,14 +2529,14 @@ gdk_rgb_convert_4 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_4_pack (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y, ix; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint dith; @@ -2603,13 +2603,13 @@ gdk_rgb_convert_4_pack (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray4 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint shift; @@ -2637,13 +2637,13 @@ gdk_rgb_convert_gray4 (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray4_pack (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; gint shift; guchar pix0, pix1; @@ -2697,13 +2697,13 @@ gdk_rgb_convert_gray4_pack (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray4_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint prec, right; @@ -2737,13 +2737,13 @@ gdk_rgb_convert_gray4_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray4_d_pack (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint prec, right; @@ -2806,14 +2806,14 @@ gdk_rgb_convert_gray4_d_pack (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_1 (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, int rowstride, + const guchar *buf, int rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { int x, y; gint bpl; guchar *obuf, *obptr; - guchar *bptr, *bp2; + const guchar *bptr, *bp2; gint r, g, b; const guchar *dmp; gint dith; @@ -2860,11 +2860,13 @@ gdk_rgb_ensure_stage (GdkRgbInfo *image_info) /* This is slow. Speed me up, please. */ static void gdk_rgb_32_to_stage (GdkRgbInfo *image_info, - guchar *buf, gint rowstride, gint width, gint height) + const guchar *buf, gint rowstride, gint width, gint height) { gint x, y; - guchar *pi_start, *po_start; - guchar *pi, *po; + const guchar *pi_start; + guchar *po_start; + const guchar *pi; + guchar *po; pi_start = buf; po_start = gdk_rgb_ensure_stage (image_info); @@ -2889,7 +2891,7 @@ gdk_rgb_32_to_stage (GdkRgbInfo *image_info, static void gdk_rgb_convert_32_generic (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { gdk_rgb_32_to_stage (image_info, buf, rowstride, width, height); @@ -2904,7 +2906,7 @@ gdk_rgb_convert_32_generic (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_32_generic_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { gdk_rgb_32_to_stage (image_info, buf, rowstride, width, height); @@ -2917,11 +2919,13 @@ gdk_rgb_convert_32_generic_d (GdkRgbInfo *image_info, GdkImage *image, /* This is slow. Speed me up, please. */ static void gdk_rgb_gray_to_stage (GdkRgbInfo *image_info, - guchar *buf, gint rowstride, gint width, gint height) + const guchar *buf, gint rowstride, gint width, gint height) { gint x, y; - guchar *pi_start, *po_start; - guchar *pi, *po; + const guchar *pi_start; + guchar *po_start; + const guchar *pi; + guchar *po; guchar gray; pi_start = buf; @@ -2947,7 +2951,7 @@ gdk_rgb_gray_to_stage (GdkRgbInfo *image_info, static void gdk_rgb_convert_gray_generic (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { gdk_rgb_gray_to_stage (image_info, buf, rowstride, width, height); @@ -2960,7 +2964,7 @@ gdk_rgb_convert_gray_generic (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray_generic_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { gdk_rgb_gray_to_stage (image_info, buf, rowstride, width, height); @@ -2974,7 +2978,7 @@ gdk_rgb_convert_gray_generic_d (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray_cmap (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { (*image_info->conv_indexed) (image_info, image, x0, y0, width, height, @@ -2986,7 +2990,7 @@ gdk_rgb_convert_gray_cmap (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_gray_cmap_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { (*image_info->conv_indexed_d) (image_info, image, x0, y0, width, height, @@ -2998,12 +3002,14 @@ gdk_rgb_convert_gray_cmap_d (GdkRgbInfo *image_info, GdkImage *image, /* This is slow. Speed me up, please. */ static void gdk_rgb_indexed_to_stage (GdkRgbInfo *image_info, - guchar *buf, gint rowstride, gint width, gint height, + const guchar *buf, gint rowstride, gint width, gint height, GdkRgbCmap *cmap) { gint x, y; - guchar *pi_start, *po_start; - guchar *pi, *po; + const guchar *pi_start; + guchar *po_start; + const guchar *pi; + guchar *po; gint rgb; pi_start = buf; @@ -3029,7 +3035,7 @@ gdk_rgb_indexed_to_stage (GdkRgbInfo *image_info, static void gdk_rgb_convert_indexed_generic (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { gdk_rgb_indexed_to_stage (image_info, buf, rowstride, width, height, cmap); @@ -3042,7 +3048,7 @@ gdk_rgb_convert_indexed_generic (GdkRgbInfo *image_info, GdkImage *image, static void gdk_rgb_convert_indexed_generic_d (GdkRgbInfo *image_info, GdkImage *image, gint x0, gint y0, gint width, gint height, - guchar *buf, gint rowstride, + const guchar *buf, gint rowstride, gint x_align, gint y_align, GdkRgbCmap *cmap) { @@ -3289,26 +3295,26 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info) } static void -gdk_draw_rgb_image_core (GdkRgbInfo *image_info, - GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - guchar *buf, - gint pixstride, - gint rowstride, - GdkRgbConvFunc conv, - GdkRgbCmap *cmap, - gint xdith, - gint ydith) +gdk_draw_rgb_image_core (GdkRgbInfo *image_info, + GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + const guchar *buf, + gint pixstride, + gint rowstride, + GdkRgbConvFunc conv, + GdkRgbCmap *cmap, + gint xdith, + gint ydith) { gint y0, x0; gint xs0, ys0; GdkImage *image; gint width1, height1; - guchar *buf_ptr; + const guchar *buf_ptr; if (image_info->bitmap) { @@ -3370,15 +3376,15 @@ gdk_rgb_get_info_from_drawable (GdkDrawable *drawable) } void -gdk_draw_rgb_image (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *rgb_buf, - gint rowstride) +gdk_draw_rgb_image (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *rgb_buf, + gint rowstride) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) @@ -3396,17 +3402,17 @@ gdk_draw_rgb_image (GdkDrawable *drawable, } void -gdk_draw_rgb_image_dithalign (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *rgb_buf, - gint rowstride, - gint xdith, - gint ydith) +gdk_draw_rgb_image_dithalign (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *rgb_buf, + gint rowstride, + gint xdith, + gint ydith) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) @@ -3424,15 +3430,15 @@ gdk_draw_rgb_image_dithalign (GdkDrawable *drawable, } void -gdk_draw_rgb_32_image (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *buf, - gint rowstride) +gdk_draw_rgb_32_image (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *buf, + gint rowstride) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) @@ -3468,17 +3474,17 @@ gdk_draw_rgb_32_image (GdkDrawable *drawable, * **/ void -gdk_draw_rgb_32_image_dithalign (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *buf, - gint rowstride, - gint xdith, - gint ydith) +gdk_draw_rgb_32_image_dithalign (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *buf, + gint rowstride, + gint xdith, + gint ydith) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) @@ -3507,15 +3513,15 @@ gdk_rgb_make_gray_cmap (GdkRgbInfo *info) } void -gdk_draw_gray_image (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *buf, - gint rowstride) +gdk_draw_gray_image (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *buf, + gint rowstride) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) @@ -3623,16 +3629,16 @@ gdk_rgb_cmap_free (GdkRgbCmap *cmap) } void -gdk_draw_indexed_image (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - gint width, - gint height, - GdkRgbDither dith, - guchar *buf, - gint rowstride, - GdkRgbCmap *cmap) +gdk_draw_indexed_image (GdkDrawable *drawable, + GdkGC *gc, + gint x, + gint y, + gint width, + gint height, + GdkRgbDither dith, + const guchar *buf, + gint rowstride, + GdkRgbCmap *cmap) { GdkRgbInfo *image_info = gdk_rgb_get_info_from_drawable (drawable); if (!image_info) diff --git a/gdk/gdkrgb.h b/gdk/gdkrgb.h index f063383345..cc3d515306 100644 --- a/gdk/gdkrgb.h +++ b/gdk/gdkrgb.h @@ -69,7 +69,7 @@ void gdk_draw_rgb_image (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *rgb_buf, + const guchar *rgb_buf, gint rowstride); void gdk_draw_rgb_image_dithalign (GdkDrawable *drawable, GdkGC *gc, @@ -78,7 +78,7 @@ void gdk_draw_rgb_image_dithalign (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *rgb_buf, + const guchar *rgb_buf, gint rowstride, gint xdith, gint ydith); @@ -89,7 +89,7 @@ void gdk_draw_rgb_32_image (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *buf, + const guchar *buf, gint rowstride); void gdk_draw_rgb_32_image_dithalign (GdkDrawable *drawable, GdkGC *gc, @@ -98,7 +98,7 @@ void gdk_draw_rgb_32_image_dithalign (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *buf, + const guchar *buf, gint rowstride, gint xdith, gint ydith); @@ -109,7 +109,7 @@ void gdk_draw_gray_image (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *buf, + const guchar *buf, gint rowstride); void gdk_draw_indexed_image (GdkDrawable *drawable, GdkGC *gc, @@ -118,7 +118,7 @@ void gdk_draw_indexed_image (GdkDrawable *drawable, gint width, gint height, GdkRgbDither dith, - guchar *buf, + const guchar *buf, gint rowstride, GdkRgbCmap *cmap); GdkRgbCmap *gdk_rgb_cmap_new (guint32 *colors, diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 608f7c0043..f0ee7f5c8d 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -475,10 +475,10 @@ void gdk_window_set_skip_pager_hint (GdkWindow *window, void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent); -void gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask); -void gdk_set_sm_client_id (const gchar *sm_client_id); +void gdk_window_set_geometry_hints (GdkWindow *window, + const GdkGeometry *geometry, + GdkWindowHints geom_mask); +void gdk_set_sm_client_id (const gchar *sm_client_id); void gdk_window_begin_paint_rect (GdkWindow *window, const GdkRectangle *rectangle); diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c index 3f9a01f254..fa8e9de4f9 100644 --- a/gdk/quartz/gdkdisplay-quartz.c +++ b/gdk/quartz/gdkdisplay-quartz.c @@ -161,11 +161,11 @@ gdk_display_supports_input_shapes (GdkDisplay *display) } void -gdk_display_store_clipboard (GdkDisplay *display, - GdkWindow *clipboard_window, - guint32 time_, - GdkAtom *targets, - gint n_targets) +gdk_display_store_clipboard (GdkDisplay *display, + GdkWindow *clipboard_window, + guint32 time_, + const GdkAtom *targets, + gint n_targets) { /* FIXME: Implement */ } diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 4e0f97a1ef..0e06368593 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -1915,9 +1915,9 @@ gdk_window_set_urgency_hint (GdkWindow *window, } void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) +gdk_window_set_geometry_hints (GdkWindow *window, + const GdkGeometry *geometry, + GdkWindowHints geom_mask) { GdkWindowImplQuartz *impl; diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 0794dfafb4..cc0246c655 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -371,11 +371,11 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display) } void -gdk_display_store_clipboard (GdkDisplay *display, - GdkWindow *clipboard_window, - guint32 time_, - GdkAtom *targets, - gint n_targets) +gdk_display_store_clipboard (GdkDisplay *display, + GdkWindow *clipboard_window, + guint32 time_, + const GdkAtom *targets, + gint n_targets) { } diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index ef3d14e648..c0905c161f 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -1844,9 +1844,9 @@ get_effective_window_decorations (GdkWindow *window, } void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) +gdk_window_set_geometry_hints (GdkWindow *window, + const GdkGeometry *geometry, + GdkWindowHints geom_mask) { GdkWindowImplWin32 *impl; diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 56eccc91f1..1cb5f67b79 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -1300,11 +1300,11 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display) * Since: 2.6 */ void -gdk_display_store_clipboard (GdkDisplay *display, - GdkWindow *clipboard_window, - guint32 time_, - GdkAtom *targets, - gint n_targets) +gdk_display_store_clipboard (GdkDisplay *display, + GdkWindow *clipboard_window, + guint32 time_, + const GdkAtom *targets, + gint n_targets) { GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); Atom clipboard_manager, save_targets; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 9741a0b751..b316bc554c 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -2588,9 +2588,9 @@ gdk_window_set_urgency_hint (GdkWindow *window, * **/ void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) +gdk_window_set_geometry_hints (GdkWindow *window, + const GdkGeometry *geometry, + GdkWindowHints geom_mask) { XSizeHints size_hints; |