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

renamed parameters to be consistent with the other foo-select.* files.



2002-03-13  Michael Natterer  <mitch@gimp.org>

	* app/gui/brush-select.[ch]: renamed parameters to be consistent
	with the other foo-select.* files.

	* app/gui/tool-options-dialog.c: removed unused function.

	* app/plug-in/plug-in-types.h: PlugInImageType was accidentially
	exported to the PDB.

	* tools/pdbgen/enums.pl
	* libgimp/gimpenums.h
	* plug-ins/script-fu/script-fu-constants.c: regenerated.

	More brush, pattern, ... PDB wrapper cleanup:

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/palette_select.pdb
	* tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard
	all functions with if(!gimp->no_interface).

	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palettes.pdb
	* tools/pdbgen/pdb/patterns.pdb: reordered functions to be
	consistent across all files. Generate libgimp wrappers for *all*
	functions because of API symmetry.

	* tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active
	to gradients_[get|set]_gradient because of API symmetry.

	* libgimp/gimpcompat.h: added the old function names here, guard
	the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah).

	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/gflare/gflare.c: use the new function names.

	* libgimp/gimpbrushes_pdb.[ch]
	* libgimp/gimpgradients_pdb.[ch]
	* libgimp/gimppalettes_pdb.[ch]
	* libgimp/gimppatterns_pdb.[ch]
	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/palette_select_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c: regenerated.
parent fb9b0344
2002-03-13 Michael Natterer <mitch@gimp.org>
* app/gui/brush-select.[ch]: renamed parameters to be consistent
with the other foo-select.* files.
* app/gui/tool-options-dialog.c: removed unused function.
* app/plug-in/plug-in-types.h: PlugInImageType was accidentially
exported to the PDB.
* tools/pdbgen/enums.pl
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c: regenerated.
More brush, pattern, ... PDB wrapper cleanup:
* tools/pdbgen/pdb/brush_select.pdb
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/palette_select.pdb
* tools/pdbgen/pdb/pattern_select.pdb: even more cleanup, guard
all functions with if(!gimp->no_interface).
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/palettes.pdb
* tools/pdbgen/pdb/patterns.pdb: reordered functions to be
consistent across all files. Generate libgimp wrappers for *all*
functions because of API symmetry.
* tools/pdbgen/pdb/gradients.pdb: renamed gradients_[get|set]_active
to gradients_[get|set]_gradient because of API symmetry.
* libgimp/gimpcompat.h: added the old function names here, guard
the whole file with GIMP_ENABLE_COMPAT_CRUFT (it's back, yeah).
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/gflare/gflare.c: use the new function names.
* libgimp/gimpbrushes_pdb.[ch]
* libgimp/gimpgradients_pdb.[ch]
* libgimp/gimppalettes_pdb.[ch]
* libgimp/gimppatterns_pdb.[ch]
* app/pdb/brush_select_cmds.c
* app/pdb/brushes_cmds.c
* app/pdb/gradient_select_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/palette_select_cmds.c
* app/pdb/palettes_cmds.c
* app/pdb/pattern_select_cmds.c
* app/pdb/patterns_cmds.c: regenerated.
2002-03-13 Sven Neumann <sven@gimp.org>
 
* app/core/core-enums.h: register GimpChannelType and
......
......@@ -86,14 +86,14 @@ static GSList *brush_active_dialogs = NULL;
/* public functions */
BrushSelect *
brush_select_new (Gimp *gimp,
GimpContext *context,
const gchar *title,
const gchar *init_name,
gdouble init_opacity,
gint init_spacing,
gint init_mode,
const gchar *callback_name)
brush_select_new (Gimp *gimp,
GimpContext *context,
const gchar *title,
const gchar *initial_brush,
gdouble initial_opacity,
GimpLayerModeEffects initial_mode,
gint initial_spacing,
const gchar *callback_name)
{
BrushSelect *bsp;
GtkWidget *sep;
......@@ -113,11 +113,11 @@ brush_select_new (Gimp *gimp,
first_call = FALSE;
if (init_name && strlen (init_name))
if (initial_brush && strlen (initial_brush))
{
active = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container,
init_name);
initial_brush);
}
if (! active)
......@@ -150,9 +150,9 @@ brush_select_new (Gimp *gimp,
}
gimp_context_set_brush (bsp->context, active);
gimp_context_set_paint_mode (bsp->context, init_mode);
gimp_context_set_opacity (bsp->context, init_opacity);
bsp->spacing_value = init_spacing;
gimp_context_set_paint_mode (bsp->context, initial_mode);
gimp_context_set_opacity (bsp->context, initial_opacity);
bsp->spacing_value = initial_spacing;
g_signal_connect (G_OBJECT (bsp->context), "brush_changed",
G_CALLBACK (brush_select_brush_changed),
......@@ -234,10 +234,10 @@ brush_select_new (Gimp *gimp,
spacing_adj = GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment;
if (init_spacing >= 0)
if (initial_spacing >= 0)
{
/* Use passed spacing instead of brushes default */
gtk_adjustment_set_value (spacing_adj, init_spacing);
gtk_adjustment_set_value (spacing_adj, initial_spacing);
}
g_signal_connect (G_OBJECT (spacing_adj), "value_changed",
......
......@@ -35,17 +35,17 @@ struct _BrushSelect
};
BrushSelect * brush_select_new (Gimp *gimp,
GimpContext *context,
const gchar *title,
const gchar *init_name,
gdouble init_opacity,
gint init_spacing,
gint init_mode,
const gchar *callback_name);
void brush_select_free (BrushSelect *bsp);
BrushSelect * brush_select_get_by_callback (const gchar *callback_name);
BrushSelect * brush_select_new (Gimp *gimp,
GimpContext *context,
const gchar *title,
const gchar *initial_brush,
gdouble initial_opacity,
GimpLayerModeEffects initial_mode,
gint initial_spacing,
const gchar *callback_name);
void brush_select_free (BrushSelect *bsp);
BrushSelect * brush_select_get_by_callback (const gchar *callback_name);
void brush_select_dialogs_check (void);
......
......@@ -48,13 +48,9 @@ static void tool_options_dialog_destroy (GtkWidget *widget,
static void tool_options_dialog_tool_changed (GimpContext *context,
GimpToolInfo *tool_info,
gpointer data);
static void tool_options_dialog_drop_tool (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static GimpViewable * tool_options_dialog_drag_tool (GtkWidget *widget,
gpointer data);
static void tool_options_dialog_save_callback (GtkWidget *widget,
GimpContext *context);
static void tool_options_dialog_restore_callback (GtkWidget *widget,
......@@ -249,17 +245,6 @@ tool_options_dialog_drop_tool (GtkWidget *widget,
gimp_context_set_tool (context, GIMP_TOOL_INFO (viewable));
}
GimpViewable *
tool_options_dialog_drag_tool (GtkWidget *widget,
gpointer data)
{
GimpContext *context;
context = GIMP_CONTEXT (data);
return (GimpViewable *) gimp_context_get_tool (context);
}
static void
tool_options_dialog_save_callback (GtkWidget *widget,
GimpContext *context)
......
......@@ -62,8 +62,7 @@ brushes_popup_invoker (Gimp *gimp,
gdouble opacity;
gint32 spacing;
gint32 paint_mode;
ProcRecord *prec;
BrushSelect *newdialog;
ProcRecord *proc;
brush_callback = (gchar *) args[0].value.pdb_pointer;
if (brush_callback == NULL)
......@@ -89,22 +88,23 @@ brushes_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, brush_callback)))
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, brush_callback)))
{
if (initial_brush && strlen (initial_brush))
newdialog = brush_select_new (gimp, NULL, popup_title,
initial_brush,
opacity / 100.0,
spacing,
paint_mode,
brush_callback);
brush_select_new (gimp, NULL, popup_title,
initial_brush,
opacity / 100.0,
paint_mode,
spacing,
brush_callback);
else
newdialog = brush_select_new (gimp, NULL, popup_title,
NULL,
0.0,
0,
0,
brush_callback);
brush_select_new (gimp, NULL, popup_title,
NULL,
0.0,
0,
0,
brush_callback);
}
else
{
......@@ -171,7 +171,7 @@ brushes_close_popup_invoker (Gimp *gimp,
{
gboolean success = TRUE;
gchar *brush_callback;
ProcRecord *prec;
ProcRecord *proc;
BrushSelect *bsp;
brush_callback = (gchar *) args[0].value.pdb_pointer;
......@@ -180,7 +180,8 @@ brushes_close_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, brush_callback)) &&
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, brush_callback)) &&
(bsp = brush_select_get_by_callback (brush_callback)))
{
brush_select_free (bsp);
......@@ -229,7 +230,7 @@ brushes_set_popup_invoker (Gimp *gimp,
gdouble opacity;
gint32 spacing;
gint32 paint_mode;
ProcRecord *prec;
ProcRecord *proc;
BrushSelect *bsp;
brush_callback = (gchar *) args[0].value.pdb_pointer;
......@@ -254,16 +255,18 @@ brushes_set_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, brush_callback)) &&
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, brush_callback)) &&
(bsp = brush_select_get_by_callback (brush_callback)))
{
GimpObject *object =
GimpBrush *active = (GimpBrush *)
gimp_container_get_child_by_name (gimp->brush_factory->container,
brush_name);
if (object)
success = (active != NULL);
if (success)
{
GimpBrush *active = GIMP_BRUSH (object);
GtkAdjustment *spacing_adj;
spacing_adj = GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment;
......@@ -276,8 +279,6 @@ brushes_set_popup_invoker (Gimp *gimp,
gtk_adjustment_set_value (spacing_adj, spacing);
}
else
success = FALSE;
}
else
success = FALSE;
......
......@@ -38,6 +38,7 @@
#include "core/gimplist.h"
static ProcRecord brushes_refresh_proc;
static ProcRecord brushes_get_list_proc;
static ProcRecord brushes_get_brush_proc;
static ProcRecord brushes_set_brush_proc;
static ProcRecord brushes_get_opacity_proc;
......@@ -46,13 +47,13 @@ static ProcRecord brushes_get_spacing_proc;
static ProcRecord brushes_set_spacing_proc;
static ProcRecord brushes_get_paint_mode_proc;
static ProcRecord brushes_set_paint_mode_proc;
static ProcRecord brushes_get_list_proc;
static ProcRecord brushes_get_brush_data_proc;
void
register_brushes_procs (Gimp *gimp)
{
procedural_db_register (gimp, &brushes_refresh_proc);
procedural_db_register (gimp, &brushes_get_list_proc);
procedural_db_register (gimp, &brushes_get_brush_proc);
procedural_db_register (gimp, &brushes_set_brush_proc);
procedural_db_register (gimp, &brushes_get_opacity_proc);
......@@ -61,7 +62,6 @@ register_brushes_procs (Gimp *gimp)
procedural_db_register (gimp, &brushes_set_spacing_proc);
procedural_db_register (gimp, &brushes_get_paint_mode_proc);
procedural_db_register (gimp, &brushes_set_paint_mode_proc);
procedural_db_register (gimp, &brushes_get_list_proc);
procedural_db_register (gimp, &brushes_get_brush_data_proc);
}
......@@ -99,6 +99,68 @@ static ProcRecord brushes_refresh_proc =
{ { brushes_refresh_invoker } }
};
static Argument *
brushes_get_list_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gchar **brushes;
GList *list;
int i = 0;
brushes = g_new (char *, gimp->brush_factory->container->num_children);
for (list = GIMP_LIST (gimp->brush_factory->container)->list;
list;
list = g_list_next (list))
{
brushes[i++] = g_strdup (GIMP_OBJECT (list->data)->name);
}
success = (i > 0);
return_args = procedural_db_return_args (&brushes_get_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = gimp->brush_factory->container->num_children;
return_args[2].value.pdb_pointer = brushes;
}
return return_args;
}
static ProcArg brushes_get_list_outargs[] =
{
{
GIMP_PDB_INT32,
"num_brushes",
"The number of brushes in the brush list"
},
{
GIMP_PDB_STRINGARRAY,
"brush_list",
"The list of brush names"
}
};
static ProcRecord brushes_get_list_proc =
{
"gimp_brushes_get_list",
"Retrieve a complete listing of the available brushes.",
"This procedure returns a complete listing of available GIMP brushes. Each name returned can be used as input to the 'gimp_brushes_set_brush'.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
0,
NULL,
2,
brushes_get_list_outargs,
{ { brushes_get_list_invoker } }
};
static Argument *
brushes_get_brush_invoker (Gimp *gimp,
Argument *args)
......@@ -450,68 +512,6 @@ static ProcRecord brushes_set_paint_mode_proc =
{ { brushes_set_paint_mode_invoker } }
};
static Argument *
brushes_get_list_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
gchar **brushes;
GList *list;
int i = 0;
brushes = g_new (char *, gimp->brush_factory->container->num_children);
for (list = GIMP_LIST (gimp->brush_factory->container)->list;
list;
list = g_list_next (list))
{
brushes[i++] = g_strdup (GIMP_OBJECT (list->data)->name);
}
success = (i > 0);
return_args = procedural_db_return_args (&brushes_get_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = gimp->brush_factory->container->num_children;
return_args[2].value.pdb_pointer = brushes;
}
return return_args;
}
static ProcArg brushes_get_list_outargs[] =
{
{
GIMP_PDB_INT32,
"num_brushes",
"The number of brushes in the brush list"
},
{
GIMP_PDB_STRINGARRAY,
"brush_list",
"The list of brush names"
}
};
static ProcRecord brushes_get_list_proc =
{
"gimp_brushes_get_list",
"Retrieve a complete listing of the available brushes.",
"This procedure returns a complete listing of available GIMP brushes. Each name returned can be used as input to the 'gimp_brushes_set_brush'.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
0,
NULL,
2,
brushes_get_list_outargs,
{ { brushes_get_list_invoker } }
};
static Argument *
brushes_get_brush_data_invoker (Gimp *gimp,
Argument *args)
......
......@@ -58,8 +58,7 @@ gradients_popup_invoker (Gimp *gimp,
gchar *popup_title;
gchar *initial_gradient;
gint32 sample_size;
ProcRecord *prec;
GradientSelect *newdialog;
ProcRecord *proc;
gradient_callback = (gchar *) args[0].value.pdb_pointer;
if (gradient_callback == NULL)
......@@ -77,18 +76,19 @@ gradients_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, gradient_callback)))
if (! gimp->no_interface &&
(proc = procedural_db_lookup (gimp, gradient_callback)))
{
if (initial_gradient && strlen (initial_gradient))
newdialog = gradient_select_new (gimp, NULL, popup_title,
initial_gradient,
gradient_callback,
sample_size);
gradient_select_new (gimp, NULL, popup_title,
initial_gradient,
gradient_callback,
sample_size);
else
newdialog = gradient_select_new (gimp, NULL, popup_title,
NULL,
gradient_callback,
sample_size);
gradient_select_new (gimp, NULL, popup_title,
NULL,
gradient_callback,
sample_size);
}
else
{
......@@ -154,7 +154,8 @@ gradients_close_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, gradient_callback)) &&
if (! gimp->no_interface &&
(prec = procedural_db_lookup (gimp, gradient_callback)) &&
(gsp = gradient_select_get_by_callback (gradient_callback)))
{
gradient_select_free (gsp);
......@@ -213,7 +214,8 @@ gradients_set_popup_invoker (Gimp *gimp,
if (success)
{
if ((prec = procedural_db_lookup (gimp, gradient_callback)) &&
if (! gimp->no_interface &&
(prec = procedural_db_lookup (gimp, gradient_callback)) &&
(gsp = gradient_select_get_by_callback (gradient_callback)))
{
GimpGradient *active = NULL;
......
......@@ -38,8 +38,8 @@
static ProcRecord gradients_refresh_proc;
static ProcRecord gradients_get_list_proc;
static ProcRecord gradients_get_active_proc;
static ProcRecord gradients_set_active_proc;
static ProcRecord gradients_get_gradient_proc;
static ProcRecord gradients_set_gradient_proc;
static ProcRecord gradients_sample_uniform_proc;
static ProcRecord gradients_sample_custom_proc;
static ProcRecord gradients_get_gradient_data_proc;
......@@ -49,8 +49,8 @@ register_gradients_procs (Gimp *gimp)
{
procedural_db_register (gimp, &gradients_refresh_proc);
procedural_db_register (gimp, &gradients_get_list_proc);
procedural_db_register (gimp, &gradients_get_active_proc);
procedural_db_register (gimp, &gradients_set_active_proc);
procedural_db_register (gimp, &gradients_get_gradient_proc);
procedural_db_register (gimp, &gradients_set_gradient_proc);
procedural_db_register (gimp, &gradients_sample_uniform_proc);
procedural_db_register (gimp, &gradients_sample_custom_proc);
procedural_db_register (gimp, &gradients_get_gradient_data_proc);
......@@ -144,15 +144,15 @@ static ProcRecord gradients_get_list_proc =
};
static Argument *
gradients_get_active_invoker (Gimp *gimp,
Argument *args)
gradients_get_gradient_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
success = gimp_context_get_gradient (gimp_get_current_context (gimp)) != NULL;
return_args = procedural_db_return_args (&gradients_get_active_proc, success);
return_args = procedural_db_return_args (&gradients_get_gradient_proc, success);
if (success)
return_args[1].value.pdb_pointer = g_strdup (GIMP_OBJECT (gimp_context_get_gradient (gimp_get_current_context (gimp)))->name);
......@@ -160,7 +160,7 @@ gradients_get_active_invoker (Gimp *gimp,
return return_args;
}
static ProcArg gradients_get_active_outargs[] =
static ProcArg gradients_get_gradient_outargs[] =
{
{
GIMP_PDB_STRING,
......@@ -169,9 +169,9 @@ static ProcArg gradients_get_active_outargs[] =
}
};
static ProcRecord gradients_get_active_proc =
static ProcRecord gradients_get_gradient_proc =
{
"gimp_gradients_get_active",
"gimp_gradients_get_gradient",
"Retrieve the name of the active gradient.",
"This procedure returns the name of the active gradient in the gradient editor.",
"Federico Mena Quintero",
......@@ -181,13 +181,13 @@ static ProcRecord gradients_get_active_proc =
0,
NULL,
1,
gradients_get_active_outargs,
{ { gradients_get_active_invoker } }
gradients_get_gradient_outargs,
{ { gradients_get_gradient_invoker } }
};
static Argument *
gradients_set_active_invoker (Gimp *gimp,
Argument *args)
gradients_set_gradient_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
gchar *name;
......@@ -212,10 +212,10 @@ gradients_set_active_invoker (Gimp *gimp,
}
}
return procedural_db_return_args (&gradients_set_active_proc, success);
return procedural_db_return_args (&gradients_set_gradient_proc, success);
}
static ProcArg gradients_set_active_inargs[] =
static ProcArg gradients_set_gradient_inargs[] =
{
{
GIMP_PDB_STRING,
......@@ -224,9 +224,9 @@ static ProcArg gradients_set_active_inargs[] =
}
};
static ProcRecord gradients_set_active_proc =
static ProcRecord gradients_set_gradient_proc =
{
"gimp_gradients_set_active",
"gimp_gradients_set_gradient",
"Sets the specified gradient as the active gradient.",
"This procedure lets you set the specified gradient as the active or \"current\" one. The name is simply a string which corresponds to one of the loaded gradients in the gradient editor. If no matching gradient is found, this procedure will return an error. Otherwise, the specified gradient will become active and will be used for subsequent custom gradient operations.",
"Federico Mena Quintero",
......@@ -234,10 +234,10 @@ static ProcRecord gradients_set_active_proc =
"1997",
GIMP_INTERNAL,
1,
gradients_set_active_inargs,
gradients_set_gradient_inargs,
0,
NULL,
{ { gradients_set_active_invoker } }
{ { gradients_set_gradient_invoker } }
};
static Argument *
......
......@@ -56,8 +56,7 @@ palettes_popup_invoker (Gimp *gimp,
gchar *palette_callback;
gchar *popup_title;
</