1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * gimpcanvasitem-utils.h
5  * Copyright (C) 2010 Michael Natterer <mitch@gimp.org>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GIMP_CANVAS_ITEM_UTILS_H__
22 #define __GIMP_CANVAS_ITEM_UTILS_H__
23 
24 
25 gboolean   gimp_canvas_item_on_handle           (GimpCanvasItem    *item,
26                                                  gdouble            x,
27                                                  gdouble            y,
28                                                  GimpHandleType     type,
29                                                  gdouble            handle_x,
30                                                  gdouble            handle_y,
31                                                  gint               width,
32                                                  gint               height,
33                                                  GimpHandleAnchor   anchor);
34 
35 gboolean   gimp_canvas_item_on_vectors_handle   (GimpCanvasItem    *item,
36                                                  GimpVectors       *vectors,
37                                                  const GimpCoords  *coord,
38                                                  gint               width,
39                                                  gint               height,
40                                                  GimpAnchorType     preferred,
41                                                  gboolean           exclusive,
42                                                  GimpAnchor       **ret_anchor,
43                                                  GimpStroke       **ret_stroke);
44 gboolean   gimp_canvas_item_on_vectors_curve    (GimpCanvasItem    *item,
45                                                  GimpVectors       *vectors,
46                                                  const GimpCoords  *coord,
47                                                  gint               width,
48                                                  gint               height,
49                                                  GimpCoords        *ret_coords,
50                                                  gdouble           *ret_pos,
51                                                  GimpAnchor       **ret_segment_start,
52                                                  GimpAnchor       **ret_segment_end,
53                                                  GimpStroke       **ret_stroke);
54 gboolean   gimp_canvas_item_on_vectors          (GimpCanvasItem    *item,
55                                                  const GimpCoords  *coords,
56                                                  gint               width,
57                                                  gint               height,
58                                                  GimpCoords        *ret_coords,
59                                                  gdouble           *ret_pos,
60                                                  GimpAnchor       **ret_segment_start,
61                                                  GimpAnchor       **ret_segment_end,
62                                                  GimpStroke       **ret_stroke,
63                                                  GimpVectors      **ret_vectors);
64 
65 void       gimp_canvas_item_shift_to_north_west (GimpHandleAnchor   anchor,
66                                                  gdouble            x,
67                                                  gdouble            y,
68                                                  gint               width,
69                                                  gint               height,
70                                                  gdouble           *shifted_x,
71                                                  gdouble           *shifted_y);
72 void       gimp_canvas_item_shift_to_center     (GimpHandleAnchor   anchor,
73                                                  gdouble            x,
74                                                  gdouble            y,
75                                                  gint               width,
76                                                  gint               height,
77                                                  gdouble           *shifted_x,
78                                                  gdouble           *shifted_y);
79 
80 
81 #endif /* __GIMP_CANVAS_ITEM_UTILS_H__ */
82