gimp r24830 - trunk/libgimp
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24830 - trunk/libgimp
- Date: Thu, 7 Feb 2008 22:04:28 +0000 (GMT)
Author: mitch
Date: Thu Feb 7 22:04:27 2008
New Revision: 24830
URL: http://svn.gnome.org/viewvc/gimp?rev=24830&view=rev
Log:
2008-02-07 Michael Natterer <mitch gimp org>
* tools/pdbgen/app.pl: add some perl evilness to make the includes
in the generated files look almost like they should.
* tools/pdbgen/pdb/*.pdb: remove inclusion of "core/gimp.h" where
not needed, clean up lists of includes and functions and reorder
some functions to make more sense. Zero logic changed.
* app/pdb/*_cmds.c
* libgimp/gimpcontext_pdb.[ch]
* libgimp/gimpbrush_pdb.[ch]: regenerated.
Modified:
trunk/libgimp/gimpbrush_pdb.c
trunk/libgimp/gimpbrush_pdb.h
trunk/libgimp/gimpcontext_pdb.c
trunk/libgimp/gimpcontext_pdb.h
Modified: trunk/libgimp/gimpbrush_pdb.c
==============================================================================
--- trunk/libgimp/gimpbrush_pdb.c (original)
+++ trunk/libgimp/gimpbrush_pdb.c Thu Feb 7 22:04:27 2008
@@ -462,353 +462,353 @@
}
/**
- * gimp_brush_get_radius:
+ * gimp_brush_set_shape:
* @name: The brush name.
+ * @shape_in: The brush shape.
*
- * Get the radius of a generated brush.
+ * Set the shape of a generated brush.
*
- * This procedure gets the radius value for a generated brush. If
- * called for any other type of brush, it does not succeed.
+ * This procedure sets the shape value for a generated brush. If called
+ * for any other type of brush, it does not succeed. The current
+ * possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square
+ * (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
+ * (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added
+ * in the future.
*
- * Returns: The radius of the brush in pixels.
+ * Returns: The brush shape actually assigned.
*
* Since: GIMP 2.4
*/
-gdouble
-gimp_brush_get_radius (const gchar *name)
+GimpBrushGeneratedShape
+gimp_brush_set_shape (const gchar *name,
+ GimpBrushGeneratedShape shape_in)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble radius = 0.0;
+ GimpBrushGeneratedShape shape_out = 0;
- return_vals = gimp_run_procedure ("gimp-brush-get-radius",
+ return_vals = gimp_run_procedure ("gimp-brush-set-shape",
&nreturn_vals,
GIMP_PDB_STRING, name,
+ GIMP_PDB_INT32, shape_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- radius = return_vals[1].data.d_float;
+ shape_out = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
- return radius;
+ return shape_out;
}
/**
- * gimp_brush_get_spikes:
+ * gimp_brush_get_radius:
* @name: The brush name.
*
- * Get the number of spikes for a generated brush.
+ * Get the radius of a generated brush.
*
- * This procedure gets the number of spikes for a generated brush. If
+ * This procedure gets the radius value for a generated brush. If
* called for any other type of brush, it does not succeed.
*
- * Returns: The number of spikes on the brush.
+ * Returns: The radius of the brush in pixels.
*
* Since: GIMP 2.4
*/
-gint
-gimp_brush_get_spikes (const gchar *name)
+gdouble
+gimp_brush_get_radius (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
- gint spikes = 0;
+ gdouble radius = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-get-spikes",
+ return_vals = gimp_run_procedure ("gimp-brush-get-radius",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- spikes = return_vals[1].data.d_int32;
+ radius = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return spikes;
+ return radius;
}
/**
- * gimp_brush_get_hardness:
+ * gimp_brush_set_radius:
* @name: The brush name.
+ * @radius_in: The desired brush radius.
*
- * Get the hardness of a generated brush.
+ * Set the radius of a generated brush.
*
- * This procedure gets the hardness of a generated brush. The hardness
- * of a brush is the amount its intensity fades at the outside edge. If
- * called for any other type of brush, the function does not succeed.
+ * This procedure sets the radius for a generated brush. If called for
+ * any other type of brush, it does not succeed.
*
- * Returns: The hardness of the brush.
+ * Returns: The brush radius actually assigned.
*
* Since: GIMP 2.4
*/
gdouble
-gimp_brush_get_hardness (const gchar *name)
+gimp_brush_set_radius (const gchar *name,
+ gdouble radius_in)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble hardness = 0.0;
+ gdouble radius_out = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-get-hardness",
+ return_vals = gimp_run_procedure ("gimp-brush-set-radius",
&nreturn_vals,
GIMP_PDB_STRING, name,
+ GIMP_PDB_FLOAT, radius_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- hardness = return_vals[1].data.d_float;
+ radius_out = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return hardness;
+ return radius_out;
}
/**
- * gimp_brush_get_aspect_ratio:
+ * gimp_brush_get_spikes:
* @name: The brush name.
*
- * Get the aspect ratio of a generated brush.
+ * Get the number of spikes for a generated brush.
*
- * This procedure gets the aspect ratio of a generated brush. If called
- * for any other type of brush, it does not succeed.
+ * This procedure gets the number of spikes for a generated brush. If
+ * called for any other type of brush, it does not succeed.
*
- * Returns: The aspect ratio of the brush.
+ * Returns: The number of spikes on the brush.
*
* Since: GIMP 2.4
*/
-gdouble
-gimp_brush_get_aspect_ratio (const gchar *name)
+gint
+gimp_brush_get_spikes (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble aspect_ratio = 0.0;
+ gint spikes = 0;
- return_vals = gimp_run_procedure ("gimp-brush-get-aspect-ratio",
+ return_vals = gimp_run_procedure ("gimp-brush-get-spikes",
&nreturn_vals,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- aspect_ratio = return_vals[1].data.d_float;
+ spikes = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
- return aspect_ratio;
+ return spikes;
}
/**
- * gimp_brush_get_angle:
+ * gimp_brush_set_spikes:
* @name: The brush name.
+ * @spikes_in: The desired number of spikes.
*
- * Get the rotation angle of a generated brush.
+ * Set the number of spikes for a generated brush.
*
- * This procedure gets the angle of rotation for a generated brush. If
+ * This procedure sets the number of spikes for a generated brush. If
* called for any other type of brush, it does not succeed.
*
- * Returns: The rotation angle of the brush.
+ * Returns: The number of spikes actually assigned.
*
* Since: GIMP 2.4
*/
-gdouble
-gimp_brush_get_angle (const gchar *name)
+gint
+gimp_brush_set_spikes (const gchar *name,
+ gint spikes_in)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble angle = 0.0;
+ gint spikes_out = 0;
- return_vals = gimp_run_procedure ("gimp-brush-get-angle",
+ return_vals = gimp_run_procedure ("gimp-brush-set-spikes",
&nreturn_vals,
GIMP_PDB_STRING, name,
+ GIMP_PDB_INT32, spikes_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- angle = return_vals[1].data.d_float;
+ spikes_out = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
- return angle;
+ return spikes_out;
}
/**
- * gimp_brush_set_shape:
+ * gimp_brush_get_hardness:
* @name: The brush name.
- * @shape_in: The brush shape.
*
- * Set the shape of a generated brush.
+ * Get the hardness of a generated brush.
*
- * This procedure sets the shape value for a generated brush. If called
- * for any other type of brush, it does not succeed. The current
- * possibilities are Circle (GIMP_BRUSH_GENERATED_CIRCLE), Square
- * (GIMP_BRUSH_GENERATED_SQUARE), and Diamond
- * (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes are likely to be added
- * in the future.
+ * This procedure gets the hardness of a generated brush. The hardness
+ * of a brush is the amount its intensity fades at the outside edge. If
+ * called for any other type of brush, the function does not succeed.
*
- * Returns: The brush shape actually assigned.
+ * Returns: The hardness of the brush.
*
* Since: GIMP 2.4
*/
-GimpBrushGeneratedShape
-gimp_brush_set_shape (const gchar *name,
- GimpBrushGeneratedShape shape_in)
+gdouble
+gimp_brush_get_hardness (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
- GimpBrushGeneratedShape shape_out = 0;
+ gdouble hardness = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-set-shape",
+ return_vals = gimp_run_procedure ("gimp-brush-get-hardness",
&nreturn_vals,
GIMP_PDB_STRING, name,
- GIMP_PDB_INT32, shape_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- shape_out = return_vals[1].data.d_int32;
+ hardness = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return shape_out;
+ return hardness;
}
/**
- * gimp_brush_set_radius:
+ * gimp_brush_set_hardness:
* @name: The brush name.
- * @radius_in: The desired brush radius.
+ * @hardness_in: The desired brush hardness.
*
- * Set the radius of a generated brush.
+ * Set the hardness of a generated brush.
*
- * This procedure sets the radius for a generated brush. If called for
- * any other type of brush, it does not succeed.
+ * This procedure sets the hardness for a generated brush. If called
+ * for any other type of brush, it does not succeed.
*
- * Returns: The brush radius actually assigned.
+ * Returns: The brush hardness actually assigned.
*
* Since: GIMP 2.4
*/
gdouble
-gimp_brush_set_radius (const gchar *name,
- gdouble radius_in)
+gimp_brush_set_hardness (const gchar *name,
+ gdouble hardness_in)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble radius_out = 0.0;
+ gdouble hardness_out = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-set-radius",
+ return_vals = gimp_run_procedure ("gimp-brush-set-hardness",
&nreturn_vals,
GIMP_PDB_STRING, name,
- GIMP_PDB_FLOAT, radius_in,
+ GIMP_PDB_FLOAT, hardness_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- radius_out = return_vals[1].data.d_float;
+ hardness_out = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return radius_out;
+ return hardness_out;
}
/**
- * gimp_brush_set_spikes:
+ * gimp_brush_get_aspect_ratio:
* @name: The brush name.
- * @spikes_in: The desired number of spikes.
*
- * Set the number of spikes for a generated brush.
+ * Get the aspect ratio of a generated brush.
*
- * This procedure sets the number of spikes for a generated brush. If
- * called for any other type of brush, it does not succeed.
+ * This procedure gets the aspect ratio of a generated brush. If called
+ * for any other type of brush, it does not succeed.
*
- * Returns: The number of spikes actually assigned.
+ * Returns: The aspect ratio of the brush.
*
* Since: GIMP 2.4
*/
-gint
-gimp_brush_set_spikes (const gchar *name,
- gint spikes_in)
+gdouble
+gimp_brush_get_aspect_ratio (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
- gint spikes_out = 0;
+ gdouble aspect_ratio = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-set-spikes",
+ return_vals = gimp_run_procedure ("gimp-brush-get-aspect-ratio",
&nreturn_vals,
GIMP_PDB_STRING, name,
- GIMP_PDB_INT32, spikes_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- spikes_out = return_vals[1].data.d_int32;
+ aspect_ratio = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return spikes_out;
+ return aspect_ratio;
}
/**
- * gimp_brush_set_hardness:
+ * gimp_brush_set_aspect_ratio:
* @name: The brush name.
- * @hardness_in: The desired brush hardness.
+ * @aspect_ratio_in: The desired brush aspect ratio.
*
- * Set the hardness of a generated brush.
+ * Set the aspect ratio of a generated brush.
*
- * This procedure sets the hardness for a generated brush. If called
- * for any other type of brush, it does not succeed.
+ * This procedure sets the aspect ratio for a generated brush. If
+ * called for any other type of brush, it does not succeed.
*
- * Returns: The brush hardness actually assigned.
+ * Returns: The brush aspect ratio actually assigned.
*
* Since: GIMP 2.4
*/
gdouble
-gimp_brush_set_hardness (const gchar *name,
- gdouble hardness_in)
+gimp_brush_set_aspect_ratio (const gchar *name,
+ gdouble aspect_ratio_in)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble hardness_out = 0.0;
+ gdouble aspect_ratio_out = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-set-hardness",
+ return_vals = gimp_run_procedure ("gimp-brush-set-aspect-ratio",
&nreturn_vals,
GIMP_PDB_STRING, name,
- GIMP_PDB_FLOAT, hardness_in,
+ GIMP_PDB_FLOAT, aspect_ratio_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- hardness_out = return_vals[1].data.d_float;
+ aspect_ratio_out = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return hardness_out;
+ return aspect_ratio_out;
}
/**
- * gimp_brush_set_aspect_ratio:
+ * gimp_brush_get_angle:
* @name: The brush name.
- * @aspect_ratio_in: The desired brush aspect ratio.
*
- * Set the aspect ratio of a generated brush.
+ * Get the rotation angle of a generated brush.
*
- * This procedure sets the aspect ratio for a generated brush. If
+ * This procedure gets the angle of rotation for a generated brush. If
* called for any other type of brush, it does not succeed.
*
- * Returns: The brush aspect ratio actually assigned.
+ * Returns: The rotation angle of the brush.
*
* Since: GIMP 2.4
*/
gdouble
-gimp_brush_set_aspect_ratio (const gchar *name,
- gdouble aspect_ratio_in)
+gimp_brush_get_angle (const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
- gdouble aspect_ratio_out = 0.0;
+ gdouble angle = 0.0;
- return_vals = gimp_run_procedure ("gimp-brush-set-aspect-ratio",
+ return_vals = gimp_run_procedure ("gimp-brush-get-angle",
&nreturn_vals,
GIMP_PDB_STRING, name,
- GIMP_PDB_FLOAT, aspect_ratio_in,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
- aspect_ratio_out = return_vals[1].data.d_float;
+ angle = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
- return aspect_ratio_out;
+ return angle;
}
/**
Modified: trunk/libgimp/gimpbrush_pdb.h
==============================================================================
--- trunk/libgimp/gimpbrush_pdb.h (original)
+++ trunk/libgimp/gimpbrush_pdb.h Thu Feb 7 22:04:27 2008
@@ -55,21 +55,21 @@
gboolean gimp_brush_set_spacing (const gchar *name,
gint spacing);
GimpBrushGeneratedShape gimp_brush_get_shape (const gchar *name);
-gdouble gimp_brush_get_radius (const gchar *name);
-gint gimp_brush_get_spikes (const gchar *name);
-gdouble gimp_brush_get_hardness (const gchar *name);
-gdouble gimp_brush_get_aspect_ratio (const gchar *name);
-gdouble gimp_brush_get_angle (const gchar *name);
GimpBrushGeneratedShape gimp_brush_set_shape (const gchar *name,
GimpBrushGeneratedShape shape_in);
+gdouble gimp_brush_get_radius (const gchar *name);
gdouble gimp_brush_set_radius (const gchar *name,
gdouble radius_in);
+gint gimp_brush_get_spikes (const gchar *name);
gint gimp_brush_set_spikes (const gchar *name,
gint spikes_in);
+gdouble gimp_brush_get_hardness (const gchar *name);
gdouble gimp_brush_set_hardness (const gchar *name,
gdouble hardness_in);
+gdouble gimp_brush_get_aspect_ratio (const gchar *name);
gdouble gimp_brush_set_aspect_ratio (const gchar *name,
gdouble aspect_ratio_in);
+gdouble gimp_brush_get_angle (const gchar *name);
gdouble gimp_brush_set_angle (const gchar *name,
gdouble angle_in);
Modified: trunk/libgimp/gimpcontext_pdb.c
==============================================================================
--- trunk/libgimp/gimpcontext_pdb.c (original)
+++ trunk/libgimp/gimpcontext_pdb.c Thu Feb 7 22:04:27 2008
@@ -89,6 +89,51 @@
}
/**
+ * gimp_context_list_paint_methods:
+ * @num_paint_methods: The number of the available paint methods.
+ * @paint_methods: The names of the available paint methods.
+ *
+ * Lists the available paint methods.
+ *
+ * This procedure lists the names of the available paint methods. Any
+ * of the results can be used for gimp_context_set_paint_method().
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.4
+ */
+gboolean
+gimp_context_list_paint_methods (gint *num_paint_methods,
+ gchar ***paint_methods)
+{
+ GimpParam *return_vals;
+ gint nreturn_vals;
+ gboolean success = TRUE;
+ gint i;
+
+ return_vals = gimp_run_procedure ("gimp-context-list-paint-methods",
+ &nreturn_vals,
+ GIMP_PDB_END);
+
+ *num_paint_methods = 0;
+ *paint_methods = NULL;
+
+ success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+ if (success)
+ {
+ *num_paint_methods = return_vals[1].data.d_int32;
+ *paint_methods = g_new (gchar *, *num_paint_methods);
+ for (i = 0; i < *num_paint_methods; i++)
+ (*paint_methods)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
+ }
+
+ gimp_destroy_params (return_vals, nreturn_vals);
+
+ return success;
+}
+
+/**
* gimp_context_get_paint_method:
*
* Retrieve the currently active paint method.
@@ -156,51 +201,6 @@
}
/**
- * gimp_context_list_paint_methods:
- * @num_paint_methods: The number of the available paint methods.
- * @paint_methods: The names of the available paint methods.
- *
- * Lists the available paint methods.
- *
- * This procedure lists the names of the available paint methods. Any
- * of the results can be used for gimp_context_set_paint_method().
- *
- * Returns: TRUE on success.
- *
- * Since: GIMP 2.4
- */
-gboolean
-gimp_context_list_paint_methods (gint *num_paint_methods,
- gchar ***paint_methods)
-{
- GimpParam *return_vals;
- gint nreturn_vals;
- gboolean success = TRUE;
- gint i;
-
- return_vals = gimp_run_procedure ("gimp-context-list-paint-methods",
- &nreturn_vals,
- GIMP_PDB_END);
-
- *num_paint_methods = 0;
- *paint_methods = NULL;
-
- success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
-
- if (success)
- {
- *num_paint_methods = return_vals[1].data.d_int32;
- *paint_methods = g_new (gchar *, *num_paint_methods);
- for (i = 0; i < *num_paint_methods; i++)
- (*paint_methods)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
- }
-
- gimp_destroy_params (return_vals, nreturn_vals);
-
- return success;
-}
-
-/**
* gimp_context_get_foreground:
* @foreground: The foreground color.
*
Modified: trunk/libgimp/gimpcontext_pdb.h
==============================================================================
--- trunk/libgimp/gimpcontext_pdb.h (original)
+++ trunk/libgimp/gimpcontext_pdb.h Thu Feb 7 22:04:27 2008
@@ -31,10 +31,10 @@
gboolean gimp_context_push (void);
gboolean gimp_context_pop (void);
-gchar* gimp_context_get_paint_method (void);
-gboolean gimp_context_set_paint_method (const gchar *name);
gboolean gimp_context_list_paint_methods (gint *num_paint_methods,
gchar ***paint_methods);
+gchar* gimp_context_get_paint_method (void);
+gboolean gimp_context_set_paint_method (const gchar *name);
gboolean gimp_context_get_foreground (GimpRGB *foreground);
gboolean gimp_context_set_foreground (const GimpRGB *foreground);
gboolean gimp_context_get_background (GimpRGB *background);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]