home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / path.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-16  |  2.9 KB  |  89 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1999 Andy Thomas alt@picnic.demon.co.uk
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18. #ifndef  __PATH_H__
  19. #define  __PATH_H__
  20.  
  21. #include "bezier_select.h"
  22.  
  23. typedef struct _Path      Path;
  24. typedef struct _PathPoint PathPoint;
  25.  
  26. typedef GSList PathUndo;
  27.  
  28. typedef struct 
  29. {
  30.   GimpImage *gimage;
  31.   GDisplay  *gdisp; /* This is a hack.. Needed so we can get back to 
  32.                      * the same display that these curves were added
  33.              * too. That way when an entry in the paths dialog
  34.              * is clicked the bezier tool can be targeted at 
  35.              * correct display. Note this display could have been
  36.              * deleted (ie different view), but gdisplays_check_valid()
  37.              * function will take care of that.. In this case we just
  38.              * pick a display that the gimage is rendered in.
  39.              */
  40.   GSList    *bz_paths;  /* list of BZPATHP */
  41.   guint      sig_id;
  42.   gint32     last_selected_row;
  43. } PathList;
  44.  
  45. typedef enum 
  46. {
  47.   BEZIER = 1
  48. } PathType;
  49.  
  50. Path*         path_new                  (GimpImage *gimage,
  51.                      PathType   ptype,
  52.                      GSList    *path_details,
  53.                      gint       closed,
  54.                      gint       state,
  55.                      gint       locked,
  56.                      gint       tattoo,  
  57.                      gchar     *name);
  58. Path*         path_copy                 (GimpImage *gimage, 
  59.                      Path      *path);
  60. void          path_free                 (Path      *path);
  61.  
  62. Tattoo        path_get_tattoo           (Path      *path);
  63. Path*         path_get_path_by_tattoo   (GimpImage *gimage, 
  64.                      Tattoo     tattoo);
  65.  
  66. void          path_stroke               (GimpImage *gimage,
  67.                      PathList  *pl,
  68.                      Path      *bzp);
  69. gint          path_distance             (Path      *bzp,
  70.                      gdouble    dist,
  71.                      gint      *x,
  72.                      gint      *y, 
  73.                      gdouble   *grad);
  74.  
  75. PathPoint*    path_point_new            (guint      type, 
  76.                      gdouble    x, 
  77.                      gdouble    y);
  78. void          path_point_free           (PathPoint *pathpoint);
  79.  
  80. PathList*     path_list_new             (GimpImage *gimage, 
  81.                      gint       last_selected_row, 
  82.                      GSList    *bz_paths);
  83. void          path_list_free            (PathList  *plist);
  84.  
  85. BezierSelect* path_to_beziersel         (Path      *path);
  86.  
  87. #endif  /*  __PATH_H__  */
  88.  
  89.