Commit f1d9ba63 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

renamed ZoomType to GimpZoomZype and added it here.

2001-03-03  Michael Natterer  <mitch@gimp.org>

	* app/appenums.h: renamed ZoomType to GimpZoomZype and added it
	here.

	* app/commands.c
	* app/disp_callbacks.c
	* app/nav_window.c
	* app/scale.[ch]: changed accordingly.

	* app/tools/Makefile.am
	* app/tools/magnify.[ch]: back as object.

	* app/tools/tool.c: removed the old ToolInfo entry.

	* app/tools/tools.c: register it.
parent 5362220b
2001-03-03 Michael Natterer <mitch@gimp.org>
* app/appenums.h: renamed ZoomType to GimpZoomZype and added it
here.
* app/commands.c
* app/disp_callbacks.c
* app/nav_window.c
* app/scale.[ch]: changed accordingly.
* app/tools/Makefile.am
* app/tools/magnify.[ch]: back as object.
* app/tools/tool.c: removed the old ToolInfo entry.
* app/tools/tools.c: register it.
2001-03-02 Michael Natterer <mitch@gimp.org>
* app/tools/Makefile.am
......
......@@ -502,7 +502,7 @@ view_zoomin_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
void
......@@ -512,7 +512,7 @@ view_zoomout_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -124,8 +124,6 @@ typedef enum
ONCE_END_COLOR /* paint once, but keep painting with the end color */
} GradientPaintMode;
/* gradient paint modes */
typedef enum
{
LINEAR_INTERPOLATION,
......@@ -147,6 +145,12 @@ typedef enum
UNKNOWN
} OrientationType;
typedef enum /*< skip >*/
{
GIMP_ZOOM_IN,
GIMP_ZOOM_OUT
} GimpZoomType;
/* Procedural database types */
typedef enum
{
......
......@@ -502,7 +502,7 @@ view_zoomin_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
void
......@@ -512,7 +512,7 @@ view_zoomout_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -338,7 +338,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON4_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -356,7 +356,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON5_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......
......@@ -338,7 +338,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON4_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -356,7 +356,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON5_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......
......@@ -98,12 +98,12 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
ZoomType zoom_type)
change_scale (GDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
guchar scalesrc, scaledest;
gdouble offset_x, offset_y;
glong sx, sy;
glong sx, sy;
/* user zoom control, so resolution versions not needed -- austin */
scalesrc = SCALESRC (gdisp);
......@@ -117,7 +117,7 @@ change_scale (GDisplay *gdisp,
switch (zoom_type)
{
case ZOOMIN :
case GIMP_ZOOM_IN:
if (scalesrc > 1)
scalesrc--;
else
......@@ -127,7 +127,7 @@ change_scale (GDisplay *gdisp,
return;
break;
case ZOOMOUT :
case GIMP_ZOOM_OUT:
if (scaledest > 1)
scaledest--;
else
......@@ -137,7 +137,7 @@ change_scale (GDisplay *gdisp,
return;
break;
default :
default:
scalesrc = zoom_type % 100;
if (scalesrc < 1)
scalesrc = 1;
......
......@@ -20,21 +20,14 @@
#define __SCALE_H__
typedef enum
{
ZOOMIN,
ZOOMOUT
} ZoomType;
void change_scale (GDisplay *gdisp,
ZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void change_scale (GDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
#endif /* __SCALE_H__ */
......@@ -338,7 +338,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON4_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -356,7 +356,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
state |= GDK_BUTTON5_MASK;
if (state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......
......@@ -98,12 +98,12 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
ZoomType zoom_type)
change_scale (GDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
guchar scalesrc, scaledest;
gdouble offset_x, offset_y;
glong sx, sy;
glong sx, sy;
/* user zoom control, so resolution versions not needed -- austin */
scalesrc = SCALESRC (gdisp);
......@@ -117,7 +117,7 @@ change_scale (GDisplay *gdisp,
switch (zoom_type)
{
case ZOOMIN :
case GIMP_ZOOM_IN:
if (scalesrc > 1)
scalesrc--;
else
......@@ -127,7 +127,7 @@ change_scale (GDisplay *gdisp,
return;
break;
case ZOOMOUT :
case GIMP_ZOOM_OUT:
if (scaledest > 1)
scaledest--;
else
......@@ -137,7 +137,7 @@ change_scale (GDisplay *gdisp,
return;
break;
default :
default:
scalesrc = zoom_type % 100;
if (scalesrc < 1)
scalesrc = 1;
......
......@@ -20,21 +20,14 @@
#define __SCALE_H__
typedef enum
{
ZOOMIN,
ZOOMOUT
} ZoomType;
void change_scale (GDisplay *gdisp,
ZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void change_scale (GDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
#endif /* __SCALE_H__ */
......@@ -847,7 +847,7 @@ nav_window_preview_events (GtkWidget *widget,
case 4:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -864,7 +864,7 @@ nav_window_preview_events (GtkWidget *widget,
case 5:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......@@ -935,10 +935,10 @@ nav_window_preview_events (GtkWidget *widget,
ty = iwd->dispy + 1;
break;
case GDK_equal:
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
break;
case GDK_minus:
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
break;
default:
break;
......@@ -1071,7 +1071,7 @@ navwindow_zoomin (GtkWidget *widget,
if(!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMIN);
change_scale (iwd->gdisp, GIMP_ZOOM_IN);
}
static void
......@@ -1085,7 +1085,7 @@ navwindow_zoomout (GtkWidget *widget,
if (!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMOUT);
change_scale (iwd->gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -847,7 +847,7 @@ nav_window_preview_events (GtkWidget *widget,
case 4:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -864,7 +864,7 @@ nav_window_preview_events (GtkWidget *widget,
case 5:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......@@ -935,10 +935,10 @@ nav_window_preview_events (GtkWidget *widget,
ty = iwd->dispy + 1;
break;
case GDK_equal:
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
break;
case GDK_minus:
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
break;
default:
break;
......@@ -1071,7 +1071,7 @@ navwindow_zoomin (GtkWidget *widget,
if(!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMIN);
change_scale (iwd->gdisp, GIMP_ZOOM_IN);
}
static void
......@@ -1085,7 +1085,7 @@ navwindow_zoomout (GtkWidget *widget,
if (!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMOUT);
change_scale (iwd->gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -502,7 +502,7 @@ view_zoomin_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
void
......@@ -512,7 +512,7 @@ view_zoomout_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -502,7 +502,7 @@ view_zoomin_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
void
......@@ -512,7 +512,7 @@ view_zoomout_cmd_callback (GtkWidget *widget,
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -847,7 +847,7 @@ nav_window_preview_events (GtkWidget *widget,
case 4:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
}
else
{
......@@ -864,7 +864,7 @@ nav_window_preview_events (GtkWidget *widget,
case 5:
if (bevent->state & GDK_SHIFT_MASK)
{
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
}
else
{
......@@ -935,10 +935,10 @@ nav_window_preview_events (GtkWidget *widget,
ty = iwd->dispy + 1;
break;
case GDK_equal:
change_scale (gdisp, ZOOMIN);
change_scale (gdisp, GIMP_ZOOM_IN);
break;
case GDK_minus:
change_scale (gdisp, ZOOMOUT);
change_scale (gdisp, GIMP_ZOOM_OUT);
break;
default:
break;
......@@ -1071,7 +1071,7 @@ navwindow_zoomin (GtkWidget *widget,
if(!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMIN);
change_scale (iwd->gdisp, GIMP_ZOOM_IN);
}
static void
......@@ -1085,7 +1085,7 @@ navwindow_zoomout (GtkWidget *widget,
if (!iwd || iwd->frozen == TRUE)
return;
change_scale (iwd->gdisp, ZOOMOUT);
change_scale (iwd->gdisp, GIMP_ZOOM_OUT);
}
static void
......
......@@ -98,12 +98,12 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
ZoomType zoom_type)
change_scale (GDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
guchar scalesrc, scaledest;
gdouble offset_x, offset_y;
glong sx, sy;
glong sx, sy;
/* user zoom control, so resolution versions not needed -- austin */
scalesrc = SCALESRC (gdisp);
......@@ -117,7 +117,7 @@ change_scale (GDisplay *gdisp,
switch (zoom_type)
{
case ZOOMIN :
case GIMP_ZOOM_IN:
if (scalesrc > 1)
scalesrc--;
else
......@@ -127,7 +127,7 @@ change_scale (GDisplay *gdisp,
return;
break;
case ZOOMOUT :
case GIMP_ZOOM_OUT:
if (scaledest > 1)
scaledest--;
else
......@@ -137,7 +137,7 @@ change_scale (GDisplay *gdisp,
return;
break;
default :
default:
scalesrc = zoom_type % 100;
if (scalesrc < 1)
scalesrc = 1;
......
......@@ -20,21 +20,14 @@
#define __SCALE_H__
typedef enum
{
ZOOMIN,
ZOOMOUT
} ZoomType;
void change_scale (GDisplay *gdisp,
ZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void change_scale (GDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
#endif /* __SCALE_H__ */
......@@ -62,8 +62,8 @@ libapptools_la_SOURCES = \
## iscissors.h \
## levels.c \
## levels.h \
## magnify.c \
## magnify.h \
magnify.c \
magnify.h \
measure.c \
measure.h \
move.c \
......
......@@ -28,7 +28,6 @@
#include "apptypes.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "gdisplay.h"
#include "gimprc.h"
#include "info_window.h"
......@@ -36,60 +35,52 @@
#include "magnify.h"
#include "tool_options.h"
#include "tools.h"
#include "tool_manager.h"
#include "libgimp/gimpintl.h"
#include "pixmaps2.h"
/* the magnify structures */
typedef struct _Magnify Magnify;
struct _Magnify
{
DrawCore *core; /* Core select object */
gint x, y; /* upper left hand coordinate */
gint w, h; /* width and height */
gint op; /* magnify operation */
};
typedef struct _MagnifyOptions MagnifyOptions;
struct _MagnifyOptions
{
ToolOptions tool_options;
ToolOptions tool_options;
/* gint allow_resize_windows; (from gimprc) */
gint allow_resize_d;
GtkWidget *allow_resize_w;
/* gint allow_resize_windows; (from gimprc) */
gint allow_resize_d;
GtkWidget *allow_resize_w;
ZoomType type;
ZoomType type_d;
GtkWidget *type_w[2];
GimpZoomType type;
GimpZoomType type_d;
GtkWidget *type_w[2];
};
/* magnify action functions */
static void magnify_button_press (Tool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void magnify_button_release (Tool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void magnify_motion (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void magnify_modifier_update (Tool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void magnify_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void magnify_control (Tool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void gimp_magnify_tool_class_init (GimpMagnifyToolClass *klass);
static void gimp_magnify_tool_init (GimpMagnifyTool *tool);
static void gimp_magnify_tool_destroy (GtkObject *object);
static void gimp_magnify_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_magnify_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_magnify_tool_motion (GimpTool *tool,