gimp/app/resize.h
Michael Natterer 4a13995205 app/commands.c app/crop.c app/file_new_dialog.c app/info_dialog.[ch]
1999-05-31  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/commands.c
	* app/crop.c
	* app/file_new_dialog.c
	* app/info_dialog.[ch]
	* app/interface.c
	* app/layers_dialog.c
	* app/resize.[ch]
	* app/rotate_tool.c
	* app/scale_tool.c
	* app/shear_tool.c: finished the float->double migration for
	resolution values. Standardized the order of function calls which
	initialize sizeentries. Fixed some off-by-one errors by using
	correct double->int casting. Use the g* counterparts of int and
	double in some places. Various code cleanups.

	* app/preferences_dialog.c: same changes as above plus a cleaner
	implementation of the mem_size_unit stuff. The whole dialog should
	behave like before.
1999-05-31 14:11:10 +00:00

83 lines
2.2 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __RESIZE_H__
#define __RESIZE_H__
#include "libgimp/gimpunit.h"
typedef enum
{
ScaleWidget,
ResizeWidget
} ResizeType;
typedef enum
{
ResizeImage,
ResizeLayer
} ResizeTarget;
typedef struct _Resize Resize;
struct _Resize
{
/* The calling procedure is respondible for showing this widget */
GtkWidget *resize_shell;
ResizeType type;
ResizeTarget target;
gint width;
gint height;
gdouble resolution_x;
gdouble resolution_y;
GUnit unit;
gdouble ratio_x;
gdouble ratio_y;
gint offset_x;
gint offset_y;
/* Don't touch this :) */
void * private_part;
};
/* If resolution_x is zero, then don't show resolution modification
* parts of the dialog. If object is non-NULL, then attach the cancel
* callback to its destroy signal. */
Resize * resize_widget_new (ResizeType type,
ResizeTarget target,
GtkObject * object,
gint width,
gint height,
gdouble resolution_x,
gdouble resolution_y,
GUnit unit,
gboolean dot_for_dot,
GtkSignalFunc ok_cb,
GtkSignalFunc cancel_cb,
gint (*delete_cb) (GtkWidget *,
GdkEvent *,
gpointer),
gpointer user_data);
void resize_widget_free (Resize * resize);
#endif /* __RESIZE_H__ */