+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.
}
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;
void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- GdkRegion *region)
+_gdk_windowing_gc_set_clip_region (GdkGC *gc,
+ const GdkRegion *region)
{
GdkGCDirectFB *data;
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;
* 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;
}
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)
{
}
/* 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;
* 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);
* 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);
* 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;
* 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);
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
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,
* 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;
* 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);
}
/**
* 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;
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,
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 *
* 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(),
*
{
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;
* 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:
*
*/
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;
*/
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;
*/
static void
-loadAET(AET, ETEs)
- EdgeTableEntry *AET, *ETEs;
+loadAET(EdgeTableEntry *AET,
+ EdgeTableEntry *ETEs)
{
EdgeTableEntry *pPrevAET;
EdgeTableEntry *tmp;
*
*/
static void
-computeWAET(AET)
- EdgeTableEntry *AET;
+computeWAET (EdgeTableEntry *AET)
{
EdgeTableEntry *pWETE;
int inside = 1;
*/
static int
-InsertionSort(AET)
- EdgeTableEntry *AET;
+InsertionSort (EdgeTableEntry *AET)
{
EdgeTableEntry *pETEchase;
EdgeTableEntry *pETEinsert;
* Clean up our act.
*/
static void
-FreeStorage(pSLLBlock)
- ScanLineListBlock *pSLLBlock;
+FreeStorage (ScanLineListBlock *pSLLBlock)
{
ScanLineListBlock *tmpSLLBlock;
* 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;
* 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 */
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 */
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;
* 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;
* 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;
#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);
/**
* gdk_region_new:
* Return value: a new region
**/
GdkRegion *
-gdk_region_rectangle (GdkRectangle *rectangle)
+gdk_region_rectangle (const GdkRectangle *rectangle)
{
GdkRegion *temp;
* Return value: a new region identical to @region
**/
GdkRegion *
-gdk_region_copy (GdkRegion *region)
+gdk_region_copy (const GdkRegion *region)
{
GdkRegion *temp;
*
*/
void
-gdk_region_get_clipbox (GdkRegion *region,
- GdkRectangle *rectangle)
+gdk_region_get_clipbox (const GdkRegion *region,
+ GdkRectangle *rectangle)
{
g_return_if_fail (region != NULL);
g_return_if_fail (rectangle != NULL);
* The array returned in @rectangles must be freed with g_free().
**/
void
-gdk_region_get_rectangles (GdkRegion *region,
- GdkRectangle **rectangles,
- gint *n_rectangles)
+gdk_region_get_rectangles (const GdkRegion *region,
+ GdkRectangle **rectangles,
+ gint *n_rectangles)
{
gint i;
* either @region or @rect.
**/
void
-gdk_region_union_with_rect (GdkRegion *region,
- GdkRectangle *rect)
+gdk_region_union_with_rect (GdkRegion *region,
+ const GdkRectangle *rect)
{
GdkRegion tmp_region;
* both @source1 and @source2.
**/
void
-gdk_region_intersect (GdkRegion *source1,
- GdkRegion *source2)
+gdk_region_intersect (GdkRegion *source1,
+ const GdkRegion *source2)
{
g_return_if_fail (source1 != NULL);
g_return_if_fail (source2 != NULL);
(!EXTENTCHECK(&source1->extents, &source2->extents)))
source1->numRects = 0;
else
- miRegionOp (source1, source1, source2,
+ miRegionOp (source1, source1, source2,
miIntersectO, (nonOverlapFunc) NULL, (nonOverlapFunc) NULL);
/*
}
static void
-miRegionCopy (GdkRegion *dstrgn,
- GdkRegion *rgn)
+miRegionCopy (GdkRegion *dstrgn,
+ const GdkRegion *rgn)
{
if (dstrgn != rgn) /* don't want to copy to itself */
{
*/
/* static void*/
static void
-miRegionOp(GdkRegion *newReg,
- GdkRegion *reg1,
- GdkRegion *reg2,
- overlapFunc overlapFn, /* Function to call for over-
+miRegionOp(GdkRegion *newReg,
+ GdkRegion *reg1,
+ const GdkRegion *reg2,
+ overlapFunc overlapFn, /* Function to call for over-
* lapping bands */
- nonOverlapFunc nonOverlap1Fn, /* Function to call for non-
+ nonOverlapFunc nonOverlap1Fn, /* Function to call for non-
* overlapping bands in region
* 1 */
- nonOverlapFunc nonOverlap2Fn) /* Function to call for non-
+ nonOverlapFunc nonOverlap2Fn) /* Function to call for non-
* overlapping bands in region
* 2 */
{
* either @source1 or @source2.
**/
void
-gdk_region_union (GdkRegion *source1,
- GdkRegion *source2)
+gdk_region_union (GdkRegion *source1,
+ const GdkRegion *source2)
{
g_return_if_fail (source1 != NULL);
g_return_if_fail (source2 != NULL);
* area is the set of pixels contained in @source1 but not in @source2.
**/
void
-gdk_region_subtract (GdkRegion *source1,
- GdkRegion *source2)
+gdk_region_subtract (GdkRegion *source1,
+ const GdkRegion *source2)
{
g_return_if_fail (source1 != NULL);
g_return_if_fail (source2 != NULL);
* or the other of the two sources but not in both.
**/
void
-gdk_region_xor (GdkRegion *source1,
- GdkRegion *source2)
+gdk_region_xor (GdkRegion *source1,
+ const GdkRegion *source2)
{
GdkRegion *trb;
* Returns: %TRUE if @region is empty.
*/
gboolean
-gdk_region_empty (GdkRegion *region)
+gdk_region_empty (const GdkRegion *region)
{
g_return_val_if_fail (region != NULL, FALSE);
* Returns: %TRUE if @region1 and @region2 are equal.
*/
gboolean
-gdk_region_equal (GdkRegion *region1,
- GdkRegion *region2)
+gdk_region_equal (const GdkRegion *region1,
+ const GdkRegion *region2)
{
int i;
* Returns: %TRUE if the point is in @region.
*/
gboolean
-gdk_region_point_in (GdkRegion *region,
- int x,
- int y)
+gdk_region_point_in (const GdkRegion *region,
+ int x,
+ int y)
{
int i;
* outside, or partly inside the #GdkRegion, respectively.
*/
GdkOverlapType
-gdk_region_rect_in (GdkRegion *region,
- GdkRectangle *rectangle)
+gdk_region_rect_in (const GdkRegion *region,
+ const GdkRectangle *rectangle)
{
GdkRegionBox *pbox;
GdkRegionBox *pboxEnd;
GDK_OVERLAP_RECTANGLE_PART
} GdkOverlapType;
-typedef void (*GdkSpanFunc) (GdkSpan *span,
- gpointer data);
+typedef void (* GdkSpanFunc) (GdkSpan *span,
+ gpointer data);
-GdkRegion *gdk_region_new (void);
-GdkRegion *gdk_region_polygon (GdkPoint *points,
- gint npoints,
- GdkFillRule fill_rule);
-GdkRegion *gdk_region_copy (GdkRegion *region);
-GdkRegion *gdk_region_rectangle (GdkRectangle *rectangle);
-void gdk_region_destroy (GdkRegion *region);
+GdkRegion * gdk_region_new (void);
+GdkRegion * gdk_region_polygon (const GdkPoint *points,
+ gint n_points,
+ GdkFillRule fill_rule);
+GdkRegion * gdk_region_copy (const GdkRegion *region);
+GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle);
+void gdk_region_destroy (GdkRegion *region);
-void gdk_region_get_clipbox (GdkRegion *region,
- GdkRectangle *rectangle);
-void gdk_region_get_rectangles (GdkRegion *region,
- GdkRectangle **rectangles,
- gint *n_rectangles);
+void gdk_region_get_clipbox (const GdkRegion *region,
+ GdkRectangle *rectangle);
+void gdk_region_get_rectangles (const GdkRegion *region,
+ GdkRectangle **rectangles,
+ gint *n_rectangles);
-gboolean gdk_region_empty (GdkRegion *region);
-gboolean gdk_region_equal (GdkRegion *region1,
- GdkRegion *region2);
-gboolean gdk_region_point_in (GdkRegion *region,
- int x,
- int y);
-GdkOverlapType gdk_region_rect_in (GdkRegion *region,
- GdkRectangle *rectangle);
+gboolean gdk_region_empty (const GdkRegion *region);
+gboolean gdk_region_equal (const GdkRegion *region1,
+ const GdkRegion *region2);
+gboolean gdk_region_point_in (const GdkRegion *region,
+ int x,
+ int y);
+GdkOverlapType gdk_region_rect_in (const GdkRegion *region,
+ const GdkRectangle *rectangle);
-void gdk_region_offset (GdkRegion *region,
- gint dx,
- gint dy);
-void gdk_region_shrink (GdkRegion *region,
- gint dx,
- gint dy);
-void gdk_region_union_with_rect (GdkRegion *region,
- GdkRectangle *rect);
-void gdk_region_intersect (GdkRegion *source1,
- GdkRegion *source2);
-void gdk_region_union (GdkRegion *source1,
- GdkRegion *source2);
-void gdk_region_subtract (GdkRegion *source1,
- GdkRegion *source2);
-void gdk_region_xor (GdkRegion *source1,
- GdkRegion *source2);
+void gdk_region_offset (GdkRegion *region,
+ gint dx,
+ gint dy);
+void gdk_region_shrink (GdkRegion *region,
+ gint dx,
+ gint dy);
+void gdk_region_union_with_rect (GdkRegion *region,
+ const GdkRectangle *rect);
+void gdk_region_intersect (GdkRegion *source1,
+ const GdkRegion *source2);
+void gdk_region_union (GdkRegion *source1,
+ const GdkRegion *source2);
+void gdk_region_subtract (GdkRegion *source1,
+ const GdkRegion *source2);
+void gdk_region_xor (GdkRegion *source1,
+ const GdkRegion *source2);
-void gdk_region_spans_intersect_foreach (GdkRegion *region,
- GdkSpan *spans,
- int n_spans,
- gboolean sorted,
- GdkSpanFunc function,
- gpointer data);
+void gdk_region_spans_intersect_foreach (GdkRegion *region,
+ GdkSpan *spans,
+ int n_spans,
+ gboolean sorted,
+ GdkSpanFunc function,
+ gpointer data);
G_END_DECLS
*
**/
void
-gdk_window_begin_paint_rect (GdkWindow *window,
- GdkRectangle *rectangle)
+gdk_window_begin_paint_rect (GdkWindow *window,
+ const GdkRectangle *rectangle)
{
GdkRegion *region;
*
**/
void
-gdk_window_begin_paint_region (GdkWindow *window,
- GdkRegion *region)
+gdk_window_begin_paint_region (GdkWindow *window,
+ const GdkRegion *region)
{
#ifdef USE_BACKING_STORE
GdkWindowObject *private = (GdkWindowObject *)window;
* gdk_window_invalidate_region() for details.
**/
void
-gdk_window_invalidate_rect (GdkWindow *window,
- GdkRectangle *rect,
- gboolean invalidate_children)
+gdk_window_invalidate_rect (GdkWindow *window,
+ const GdkRectangle *rect,
+ gboolean invalidate_children)
{
GdkRectangle window_rect;
GdkRegion *region;
}
static void
-draw_ugly_color (GdkWindow *window,
- GdkRegion *region)
+draw_ugly_color (GdkWindow *window,
+ const GdkRegion *region)
{
/* Draw ugly color all over the newly-invalid region */
GdkColor ugly_color = { 0, 50000, 10000, 10000 };
* invalidated.
**/
void
-gdk_window_invalidate_maybe_recurse (GdkWindow *window,
- GdkRegion *region,
- gboolean (*child_func) (GdkWindow *, gpointer),
+gdk_window_invalidate_maybe_recurse (GdkWindow *window,
+ const GdkRegion *region,
+ gboolean (*child_func) (GdkWindow *,
+ gpointer),
gpointer user_data)
{
GdkWindowObject *private = (GdkWindowObject *)window;
if (child_func && (*child_func) ((GdkWindow *)child, user_data))
{
- gdk_region_offset (region, - child_rect.x, - child_rect.y);
+ GdkRegion *tmp = gdk_region_copy (region);
+
+ gdk_region_offset (tmp, - child_rect.x, - child_rect.y);
gdk_region_offset (child_region, - child_rect.x, - child_rect.y);
- gdk_region_intersect (child_region, region);
+ gdk_region_intersect (child_region, tmp);
gdk_window_invalidate_maybe_recurse ((GdkWindow *)child,
child_region, child_func, user_data);
- gdk_region_offset (region, child_rect.x, child_rect.y);
+ gdk_region_destroy (tmp);
}
gdk_region_destroy (child_region);
* fine grained control over which children are invalidated.
**/
void
-gdk_window_invalidate_region (GdkWindow *window,
- GdkRegion *region,
- gboolean invalidate_children)
+gdk_window_invalidate_region (GdkWindow *window,
+ const GdkRegion *region,
+ gboolean invalidate_children)
{
gdk_window_invalidate_maybe_recurse (window, region,
invalidate_children ?
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
-void gdk_window_scroll (GdkWindow *window,
- gint dx,
- gint dy);
-void gdk_window_move_region (GdkWindow *window,
- GdkRegion *region,
- gint dx,
- gint dy);
+void gdk_window_scroll (GdkWindow *window,
+ gint dx,
+ gint dy);
+void gdk_window_move_region (GdkWindow *window,
+ const GdkRegion *region,
+ gint dx,
+ gint dy);
/*
* This allows for making shaped (partially transparent) windows
* The shape_mask can be the mask
* from gdk_pixmap_create_from_xpm. Stefan Wille
*/
-void gdk_window_shape_combine_mask (GdkWindow *window,
- GdkBitmap *mask,
- gint x,
- gint y);
-void gdk_window_shape_combine_region (GdkWindow *window,
- GdkRegion *shape_region,
- gint offset_x,
- gint offset_y);
+void gdk_window_shape_combine_mask (GdkWindow *window,
+ GdkBitmap *mask,
+ gint x,
+ gint y);
+void gdk_window_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape_region,
+ gint offset_x,
+ gint offset_y);
/*
* This routine allows you to quickly take the shapes of all the child windows
void gdk_window_set_child_shapes (GdkWindow *window);
void gdk_window_set_composited (GdkWindow *window,
- gboolean composited);
+ gboolean composited);
/*
* This routine allows you to merge (ie ADD) child shapes to your
*
* - Raster
*/
-void gdk_window_merge_child_shapes (GdkWindow *window);
+void gdk_window_merge_child_shapes (GdkWindow *window);
-void gdk_window_input_shape_combine_mask (GdkWindow *window,
- GdkBitmap *mask,
- gint x,
- gint y);
-void gdk_window_input_shape_combine_region (GdkWindow *window,
- GdkRegion *shape_region,
- gint offset_x,
- gint offset_y);
-void gdk_window_set_child_input_shapes (GdkWindow *window);
-void gdk_window_merge_child_input_shapes (GdkWindow *window);
+void gdk_window_input_shape_combine_mask (GdkWindow *window,
+ GdkBitmap *mask,
+ gint x,
+ gint y);
+void gdk_window_input_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape_region,
+ gint offset_x,
+ gint offset_y);
+void gdk_window_set_child_input_shapes (GdkWindow *window);
+void gdk_window_merge_child_input_shapes (GdkWindow *window);
/*
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_set_sm_client_id (const gchar *sm_client_id);
-void gdk_window_begin_paint_rect (GdkWindow *window,
- GdkRectangle *rectangle);
-void gdk_window_begin_paint_region (GdkWindow *window,
- GdkRegion *region);
-void gdk_window_end_paint (GdkWindow *window);
+void gdk_window_begin_paint_rect (GdkWindow *window,
+ const GdkRectangle *rectangle);
+void gdk_window_begin_paint_region (GdkWindow *window,
+ const GdkRegion *region);
+void gdk_window_end_paint (GdkWindow *window);
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
guint32 timestamp);
/* Interface for dirty-region queueing */
-void gdk_window_invalidate_rect (GdkWindow *window,
- GdkRectangle *rect,
- gboolean invalidate_children);
-void gdk_window_invalidate_region (GdkWindow *window,
- GdkRegion *region,
- gboolean invalidate_children);
-void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
- GdkRegion *region,
+void gdk_window_invalidate_rect (GdkWindow *window,
+ const GdkRectangle *rect,
+ gboolean invalidate_children);
+void gdk_window_invalidate_region (GdkWindow *window,
+ const GdkRegion *region,
+ gboolean invalidate_children);
+void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
+ const GdkRegion *region,
gboolean (*child_func) (GdkWindow *, gpointer),
gpointer user_data);
GdkRegion *gdk_window_get_update_area (GdkWindow *window);
}
void
-gdk_colormap_free_colors (GdkColormap *colormap,
- GdkColor *colors,
- gint ncolors)
+gdk_colormap_free_colors (GdkColormap *colormap,
+ const GdkColor *colors,
+ gint n_colors)
{
/* This function shouldn't do anything since
* colors are neve allocated.
}
void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- GdkRegion *region)
+_gdk_windowing_gc_set_clip_region (GdkGC *gc,
+ const GdkRegion *region)
{
GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
}
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)
{
/* FIXME: Implement */
}
}
void
-gdk_window_shape_combine_region (GdkWindow *window,
- GdkRegion *shape,
- gint x,
- gint y)
+gdk_window_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape,
+ gint x,
+ gint y)
{
g_return_if_fail (GDK_IS_WINDOW (window));
/* FIXME: Implement */
}
-void
+void
gdk_window_input_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x,
/* FIXME: Implement */
}
-void
-gdk_window_input_shape_combine_region (GdkWindow *window,
- GdkRegion *shape_region,
- gint offset_x,
- gint offset_y)
+void
+gdk_window_input_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape_region,
+ gint offset_x,
+ gint offset_y)
{
/* FIXME: Implement */
}
}
void
-gdk_colormap_free_colors (GdkColormap *colormap,
- GdkColor *colors,
- gint ncolors)
+gdk_colormap_free_colors (GdkColormap *colormap,
+ const GdkColor *colors,
+ gint ncolors)
{
gulong *pixels;
gint i;
}
void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- GdkRegion *region)
+_gdk_windowing_gc_set_clip_region (GdkGC *gc,
+ const GdkRegion *region)
{
GdkGCWin32 *win32_gc = GDK_GC_WIN32 (gc);
}
HRGN
-_gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
- gint x_origin,
- gint y_origin)
+_gdk_win32_gdkregion_to_hrgn (const GdkRegion *region,
+ gint x_origin,
+ gint y_origin)
{
HRGN hrgn;
RGNDATA *rgndata;
}
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)
{
GdkRegion *invalidate_region;
GdkWindowImplWin32 *impl;
HRGN _gdk_win32_bitmap_to_hrgn (GdkPixmap *bitmap);
-HRGN _gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
- gint x_origin,
- gint y_origin);
+HRGN _gdk_win32_gdkregion_to_hrgn (const GdkRegion *region,
+ gint x_origin,
+ gint y_origin);
GdkRegion *_gdk_win32_hrgn_to_region (HRGN hrgn);
}
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)
{
GdkWindowObject *private = (GdkWindowObject *)window;
}
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)
{
g_return_if_fail (GDK_IS_WINDOW (window));
}
GdkWindow *
-gdk_window_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid)
+gdk_window_lookup_for_display (GdkDisplay *display,
+ GdkNativeWindow anid)
{
g_return_val_if_fail (display == _gdk_display, NULL);
* Frees previously allocated colors.
**/
void
-gdk_colormap_free_colors (GdkColormap *colormap,
- GdkColor *colors,
- gint ncolors)
+gdk_colormap_free_colors (GdkColormap *colormap,
+ const GdkColor *colors,
+ gint ncolors)
{
GdkColormapPrivateX11 *private;
gulong *pixels;
* cache the result in our colormap, and store in ret.
*/
static gboolean
-gdk_colormap_alloc1 (GdkColormap *colormap,
- GdkColor *color,
- GdkColor *ret)
+gdk_colormap_alloc1 (GdkColormap *colormap,
+ const GdkColor *color,
+ GdkColor *ret)
{
GdkColormapPrivateX11 *private;
XColor xcolor;
}
void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- GdkRegion *region)
+_gdk_windowing_gc_set_clip_region (GdkGC *gc,
+ const GdkRegion *region)
{
GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
* 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)
{
GdkWindowImplX11 *impl;
GdkWindowObject *private;
}
void
-_gdk_region_get_xrectangles (GdkRegion *region,
- gint x_offset,
- gint y_offset,
- XRectangle **rects,
- gint *n_rects)
+_gdk_region_get_xrectangles (const GdkRegion *region,
+ gint x_offset,
+ gint y_offset,
+ XRectangle **rects,
+ gint *n_rects)
{
XRectangle *rectangles = g_new (XRectangle, region->numRects);
GdkRegionBox *boxes = region->rects;
void _gdk_selection_window_destroyed (GdkWindow *window);
gboolean _gdk_selection_filter_clear_event (XSelectionClearEvent *event);
-void _gdk_region_get_xrectangles (GdkRegion *region,
+void _gdk_region_get_xrectangles (const GdkRegion *region,
gint x_offset,
gint y_offset,
XRectangle **rects,
static void
-do_shape_combine_region (GdkWindow *window,
- GdkRegion *shape_region,
- gint offset_x,
- gint offset_y,
- gint shape)
+do_shape_combine_region (GdkWindow *window,
+ const GdkRegion *shape_region,
+ gint offset_x,
+ gint offset_y,
+ gint shape)
{
GdkWindowObject *private = (GdkWindowObject *)window;
gint xoffset, yoffset;
*
**/
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)
{
do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeBounding);
}
* Since: 2.10
*/
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)
{
#ifdef ShapeInput
do_shape_combine_region (window, shape_region, offset_x, offset_y, ShapeInput);