home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / path_curves.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-09  |  5.6 KB  |  211 lines

  1. /* The GIMP -- an image manipulation program
  2.  *
  3.  * This file Copyright (C) 1999 Simon Budig
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. #ifndef __PATH_CURVES_H__
  21. #define __PATH_CURVES_H__
  22.  
  23. #include <gdk/gdk.h>
  24. #include "path_toolP.h"
  25.  
  26.  
  27. /*
  28.  * This function is to get a set of npoints different coordinates for
  29.  * the range from start to end (each in the range from 0 to 1 and
  30.  * start < end).
  31.  * returns the number of created coords. Make sure that the points-
  32.  * Array is allocated.
  33.  */
  34.  
  35. typedef guint (*PathGetPointsFunc) (PathTool *path_tool,
  36.                                 PathSegment *segment,
  37.                     GdkPoint *points,
  38.                     guint npoints,
  39.                     gdouble start,
  40.                     gdouble end);
  41.  
  42. typedef void (*PathGetPointFunc) (PathTool *path_tool,
  43.                          PathSegment *segment,
  44.                          gdouble position,
  45.                          gdouble *x,
  46.                          gdouble *y);
  47.  
  48. typedef void (*PathDrawHandlesFunc) (Tool *tool,
  49.                        PathSegment *segment);
  50.               
  51. typedef void (*PathDrawSegmentFunc) (Tool *tool,
  52.                        PathSegment *segment);
  53.               
  54.  
  55. typedef gdouble (*PathOnSegmentFunc) (Tool *tool,
  56.                       PathSegment *segment,
  57.                       gint x,
  58.                       gint y,
  59.                       gint halfwidth,
  60.                       gint *distance);
  61.  
  62. typedef void (*PathDragSegmentFunc) (PathTool *path_tool,
  63.                      PathSegment *segment,
  64.                      gdouble position,
  65.                      gdouble dx,
  66.                      gdouble dy);
  67.  
  68. typedef gint (*PathOnHandlesFunc) (PathTool *path_tool,
  69.                    PathSegment *segment,
  70.                    gdouble x,
  71.                    gdouble y,
  72.                    gdouble halfwidth);
  73.  
  74. typedef void (*PathDragHandleFunc) (PathTool *path_tool,
  75.                     PathSegment *segment,
  76.                     gdouble dx,
  77.                     gdouble dy,
  78.                     gint handle_id);
  79.  
  80. typedef PathSegment * (*PathInsertAnchorFunc) (PathTool *path_tool,
  81.                            PathSegment *segment,
  82.                            gdouble position);
  83.  
  84. typedef void (*PathUpdateSegmentFunc) (PathTool *path_tool,
  85.                            PathSegment *segment);
  86.  
  87. typedef void (*PathFlipSegmentFunc) (PathSegment *segment);
  88.  
  89. typedef void (*PathInitSegmentFunc) (PathSegment *segment);
  90.  
  91. typedef void (*PathCleanupSegmentFunc) (PathSegment *segment);
  92.  
  93. typedef struct {
  94.    PathGetPointsFunc      get_points;
  95.    PathGetPointFunc       get_point;
  96.    PathDrawHandlesFunc    draw_handles;
  97.    PathDrawSegmentFunc    draw_segment;
  98.    PathOnSegmentFunc      on_segment;
  99.    PathDragSegmentFunc    drag_segment;
  100.    PathOnHandlesFunc      on_handles;
  101.    PathDragHandleFunc     drag_handle;
  102.    PathInsertAnchorFunc   insert_anchor;
  103.    PathUpdateSegmentFunc  update_segment;
  104.    PathFlipSegmentFunc    flip_segment;
  105.    PathInitSegmentFunc    init_segment;
  106.    PathCleanupSegmentFunc cleanup_segment;
  107. } CurveDescription;
  108.  
  109.  
  110. guint
  111. path_curve_get_points (PathTool *path_tool,
  112.                PathSegment *segment,
  113.                GdkPoint *points,
  114.                guint npoints,
  115.                gdouble start,
  116.                gdouble end);
  117.  
  118. void
  119. path_curve_get_point (PathTool *path_tool,
  120.               PathSegment *segment,
  121.               gdouble position,
  122.               gdouble *x,
  123.               gdouble *y);
  124.  
  125. void
  126. path_curve_draw_handles (Tool *tool,
  127.              PathSegment *segment);
  128.               
  129. void
  130. path_curve_draw_segment (Tool *tool,
  131.              PathSegment *segment);
  132.               
  133.  
  134. gdouble
  135. path_curve_on_segment (Tool *tool,
  136.                PathSegment *segment,
  137.                gint x,
  138.                gint y,
  139.                gint halfwidth,
  140.                gint *distance);
  141.  
  142. void
  143. path_curve_drag_segment (PathTool *path_tool,
  144.              PathSegment *segment,
  145.              gdouble position,
  146.              gdouble dx,
  147.              gdouble dy);
  148.  
  149. gint
  150. path_curve_on_handle (PathTool *path_tool,
  151.               PathSegment *segment,
  152.               gdouble x,
  153.               gdouble y,
  154.               gdouble halfwidth);
  155.  
  156. void
  157. path_curve_drag_handle (PathTool *path_tool,
  158.             PathSegment *segment,
  159.             gdouble dx,
  160.             gdouble dy,
  161.             gint handle_id);
  162.  
  163. PathSegment *
  164. path_curve_insert_anchor (PathTool *path_tool,
  165.               PathSegment *segment,
  166.               gdouble position);
  167.  
  168. void
  169. path_curve_update_segment (PathTool *path_tool,
  170.                PathSegment *segment);
  171.  
  172. void
  173. path_curve_flip_segment (PathSegment *segment);
  174.  
  175. void
  176. path_curve_init_segment (PathSegment *segment);
  177.  
  178. void
  179. path_curve_cleanup_segment (PathSegment *segment);
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. /* This is, what Soleil (Olofs little daughter) has to say to this:
  191.  
  192. fc fc g hgvfvv  drrrrrrtcc jctfcz w   sdzs d bx   cv^[ ^[c^[f c
  193. vffvcccccccccccccggfc fvx^[c^[x^[x^[x^[x^[x^[x^[ v       xbvcbvcxv cxxc xxxx^[x
  194. xz^[c^[x^[x^[x^[x^[x^[x^[xxxxxxcccccccxxxxxxxxxxxxxxxvΣ"σp'
  195. hj^[[24~^[[4~^[[1~^[[4~^[[1~^[[4~ ^[[D^[[Bk^[[B,,,,,
  196. ,^[[2~^[[4~^[[6~^[[4~l^[[6~,l' .holg^[[B^[[B n,,klmj ^[[B^[[1~j ^[[P^[[B
  197. ^[[D^[[4~^[[6~nb ^[[A^[[C ^[[Akj^[[B            ^[[A^[[C^[[A
  198.  
  199.  
  200. ...^[[1~^[[D^[[4~^[[2~^[[C^[[B,^[[A^[[2~^[[C^[[2~^[[A^[[3~^[[A^[[4~ ^[[2~
  201. ^[[2~p÷-  ., σ^[[A÷pl.,  k,km ,
  202. m,^[[5~^[[6~^[[2~^[[C^[[3~p^[[A^[[B÷^[[2~^[[B^[[6~^[[1~, .^[[D^[[4~^[[2~^[[Db
  203. .l, .,.,m ^[[2~p÷l. ik
  204. ^[[20~kl9i^[[20~^[[20~^[[20~^[[21~^[[21~^[[21~^[[21~^[[21~^[[21~^[[20~m +
  205. ^[[A^[[5~^[[G^[[D ^[[5~^[[1+^[[C
  206.  
  207. */
  208.  
  209. #endif /* __PATH_CURVES_H__ */
  210.  
  211.