Fix for #92469 (replace "Save as" by Save As"), #82492 (replace "Search Time" by

"Search Depth") and some minor code clean-up.
This commit is contained in:
Maurits Rijk 2002-11-08 22:48:08 +00:00
parent 2368c1f38e
commit efd3ed97d1
9 changed files with 98 additions and 138 deletions

View File

@ -1,14 +1,31 @@
2002-11-08 Sven Neumann <sven@gimp.org>
2002-11-08 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/script-fu/script-fu-scripts.c
* plug-ins/script-fu/interp_slib.c
* plug-ins/script-fu/interp_sliba.c: use locale-independant
functions to convert between strings and numbers so that Script-Fu
doesn't get confused in locales that don't use a dot as the
decimal point (#98014).
* plug-ins/common/papertile.c: applied a patch from David Necas
that makes the color button work again (#97976).
* plug-ins/imagemap/imap_object.c (object_get_icon): first go at fixing
#97771. Not finished yet.
2002-11-07 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/rcm/rcm_callback.c (rcm_units_string): replaced "???" by
"unknown" to avoid compiler complaining about trigraphs.
* plug-ins/rcm/rcm_callback.[ch]: have callback functions return the
right type (gboolean iso gint).
* plug-ins/rcm/rcm_misc.c (rcm_render_circle): fixed potential memory
leak
2002-11-07 Maurits Rijk <lpeek.mrijk@consunet.nl>
* plug-ins/maze/handy.c: removed superfluous function declarations
plus some minor clean-up.
* plug-ins/common/smooth_palette.c (dialog): replaced "Search Time" by
"Search Depth" (#82492)
* plug-ins/gfig/gfig.c (gfig_op_menu_create): replaced "Save as..." by
"Save As..." (solves #92469)
* plug-ins/MapObject/arcball.c: remove external function declarations
already defined in arcball.h
2002-11-07 Dave Neary <bolsh@gimp.org>

View File

@ -38,24 +38,6 @@ static double otherAxis[][4] =
{-0.48, 0.80, 0.36, 1}
};
/* Externally visible methods */
/* ========================== */
void ArcBall_Init (void);
void ArcBall_Place (HVect Center,
double Radius);
void ArcBall_UseSet (AxisSet axis_Set);
void ArcBall_Update (void);
void ArcBall_Value (HMatrix m_Now);
void ArcBall_Values (double *alpha,
double *beta,
double *gamma);
void ArcBall_BeginDrag (void);
void ArcBall_EndDrag (void);
void ArcBall_Mouse (HVect v_Now);
void ArcBall_CopyMat (HMatrix inm,
HMatrix outm);
/* Internal methods */
/* ================ */

View File

@ -70,7 +70,7 @@ query (void)
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_INT32, "width", "Width" },
{ GIMP_PDB_INT32, "height", "Height" },
{ GIMP_PDB_INT32, "ntries", "Search Time" },
{ GIMP_PDB_INT32, "ntries", "Search Depth" },
{ GIMP_PDB_INT32, "show_image","Show Image?" }
};
@ -455,7 +455,7 @@ dialog (void)
spinbutton = gimp_spin_button_new (&adj, config.ntries,
1, 1024, 1, 10, 0, 1, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("_Search Time:"), 1.0, 0.5,
_("_Search Depth:"), 1.0, 0.5,
spinbutton, 1, FALSE);
g_signal_connect (G_OBJECT (adj), "value_changed",
G_CALLBACK (gimp_int_adjustment_update),

View File

@ -5269,7 +5269,7 @@ gfig_op_menu_create (GtkWidget *window)
"activate", 'S', 0);
#endif /* 0 */
menu_item = gtk_menu_item_new_with_label (_("Save as..."));
menu_item = gtk_menu_item_new_with_label (_("Save As..."));
gtk_menu_append (GTK_MENU (gfig_op_menu), menu_item);
gtk_widget_show (menu_item);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",

View File

@ -377,15 +377,7 @@ GdkPixmap*
object_get_icon(Object_t *obj, GtkWidget *widget, GdkBitmap **mask)
{
#ifdef _NOT_READY_YET_
if (!obj->class->icon) {
GtkStyle *style = gtk_widget_get_style(widget);
obj->class->icon =
gdk_pixmap_create_from_xpm_d(widget->window, &obj->class->mask,
&style->bg[GTK_STATE_NORMAL],
obj->class->get_icon_data());
}
*mask = obj->class->mask;
#else
/* This won't work: can't get a pixmap from a stock icon */
if (!obj->class->icon) {
GtkWidget *image = gtk_image_new_from_stock(
obj->class->get_stock_icon_name(), GTK_ICON_SIZE_MENU);

View File

@ -33,19 +33,6 @@
nice little arrays. It works nicely for RGB and grayscale images,
however handling of indexed images is somewhat broken. Patches
appreciated. */
void get_colors (GimpDrawable *drawable,
guint8 *fg,
guint8 *bg);
/* drawbox draws a solid colored box in a GimpPixelRgn, hopefully fairly
quickly. See comments below. */
void drawbox (GimpPixelRgn *dest_rgn,
guint x,
guint y,
guint w,
guint h,
guint8 clr[4]);
void
get_colors (GimpDrawable *drawable,
@ -121,59 +108,43 @@ drawbox( GimpPixelRgn *dest_rgn,
guint x, guint y, guint w, guint h,
guint8 clr[4])
{
const guint bpp=dest_rgn->bpp;
const guint x_min= x * bpp;
const guint bpp = dest_rgn->bpp;
const guint x_min = x * bpp;
/* x_max = dest_rgn->bpp * MIN(dest_rgn->w, (x + w)); */
/* rowsize = x_max - x_min */
const guint rowsize=bpp * MIN(dest_rgn->w, (x + w)) - x_min;
const guint rowsize = bpp * MIN(dest_rgn->w, (x + w)) - x_min;
/* The maximum [xy] value is that of the far end of the box, or
* the edge of the region, whichever comes first. */
const guint y_max= dest_rgn->rowstride * MIN(dest_rgn->h, (y + h));
const guint y_max = dest_rgn->rowstride * MIN(dest_rgn->h, (y + h));
static guint8 *rowbuf;
static guint high_size=0;
static guint high_size = 0;
guint xx, yy;
/* Does the row buffer need to be (re)allocated? */
if (high_size == 0) {
rowbuf = g_new(guint8, rowsize);
} else if (rowsize > high_size) {
rowbuf = g_renew(guint8, rowbuf, rowsize);
}
if (high_size == 0)
{
rowbuf = g_new (guint8, rowsize);
}
else if (rowsize > high_size)
{
rowbuf = g_renew (guint8, rowbuf, rowsize);
}
high_size = MAX(high_size, rowsize);
/* Fill the row buffer with the color. */
for (xx= 0;
xx < rowsize;
xx+= bpp) {
memcpy (&rowbuf[xx], clr, bpp);
} /* next xx */
for (xx = 0; xx < rowsize; xx += bpp)
{
memcpy (&rowbuf[xx], clr, bpp);
}
/* Fill in the box in the region with rows... */
for (yy = dest_rgn->rowstride * y;
yy < y_max;
yy += dest_rgn->rowstride ) {
memcpy (&dest_rgn->data[yy+x_min], rowbuf, rowsize);
} /* next yy */
for (yy = dest_rgn->rowstride * y; yy < y_max; yy += dest_rgn->rowstride)
{
memcpy (&dest_rgn->data[yy + x_min], rowbuf, rowsize);
}
}
/* Alternate ways of doing things if you don't like memcpy. */
#if 0
for (xx= x * dest_rgn->bpp;
xx < bar;
xx+= dest_rgn->bpp) {
#if 0
for (bp=0; bp < dest_rgn->bpp; bp++) {
dest_rgn->data[yy+xx+bp]=clr[bp];
} /* next bp */
#else
memcpy (&dest_rgn->data[yy+xx], clr, dest_rgn->bpp);
#endif
} /* next xx */
} /* next yy */
}
#endif

View File

@ -87,7 +87,7 @@ rcm_units_string (gint units)
case DEGREES: return "deg";
case RADIANS: return "rad";
case RADIANS_OVER_PI: return "rad/pi";
default: return "(???)";
default: return "(unknown)";
}
}
@ -439,14 +439,14 @@ rcm_entire_image (GtkWidget *button,
/* Circle events */
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_expose_event (GtkWidget *widget,
GdkEvent *event,
RcmCircle *circle)
{
switch (circle->action_flag)
{
case DO_NOTHING: return 0;
case DO_NOTHING: return FALSE;
case VIRGIN: rcm_draw_arrows(widget->window, widget->style->black_gc,
circle->angle);
@ -456,12 +456,12 @@ rcm_expose_event (GtkWidget *widget,
rcm_render_preview(Current.Bna->after,CURRENT);
break;
}
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_button_press_event (GtkWidget *widget,
GdkEvent *event,
RcmCircle *circle)
@ -471,8 +471,8 @@ rcm_button_press_event (GtkWidget *widget,
float *beta;
GdkEventButton *bevent;
alpha = &(circle->angle->alpha);
beta = &(circle->angle->beta);
alpha = &circle->angle->alpha;
beta = &circle->angle->beta;
bevent = (GdkEventButton *) event;
circle->action_flag = DRAG_START;
@ -504,12 +504,12 @@ rcm_button_press_event (GtkWidget *widget,
else
circle->mode = BOTH;
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_release_event (GtkWidget *widget,
GdkEvent *event,
RcmCircle *circle)
@ -518,15 +518,15 @@ rcm_release_event (GtkWidget *widget,
rcm_draw_arrows(widget->window, widget->style->black_gc, circle->angle);
circle->action_flag = VIRGIN;
if (!(Current.RealTime))
if (!Current.RealTime)
rcm_render_preview(Current.Bna->after,CURRENT);
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_motion_notify_event (GtkWidget *widget,
GdkEvent *event,
RcmCircle *circle)
@ -563,7 +563,7 @@ rcm_motion_notify_event (GtkWidget *widget,
else
rcm_draw_arrows(widget->window, xor_gc, circle->angle); /* erase! */
if (circle->mode==EACH)
if (circle->mode == EACH)
*(circle->target)=clicked_angle;
else {
circle->angle->alpha=angle_mod_2PI(circle->angle->alpha + delta);
@ -582,16 +582,17 @@ rcm_motion_notify_event (GtkWidget *widget,
rcm_render_preview(Current.Bna->after, CURRENT);
}
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
/* Gray circle events */
/*---------------------------------------------------------------------------*/
gint rcm_gray_expose_event (GtkWidget *widget,
GdkEvent *event,
RcmGray *circle)
gboolean
rcm_gray_expose_event (GtkWidget *widget,
GdkEvent *event,
RcmGray *circle)
{
if (circle->action_flag == VIRGIN)
{
@ -603,12 +604,12 @@ gint rcm_gray_expose_event (GtkWidget *widget,
else if (Current.RealTime)
rcm_render_preview(Current.Bna->after, CURRENT);
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_gray_button_press_event (GtkWidget *widget,
GdkEvent *event,
RcmGray *circle)
@ -640,12 +641,12 @@ rcm_gray_button_press_event (GtkWidget *widget,
if (Current.RealTime)
rcm_render_preview(Current.Bna->after,CURRENT);
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_gray_release_event (GtkWidget *widget,
GdkEvent *event,
RcmGray *circle)
@ -658,14 +659,14 @@ rcm_gray_release_event (GtkWidget *widget,
circle->action_flag = VIRGIN;
if (!(Current.RealTime)) rcm_render_preview(Current.Bna->after, CURRENT);
if (!Current.RealTime) rcm_render_preview(Current.Bna->after, CURRENT);
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/
gint
gboolean
rcm_gray_motion_notify_event (GtkWidget *widget,
GdkEvent *event,
RcmGray *circle)
@ -708,7 +709,7 @@ rcm_gray_motion_notify_event (GtkWidget *widget,
if (Current.RealTime) rcm_render_preview(Current.Bna->after, CURRENT);
return 1;
return TRUE;
}
/*---------------------------------------------------------------------------*/

View File

@ -97,25 +97,33 @@ void rcm_entire_image(GtkWidget *button, gpointer *value);
/* Circle events */
/*---------------------------------------------------------------------------*/
gint rcm_expose_event(GtkWidget *widget, GdkEvent *event, RcmCircle *circle);
gboolean rcm_expose_event(GtkWidget *widget, GdkEvent *event,
RcmCircle *circle);
gint rcm_button_press_event(GtkWidget *widget, GdkEvent *event, RcmCircle *circle);
gboolean rcm_button_press_event(GtkWidget *widget, GdkEvent *event,
RcmCircle *circle);
gint rcm_release_event(GtkWidget *widget, GdkEvent *event, RcmCircle *circle);
gboolean rcm_release_event(GtkWidget *widget, GdkEvent *event,
RcmCircle *circle);
gint rcm_motion_notify_event(GtkWidget *widget, GdkEvent *event, RcmCircle *circle);
gboolean rcm_motion_notify_event(GtkWidget *widget, GdkEvent *event,
RcmCircle *circle);
/*---------------------------------------------------------------------------*/
/* Gray circle events */
/*---------------------------------------------------------------------------*/
gint rcm_gray_expose_event(GtkWidget *widget, GdkEvent *event, RcmGray *circle);
gboolean rcm_gray_expose_event(GtkWidget *widget, GdkEvent *event,
RcmGray *circle);
gint rcm_gray_button_press_event(GtkWidget *widget, GdkEvent *event, RcmGray *circle);
gboolean rcm_gray_button_press_event(GtkWidget *widget, GdkEvent *event,
RcmGray *circle);
gint rcm_gray_release_event(GtkWidget *widget, GdkEvent *event, RcmGray *circle);
gboolean rcm_gray_release_event(GtkWidget *widget, GdkEvent *event,
RcmGray *circle);
gint rcm_gray_motion_notify_event(GtkWidget *widget, GdkEvent *event, RcmGray *circle);
gboolean rcm_gray_motion_notify_event(GtkWidget *widget, GdkEvent *event,
RcmGray *circle);
/*---------------------------------------------------------------------------*/
/* Spinbuttons */

View File

@ -55,8 +55,6 @@
#include "rcm_misc.h"
#include "rcm_gdk.h"
/*-----------------------------------------------------------------------------------*/
float
arctg (float y,
float x)
@ -65,14 +63,6 @@ arctg (float y,
return (temp<0) ? (temp+TP) : temp;
}
inline
float sign (float x)
{
return (x<0)?(-1):(1);
}
/*-----------------------------------------------------------------------------------*/
float
min_prox (float alpha,
float beta,
@ -177,11 +167,10 @@ rcm_angle_inside_slice (float angle,
angle_mod_2PI(slice->cw_ccw * (slice->beta-slice->alpha));
}
gint
gboolean
rcm_is_gray (float s)
{
if (s <= Current.Gray->gray_sat) return 1;
return 0;
return (s <= Current.Gray->gray_sat);
}
/*-----------------------------------------------------------------------------------*/
@ -481,9 +470,9 @@ rcm_render_circle (GtkWidget *preview,
gdouble h, s, v;
guchar *a;
a = g_new (guchar, 3*sum);
if (preview == NULL) return;
a = g_new (guchar, 3*sum);
for (j = 0; j < sum; j++)
{