Commit 92f86e04 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h

2008-01-14  Michael Natterer  <mitch@imendio.com>

	* gdk/gdk.h
	* gdk/gdkcairo.h
	* gdk/gdkcolor.h
	* gdk/gdkgc.h
	* gdk/gdkinternals.h
	* gdk/gdkregion.h
	* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
	parameters const.

	* gdk/gdkcairo.c
	* gdk/gdkgc.c
	* gdk/gdkwindow.c
	* gdk/gdkrectangle.c
	* gdk/gdkpolyreg-generic.c
	* gdk/gdkregion-generic.c
	* gdk/directfb/gdkcolor-directfb.c
	* gdk/directfb/gdkgc-directfb.c
	* gdk/directfb/gdkgeometry-directfb.c
	* gdk/directfb/gdkwindow-directfb.c
	* gdk/quartz/gdkcolor-quartz.c
	* gdk/quartz/gdkgc-quartz.c
	* gdk/quartz/gdkgeometry-quartz.c
	* gdk/quartz/gdkwindow-quartz.c
	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkgeometry-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c
	* gdk/x11/gdkcolor-x11.c
	* gdk/x11/gdkgc-x11.c
	* gdk/x11/gdkgeometry-x11.c
	* gdk/x11/gdkmain-x11.c
	* gdk/x11/gdkprivate-x11.h
	* gdk/x11/gdkwindow-x11.c: changed accordingly.

	* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
	headers.


svn path=/trunk/; revision=19365
parent 112dad66
2008-01-14 Michael Natterer <mitch@imendio.com>
* gdk/gdk.h
* gdk/gdkcairo.h
* gdk/gdkcolor.h
* gdk/gdkgc.h
* gdk/gdkinternals.h
* gdk/gdkregion.h
* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
parameters const.
* gdk/gdkcairo.c
* gdk/gdkgc.c
* gdk/gdkwindow.c
* gdk/gdkrectangle.c
* gdk/gdkpolyreg-generic.c
* gdk/gdkregion-generic.c
* gdk/directfb/gdkcolor-directfb.c
* gdk/directfb/gdkgc-directfb.c
* gdk/directfb/gdkgeometry-directfb.c
* gdk/directfb/gdkwindow-directfb.c
* gdk/quartz/gdkcolor-quartz.c
* gdk/quartz/gdkgc-quartz.c
* gdk/quartz/gdkgeometry-quartz.c
* gdk/quartz/gdkwindow-quartz.c
* gdk/win32/gdkcolor-win32.c
* gdk/win32/gdkgc-win32.c
* gdk/win32/gdkgeometry-win32.c
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkwindow-win32.c
* gdk/x11/gdkcolor-x11.c
* gdk/x11/gdkgc-x11.c
* gdk/x11/gdkgeometry-x11.c
* gdk/x11/gdkmain-x11.c
* gdk/x11/gdkprivate-x11.h
* gdk/x11/gdkwindow-x11.c: changed accordingly.
* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
headers.
2008-01-14 Mathias Hasselmann <mathias@openismus.com>
Explain name choice for gtk_tool_item_toolbar_reconfigured.
......
......@@ -287,9 +287,9 @@ gdk_colors_free (GdkColormap *colormap,
}
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
gdk_colormap_free_colors (GdkColormap *colormap,
const GdkColor *colors,
gint ncolors)
{
GdkColormapPrivateDirectFB *private;
gint i;
......
......@@ -350,8 +350,8 @@ gc_unset_clip_mask (GdkGC *gc)
void
_gdk_windowing_gc_set_clip_region (GdkGC *gc,
GdkRegion *region)
_gdk_windowing_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region)
{
GdkGCDirectFB *data;
......@@ -363,9 +363,9 @@ _gdk_windowing_gc_set_clip_region (GdkGC *gc,
return;
if (region)
temp_region_init_copy (&data->clip_region, region);
temp_region_init_copy (&data->clip_region, region);
else
temp_region_reset (&data->clip_region);
temp_region_reset (&data->clip_region);
gc->clip_x_origin = 0;
gc->clip_y_origin = 0;
......
......@@ -161,10 +161,10 @@ gdk_window_scroll (GdkWindow *window,
* Since: 2.8
**/
void
gdk_window_move_region (GdkWindow *window,
GdkRegion *region,
gint dx,
gint dy)
gdk_window_move_region (GdkWindow *window,
const GdkRegion *region,
gint dx,
gint dy)
{
GdkWindowObject *private;
GdkDrawableImplDirectFB *impl;
......
......@@ -2129,18 +2129,18 @@ gdk_window_input_shape_combine_mask (GdkWindow *window,
}
void
gdk_window_shape_combine_region (GdkWindow *window,
GdkRegion *shape_region,
gint offset_x,
gint offset_y)
gdk_window_shape_combine_region (GdkWindow *window,
const GdkRegion *shape_region,
gint offset_x,
gint offset_y)
{
}
void
gdk_window_input_shape_combine_region (GdkWindow *window,
GdkRegion *shape_region,
gint offset_x,
gint offset_y)
gdk_window_input_shape_combine_region (GdkWindow *window,
const GdkRegion *shape_region,
gint offset_x,
gint offset_y)
{
}
......
......@@ -147,12 +147,12 @@ void gdk_set_double_click_time (guint msec);
/* Rectangle utilities
*/
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
gboolean gdk_rectangle_intersect (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest);
GType gdk_rectangle_get_type (void) G_GNUC_CONST;
......
......@@ -59,8 +59,8 @@ gdk_cairo_create (GdkDrawable *drawable)
* Since: 2.8
**/
void
gdk_cairo_set_source_color (cairo_t *cr,
GdkColor *color)
gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color)
{
g_return_if_fail (cr != NULL);
g_return_if_fail (color != NULL);
......@@ -81,8 +81,8 @@ gdk_cairo_set_source_color (cairo_t *cr,
* Since: 2.8
**/
void
gdk_cairo_rectangle (cairo_t *cr,
GdkRectangle *rectangle)
gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle)
{
g_return_if_fail (cr != NULL);
g_return_if_fail (rectangle != NULL);
......@@ -102,8 +102,8 @@ gdk_cairo_rectangle (cairo_t *cr,
* Since: 2.8
**/
void
gdk_cairo_region (cairo_t *cr,
GdkRegion *region)
gdk_cairo_region (cairo_t *cr,
const GdkRegion *region)
{
GdkRegionBox *boxes;
gint n_boxes, i;
......@@ -136,10 +136,10 @@ gdk_cairo_region (cairo_t *cr,
* Since: 2.8
**/
void
gdk_cairo_set_source_pixbuf (cairo_t *cr,
GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y)
gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y)
{
gint width = gdk_pixbuf_get_width (pixbuf);
gint height = gdk_pixbuf_get_height (pixbuf);
......
......@@ -26,23 +26,23 @@
G_BEGIN_DECLS
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
void gdk_cairo_set_source_color (cairo_t *cr,
GdkColor *color);
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y);
void gdk_cairo_set_source_pixmap (cairo_t *cr,
GdkPixmap *pixmap,
double pixmap_x,
double pixmap_y);
void gdk_cairo_rectangle (cairo_t *cr,
GdkRectangle *rectangle);
void gdk_cairo_region (cairo_t *cr,
GdkRegion *region);
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
void gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color);
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y);
void gdk_cairo_set_source_pixmap (cairo_t *cr,
GdkPixmap *pixmap,
double pixmap_x,
double pixmap_y);
void gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle);
void gdk_cairo_region (cairo_t *cr,
const GdkRegion *region);
G_END_DECLS
......
......@@ -108,25 +108,25 @@ void gdk_colormap_change (GdkColormap *colormap,
gint ncolors);
#endif
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success);
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
GdkColor *color,
gboolean writeable,
gboolean best_match);
void gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
void gdk_colormap_query_color (GdkColormap *colormap,
gulong pixel,
GdkColor *result);
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint n_colors,
gboolean writeable,
gboolean best_match,
gboolean *success);
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
GdkColor *color,
gboolean writeable,
gboolean best_match);
void gdk_colormap_free_colors (GdkColormap *colormap,
const GdkColor *colors,
gint n_colors);
void gdk_colormap_query_color (GdkColormap *colormap,
gulong pixel,
GdkColor *result);
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
GdkColor *gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
gboolean gdk_color_parse (const gchar *spec,
......
......@@ -566,8 +566,8 @@ _gdk_gc_set_clip_region_internal (GdkGC *gc,
* origin. (See gdk_gc_set_clip_origin()).
**/
void
gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle)
gdk_gc_set_clip_rectangle (GdkGC *gc,
const GdkRectangle *rectangle)
{
GdkRegion *region;
......@@ -591,15 +591,19 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
* gdk_gc_set_clip_origin()).
**/
void
gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region)
gdk_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region)
{
GdkRegion *copy;
g_return_if_fail (GDK_IS_GC (gc));
if (region)
region = gdk_region_copy (region);
_gdk_gc_set_clip_region_internal (gc, region);
copy = gdk_region_copy (region);
else
copy = NULL;
_gdk_gc_set_clip_region_internal (gc, copy);
}
/**
......@@ -1119,11 +1123,11 @@ gc_get_background (GdkGC *gc,
* and functions other than %GDK_COPY are not currently handled.
**/
void
_gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed)
_gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
const GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed)
{
GdkGCPrivate *priv;
GdkFill fill;
......
......@@ -257,9 +257,9 @@ void gdk_gc_set_clip_origin (GdkGC *gc,
void gdk_gc_set_clip_mask (GdkGC *gc,
GdkBitmap *mask);
void gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle);
const GdkRectangle *rectangle);
void gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region);
const GdkRegion *region);
void gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode);
void gdk_gc_set_exposures (GdkGC *gc,
......
......@@ -220,11 +220,11 @@ cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
gboolean graphics_exposures);
void _gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed);
void _gdk_gc_update_context (GdkGC *gc,
cairo_t *cr,
const GdkColor *override_foreground,
GdkBitmap *override_stipple,
gboolean gc_changed);
/*************************************
* Interfaces used by windowing code *
......@@ -310,8 +310,8 @@ gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
* the region; if the result is TRUE, then the windowing layer is responsible
* for destroying the region later.
*/
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
/* Called to do the windowing system specific part of gdk_window_destroy(),
*
......@@ -355,16 +355,16 @@ struct _GdkPaintableIface
{
GTypeInterface g_iface;
void (* begin_paint_region) (GdkPaintable *paintable,
GdkRegion *region);
void (* end_paint) (GdkPaintable *paintable);
void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
GdkRegion *region,
gboolean (*child_func) (GdkWindow *, gpointer),
gpointer user_data);
void (* process_updates) (GdkPaintable *paintable,
gboolean update_children);
void (* begin_paint_region) (GdkPaintable *paintable,
const GdkRegion *region);
void (* end_paint) (GdkPaintable *paintable);
void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
const GdkRegion *region,
gboolean (*child_func) (GdkWindow *, gpointer),
gpointer user_data);
void (* process_updates) (GdkPaintable *paintable,
gboolean update_children);
};
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
......@@ -388,8 +388,8 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
* When this function is called, _gdk_gc_get_clip_region
* will already return the new region.
**/
void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
GdkRegion *region);
void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
const GdkRegion *region);
/**
* _gdk_windowing_gc_copy:
......
......@@ -62,12 +62,11 @@ SOFTWARE.
*
*/
static void
InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
EdgeTable *ET;
EdgeTableEntry *ETE;
int scanline;
ScanLineListBlock **SLLBlock;
int *iSLLBlock;
InsertEdgeInET (EdgeTable *ET,
EdgeTableEntry *ETE,
int scanline,
ScanLineListBlock **SLLBlock,
int *iSLLBlock)
{
EdgeTableEntry *start, *prev;
ScanLineList *pSLL, *pPrevSLL;
......@@ -150,16 +149,15 @@ InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
*/
static void
CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
int count;
GdkPoint *pts;
EdgeTable *ET;
EdgeTableEntry *AET;
EdgeTableEntry *pETEs;
ScanLineListBlock *pSLLBlock;
CreateETandAET (int count,
const GdkPoint *pts,
EdgeTable *ET,
EdgeTableEntry *AET,
EdgeTableEntry *pETEs,
ScanLineListBlock *pSLLBlock)
{
GdkPoint *top, *bottom;
GdkPoint *PrevPt, *CurrPt;
const GdkPoint *top, *bottom;
const GdkPoint *PrevPt, *CurrPt;
int iSLLBlock = 0;
int dy;
......@@ -242,8 +240,8 @@ CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
*/
static void
loadAET(AET, ETEs)
EdgeTableEntry *AET, *ETEs;
loadAET(EdgeTableEntry *AET,
EdgeTableEntry *ETEs)
{
EdgeTableEntry *pPrevAET;
EdgeTableEntry *tmp;
......@@ -290,8 +288,7 @@ loadAET(AET, ETEs)
*
*/
static void
computeWAET(AET)
EdgeTableEntry *AET;
computeWAET (EdgeTableEntry *AET)
{
EdgeTableEntry *pWETE;
int inside = 1;
......@@ -329,8 +326,7 @@ computeWAET(AET)
*/
static int
InsertionSort(AET)
EdgeTableEntry *AET;
InsertionSort (EdgeTableEntry *AET)
{
EdgeTableEntry *pETEchase;
EdgeTableEntry *pETEinsert;
......@@ -366,8 +362,7 @@ InsertionSort(AET)
* Clean up our act.
*/
static void
FreeStorage(pSLLBlock)
ScanLineListBlock *pSLLBlock;
FreeStorage (ScanLineListBlock *pSLLBlock)
{
ScanLineListBlock *tmpSLLBlock;
......@@ -387,10 +382,11 @@ FreeStorage(pSLLBlock)
* stack by the calling procedure.
*
*/
static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
int numFullPtBlocks, iCurPtBlock;
POINTBLOCK *FirstPtBlock;
GdkRegion *reg;
static int
PtsToRegion (int numFullPtBlocks,
int iCurPtBlock,
POINTBLOCK *FirstPtBlock,
GdkRegion *reg)
{
GdkRegionBox *rects;
GdkPoint *pts;
......@@ -464,7 +460,9 @@ static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
* Returns: a new #GdkRegion based on the given polygon
*/
GdkRegion *
gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
gdk_region_polygon (const GdkPoint *Pts,
gint Count,
GdkFillRule rule)
{
GdkRegion *region;
EdgeTableEntry *pAET; /* Active Edge Table */
......@@ -472,7 +470,7 @@ gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
int iPts = 0; /* number of pts in buffer */
EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
ScanLineList *pSLL; /* current scanLineList */
GdkPoint *pts; /* output buffer */
GdkPoint *pts; /* output buffer */
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
EdgeTable ET; /* header node for ET */
EdgeTableEntry AET; /* header node for AET */
......@@ -486,21 +484,20 @@ gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
region = gdk_region_new ();
/* special case a rectangle */
pts = Pts;
if (((Count == 4) ||
((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) &&
(((pts[0].y == pts[1].y) &&
(pts[1].x == pts[2].x) &&
(pts[2].y == pts[3].y) &&
(pts[3].x == pts[0].x)) ||
((pts[0].x == pts[1].x) &&
(pts[1].y == pts[2].y) &&
(pts[2].x == pts[3].x) &&
(pts[3].y == pts[0].y)))) {
region->extents.x1 = MIN(pts[0].x, pts[2].x);
region->extents.y1 = MIN(pts[0].y, pts[2].y);
region->extents.x2 = MAX(pts[0].x, pts[2].x);
region->extents.y2 = MAX(pts[0].y, pts[2].y);
((Count == 5) && (Pts[4].x == Pts[0].x) && (Pts[4].y == Pts[0].y))) &&
(((Pts[0].y == Pts[1].y) &&
(Pts[1].x == Pts[2].x) &&
(Pts[2].y == Pts[3].y) &&
(Pts[3].x == Pts[0].x)) ||
((Pts[0].x == Pts[1].x) &&
(Pts[1].y == Pts[2].y) &&
(Pts[2].x == Pts[3].x) &&
(Pts[3].y == Pts[0].y)))) {
region->extents.x1 = MIN(Pts[0].x, Pts[2].x);
region->extents.y1 = MIN(Pts[0].y, Pts[2].y);
region->extents.x2 = MAX(Pts[0].x, Pts[2].x);
region->extents.y2 = MAX(Pts[0].y, Pts[2].y);
if ((region->extents.x1 != region->extents.x2) &&
(region->extents.y1 != region->extents.y2)) {
region->numRects = 1;
......
......@@ -40,9 +40,9 @@
* It is allowed for @dest to be the same as either @src1 or @src2.
*/
void
gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest)
gdk_rectangle_union (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest)
{
gint dest_x, dest_y;
......@@ -74,9 +74,9 @@ gdk_rectangle_union (GdkRectangle *src1,
* Returns: %TRUE if the rectangles intersect.
*/
gboolean
gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest)
gdk_rectangle_intersect (const GdkRectangle *src1,
const GdkRectangle *src2,
GdkRectangle *dest)
{
gint dest_x, dest_y;
gint dest_w, dest_h;
......
......@@ -75,27 +75,27 @@ SOFTWARE.
#include "gdkregion-generic.h"
#include "gdkalias.h"
typedef void (*overlapFunc) (GdkRegion *pReg,
GdkRegionBox *r1,
GdkRegionBox *r1End,
GdkRegionBox *r2,
GdkRegionBox *r2End,
gint y1,
gint y2);
typedef void (*nonOverlapFunc) (GdkRegion *pReg,
GdkRegionBox *r,
GdkRegionBox *rEnd,
gint y1,
gint y2);
static void miRegionCopy (GdkRegion *dstrgn,
GdkRegion *rgn);
static void miRegionOp (GdkRegion *newReg,
GdkRegion *reg1,
GdkRegion *reg2,
overlapFunc overlapFn,
nonOverlapFunc nonOverlap1Fn,
nonOverlapFunc nonOverlap2Fn);
typedef void (* overlapFunc) (GdkRegion *pReg,
GdkRegionBox *r1,
GdkRegionBox *r1End,
GdkRegionBox *r2,
GdkRegionBox *r2End,
gint y1,
gint y2);
typedef void (* nonOverlapFunc) (GdkRegion *pReg,
GdkRegionBox *r,
GdkRegionBox *rEnd,
gint y1,
gint y2);
static void miRegionCopy (GdkRegion *dstrgn,
const GdkRegion *rgn);
static void miRegionOp (GdkRegion *newReg,
GdkRegion *reg1,
const GdkRegion *reg2,
overlapFunc overlapFn,
nonOverlapFunc nonOverlap1Fn,
nonOverlapFunc nonOverlap2Fn);