1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
13
/* $Id: gdevhit.c 8250 2007-09-25 13:31:24Z giles $ */
14
/* Hit detection device */
22
/* Define the value returned for a detected hit. */
23
const int gs_hit_detected = gs_error_hit_detected;
26
* Define a minimal device for insideness testing.
27
* It returns e_hit whenever it is asked to actually paint any pixels.
29
static dev_proc_fill_rectangle(hit_fill_rectangle);
30
const gx_device gs_hit_device = {
31
std_device_std_body(gx_device, 0, "hit detector",
33
{NULL, /* open_device */
34
NULL, /* get_initial_matrix */
35
NULL, /* sync_output */
36
NULL, /* output_page */
37
NULL, /* close_device */
38
gx_default_map_rgb_color,
39
gx_default_map_color_rgb,
41
NULL, /* tile_rectangle */
43
NULL, /* copy_color */
46
NULL, /* get_params */
47
NULL, /* put_params */
48
gx_default_map_cmyk_color,
49
NULL, /* get_xfont_procs */
50
NULL, /* get_xfont_device */
51
gx_default_map_rgb_alpha_color,
52
gx_default_get_page_device,
53
gx_default_get_alpha_bits,
54
NULL, /* copy_alpha */
58
NULL, /* stroke_path */
60
gx_default_fill_trapezoid,
61
gx_default_fill_parallelogram,
62
gx_default_fill_triangle,
63
gx_default_draw_thin_line,
64
gx_default_begin_image,
65
gx_default_image_data,
67
gx_default_strip_tile_rectangle,
68
gx_default_strip_copy_rop,
69
gx_get_largest_clipping_box,
70
gx_default_begin_typed_image,
71
NULL, /* get_bits_rectangle */
72
gx_default_map_color_rgb_alpha,
73
gx_non_imaging_create_compositor,
74
NULL /* get_hardware_params */
78
/* Test for a hit when filling a rectangle. */
80
hit_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
84
return_error(gs_error_hit_detected);