don't clear the selection after creating the path. Minor cleanups.
2003-05-15 Michael Natterer <mitch@gimp.org> * plug-ins/sel2path/sel2path.c: don't clear the selection after creating the path. Minor cleanups.
This commit is contained in:

committed by
Michael Natterer

parent
60935d5028
commit
9c48f76b50
@ -1,3 +1,8 @@
|
|||||||
|
2003-05-15 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/sel2path/sel2path.c: don't clear the selection after
|
||||||
|
creating the path. Minor cleanups.
|
||||||
|
|
||||||
2003-05-15 Sven Neumann <sven@gimp.org>
|
2003-05-15 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/pdb/fileops_cmds.c
|
* app/pdb/fileops_cmds.c
|
||||||
|
@ -55,10 +55,10 @@
|
|||||||
/* Variables set in dialog box */
|
/* Variables set in dialog box */
|
||||||
|
|
||||||
static void query (void);
|
static void query (void);
|
||||||
static void run (gchar *name,
|
static void run (gchar *name,
|
||||||
gint nparams,
|
gint nparams,
|
||||||
GimpParam *param,
|
GimpParam *param,
|
||||||
gint *nreturn_vals,
|
gint *nreturn_vals,
|
||||||
GimpParam **return_vals);
|
GimpParam **return_vals);
|
||||||
|
|
||||||
static gint sel2path_dialog (SELVALS *sels);
|
static gint sel2path_dialog (SELVALS *sels);
|
||||||
@ -88,9 +88,16 @@ gboolean retVal = TRUE; /* Toggle if cancle button clicked */
|
|||||||
MAIN ()
|
MAIN ()
|
||||||
|
|
||||||
static void
|
static void
|
||||||
query_2 (void)
|
query (void)
|
||||||
{
|
{
|
||||||
static GimpParamDef args[] =
|
static GimpParamDef args[] =
|
||||||
|
{
|
||||||
|
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
|
||||||
|
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
|
||||||
|
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
||||||
|
};
|
||||||
|
|
||||||
|
static GimpParamDef advanced_args[] =
|
||||||
{
|
{
|
||||||
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
|
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
|
||||||
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
|
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
|
||||||
@ -116,33 +123,6 @@ query_2 (void)
|
|||||||
{ GIMP_PDB_FLOAT, "subdivide_threshold", "subdivide_threshold"},
|
{ GIMP_PDB_FLOAT, "subdivide_threshold", "subdivide_threshold"},
|
||||||
{ GIMP_PDB_INT8, "tangent_surround", "tangent_surround"},
|
{ GIMP_PDB_INT8, "tangent_surround", "tangent_surround"},
|
||||||
};
|
};
|
||||||
static GimpParamDef *return_vals = NULL;
|
|
||||||
static int nreturn_vals = 0;
|
|
||||||
|
|
||||||
gimp_install_procedure ("plug_in_sel2path_advanced",
|
|
||||||
"Converts a selection to a path (with advanced user menu)",
|
|
||||||
"Converts a selection to a path (with advanced user menu)",
|
|
||||||
"Andy Thomas",
|
|
||||||
"Andy Thomas",
|
|
||||||
"1999",
|
|
||||||
NULL,
|
|
||||||
"RGB*, INDEXED*, GRAY*",
|
|
||||||
GIMP_PLUGIN,
|
|
||||||
G_N_ELEMENTS (args), nreturn_vals,
|
|
||||||
args, return_vals);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
query (void)
|
|
||||||
{
|
|
||||||
static GimpParamDef args[] =
|
|
||||||
{
|
|
||||||
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
|
|
||||||
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
|
|
||||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
|
||||||
};
|
|
||||||
static GimpParamDef *return_vals = NULL;
|
|
||||||
static int nreturn_vals = 0;
|
|
||||||
|
|
||||||
gimp_install_procedure ("plug_in_sel2path",
|
gimp_install_procedure ("plug_in_sel2path",
|
||||||
"Converts a selection to a path",
|
"Converts a selection to a path",
|
||||||
@ -153,10 +133,20 @@ query (void)
|
|||||||
N_("<Image>/Select/To Path"),
|
N_("<Image>/Select/To Path"),
|
||||||
"RGB*, INDEXED*, GRAY*",
|
"RGB*, INDEXED*, GRAY*",
|
||||||
GIMP_PLUGIN,
|
GIMP_PLUGIN,
|
||||||
G_N_ELEMENTS (args), nreturn_vals,
|
G_N_ELEMENTS (args), 0,
|
||||||
args, return_vals);
|
args, NULL);
|
||||||
|
|
||||||
query_2 ();
|
gimp_install_procedure ("plug_in_sel2path_advanced",
|
||||||
|
"Converts a selection to a path (with advanced user menu)",
|
||||||
|
"Converts a selection to a path (with advanced user menu)",
|
||||||
|
"Andy Thomas",
|
||||||
|
"Andy Thomas",
|
||||||
|
"1999",
|
||||||
|
NULL,
|
||||||
|
"RGB*, INDEXED*, GRAY*",
|
||||||
|
GIMP_PLUGIN,
|
||||||
|
G_N_ELEMENTS (advanced_args), 0,
|
||||||
|
advanced_args, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -245,11 +235,10 @@ run (gchar *name,
|
|||||||
selVals.subdivide_surround = param[20].data.d_int8;
|
selVals.subdivide_surround = param[20].data.d_int8;
|
||||||
selVals.subdivide_threshold = param[21].data.d_float;
|
selVals.subdivide_threshold = param[21].data.d_float;
|
||||||
selVals.tangent_surround = param[22].data.d_int8;
|
selVals.tangent_surround = param[22].data.d_int8;
|
||||||
fit_set_params(&selVals);
|
fit_set_params (&selVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_RUN_WITH_LAST_VALS:
|
case GIMP_RUN_WITH_LAST_VALS:
|
||||||
if(gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
|
if(gimp_get_data_size ("plug_in_sel2path_advanced") > 0)
|
||||||
{
|
{
|
||||||
@ -258,9 +247,8 @@ run (gchar *name,
|
|||||||
/* Set up the last values */
|
/* Set up the last values */
|
||||||
fit_set_params (&selVals);
|
fit_set_params (&selVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -584,11 +572,10 @@ do_sel2path (gint32 drawable_ID,
|
|||||||
|
|
||||||
splines = fitted_splines (olt);
|
splines = fitted_splines (olt);
|
||||||
|
|
||||||
gimp_selection_none (image_ID);
|
|
||||||
gimp_displays_flush ();
|
|
||||||
|
|
||||||
do_points (splines, image_ID);
|
do_points (splines, image_ID);
|
||||||
|
|
||||||
|
gimp_displays_flush ();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user