gtk/gdk/gdkregion.h

85 lines
2.3 KiB
C
Raw Normal View History

#ifndef __GDK_REGION_H__
#define __GDK_REGION_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* GC fill rule for polygons
* EvenOddRule
* WindingRule
*/
typedef enum
{
GDK_EVEN_ODD_RULE,
GDK_WINDING_RULE
} GdkFillRule;
/* Types of overlapping between a rectangle and a region
* GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
* GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
* GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
*/
typedef enum
{
GDK_OVERLAP_RECTANGLE_IN,
GDK_OVERLAP_RECTANGLE_OUT,
GDK_OVERLAP_RECTANGLE_PART
} GdkOverlapType;
i2000-11-22 Alexander Larsson <alexl@redhat.com> * gdk/gdktypes.h: Add new type GdkSpan * docs/reference/gdk/gdk-sections.txt, docs/reference/gdk/tmpl/regions.sgml, gdk/gdkregion-generic.c, gdk/gdkregion.h: Implement and document gdk_region_spans_intersect_foreach. * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkrender-fb.c: Add new file gdkrender-fb.c which contains all core rendering code. Add gdk_fb_fill_rectangle_generic (old rectangle code) and gdk_fb_fill_rectangle_simple_16, gdk_fb_fill_rectangle_simple_32 (optimized rectangle fillers). * gdk/linux-fb/gdkdrawable-fb2.c: Move all rendering code to gdkrender-fb.c. Change from using GdkRectangles and GdkSegments for spans to GdkSpan. Use the new span intersection functions in gdk_fb_fill_spans. gdk_fb_draw_rectangle() clips filled rectangles and calls gc->fill_rectangle with the result. gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/gdkevents-fb.c: Remove unused includes and defines. New function gdk_fb_get_time() to get correct time for events. * gdk/linux-fb/gdkinput-ps2.c: Use gdk method of generating multiple-clicks (gdk_event_button_generate) Make sure to set the time of all events. * gdk/linux-fb/gdkmain-fb.c: Use gdk_fb_get_time (). * gdk/linux-fb/gdkprivate-fb.h: New virtual GC calls: fill_span & fill_rectangle. Export gdk_fb_get_time(). gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/mi*.c: Use GdkSpan instead of GdkRectangle. Pass correct sorted to gdk_fb_fill_spans. (sorted value taken from XFree 4 source)
2000-11-22 10:07:34 +00:00
typedef void (*GdkSpanFunc) (GdkSpan *span,
gpointer data);
2000-03-28 01:24:44 +00:00
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);
2000-03-28 01:24:44 +00:00
void gdk_region_get_clipbox (GdkRegion *region,
GdkRectangle *rectangle);
2000-03-28 01:24:44 +00:00
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 *rect);
2000-03-28 01:24:44 +00:00
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);
i2000-11-22 Alexander Larsson <alexl@redhat.com> * gdk/gdktypes.h: Add new type GdkSpan * docs/reference/gdk/gdk-sections.txt, docs/reference/gdk/tmpl/regions.sgml, gdk/gdkregion-generic.c, gdk/gdkregion.h: Implement and document gdk_region_spans_intersect_foreach. * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkrender-fb.c: Add new file gdkrender-fb.c which contains all core rendering code. Add gdk_fb_fill_rectangle_generic (old rectangle code) and gdk_fb_fill_rectangle_simple_16, gdk_fb_fill_rectangle_simple_32 (optimized rectangle fillers). * gdk/linux-fb/gdkdrawable-fb2.c: Move all rendering code to gdkrender-fb.c. Change from using GdkRectangles and GdkSegments for spans to GdkSpan. Use the new span intersection functions in gdk_fb_fill_spans. gdk_fb_draw_rectangle() clips filled rectangles and calls gc->fill_rectangle with the result. gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/gdkevents-fb.c: Remove unused includes and defines. New function gdk_fb_get_time() to get correct time for events. * gdk/linux-fb/gdkinput-ps2.c: Use gdk method of generating multiple-clicks (gdk_event_button_generate) Make sure to set the time of all events. * gdk/linux-fb/gdkmain-fb.c: Use gdk_fb_get_time (). * gdk/linux-fb/gdkprivate-fb.h: New virtual GC calls: fill_span & fill_rectangle. Export gdk_fb_get_time(). gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/mi*.c: Use GdkSpan instead of GdkRectangle. Pass correct sorted to gdk_fb_fill_spans. (sorted value taken from XFree 4 source)
2000-11-22 10:07:34 +00:00
void gdk_region_spans_intersect_foreach (GdkRegion *region,
GdkSpan *spans,
int n_spans,
gboolean sorted,
GdkSpanFunc function,
gpointer data);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_REGION_H__ */
i2000-11-22 Alexander Larsson <alexl@redhat.com> * gdk/gdktypes.h: Add new type GdkSpan * docs/reference/gdk/gdk-sections.txt, docs/reference/gdk/tmpl/regions.sgml, gdk/gdkregion-generic.c, gdk/gdkregion.h: Implement and document gdk_region_spans_intersect_foreach. * gdk/linux-fb/Makefile.am, gdk/linux-fb/gdkrender-fb.c: Add new file gdkrender-fb.c which contains all core rendering code. Add gdk_fb_fill_rectangle_generic (old rectangle code) and gdk_fb_fill_rectangle_simple_16, gdk_fb_fill_rectangle_simple_32 (optimized rectangle fillers). * gdk/linux-fb/gdkdrawable-fb2.c: Move all rendering code to gdkrender-fb.c. Change from using GdkRectangles and GdkSegments for spans to GdkSpan. Use the new span intersection functions in gdk_fb_fill_spans. gdk_fb_draw_rectangle() clips filled rectangles and calls gc->fill_rectangle with the result. gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/gdkevents-fb.c: Remove unused includes and defines. New function gdk_fb_get_time() to get correct time for events. * gdk/linux-fb/gdkinput-ps2.c: Use gdk method of generating multiple-clicks (gdk_event_button_generate) Make sure to set the time of all events. * gdk/linux-fb/gdkmain-fb.c: Use gdk_fb_get_time (). * gdk/linux-fb/gdkprivate-fb.h: New virtual GC calls: fill_span & fill_rectangle. Export gdk_fb_get_time(). gdk_fb_fill_spans() gets extra argument "sorted". * gdk/linux-fb/mi*.c: Use GdkSpan instead of GdkRectangle. Pass correct sorted to gdk_fb_fill_spans. (sorted value taken from XFree 4 source)
2000-11-22 10:07:34 +00:00