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

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  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 __RESIZE_H__
  19. #define __RESIZE_H__
  20.  
  21. #include "libgimp/gimpunit.h"
  22. #include "gimage.h"
  23.  
  24. typedef enum
  25. {
  26.   ScaleWidget,
  27.   ResizeWidget
  28. } ResizeType;
  29.  
  30. typedef enum
  31. {
  32.   ResizeImage,
  33.   ResizeLayer
  34. } ResizeTarget;
  35.  
  36. typedef struct _Resize Resize;
  37.  
  38. struct _Resize
  39. {
  40.   GtkWidget   *resize_shell;
  41.  
  42.   ResizeType   type;
  43.   ResizeTarget target;
  44.  
  45.   gint         width;
  46.   gint         height;
  47.  
  48.   gdouble      resolution_x;
  49.   gdouble      resolution_y;
  50.   GimpUnit     unit;
  51.  
  52.   gdouble      ratio_x;
  53.   gdouble      ratio_y;
  54.  
  55.   gint         offset_x;
  56.   gint         offset_y;
  57.  
  58.   /*  Don't touch this :)  */
  59.   void *       private_part;
  60. };
  61.  
  62. typedef struct
  63. {
  64.   Resize    *resize;
  65.   GimpImage *gimage;
  66. } ImageResize;
  67.  
  68. /*  If resolution_x is zero, then don't show resolution modification
  69.  *  parts of the dialog.
  70.  *
  71.  *  If object and signal are non-NULL, then attach the cancel callback to signal.
  72.  *
  73.  *  If cancel_callback is NULL, then the dialog will be destroyed on "Cancel".
  74.  */
  75.  
  76. Resize * resize_widget_new    (ResizeType    type,
  77.                    ResizeTarget  target,
  78.                    GtkObject    *object,
  79.                    gchar        *signal,
  80.                    gint          width,
  81.                    gint          height,
  82.                    gdouble       resolution_x,
  83.                    gdouble       resolution_y,
  84.                    GimpUnit      unit,
  85.                    gboolean      dot_for_dot,
  86.                    GtkSignalFunc ok_cb,
  87.                    GtkSignalFunc cancel_cb,
  88.                    gpointer      user_data);
  89.  
  90. /* Layer scaling sanity check and warning dialogs */
  91.  
  92. gboolean resize_check_layer_scaling (ImageResize *image_resize);
  93. void     resize_scale_implement     (ImageResize *image_resize);
  94.  
  95. #endif  /*  __RESIZE_H__  */
  96.