[gimp] app: flip context and name parameters in GimpDataNewFunc
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: flip context and name parameters in GimpDataNewFunc
- Date: Sat, 10 Apr 2010 17:56:33 +0000 (UTC)
commit 4fcf34699fda2e383bde756f2a8989d7a99806f3
Author: Michael Natterer <mitch gimp org>
Date: Sat Apr 10 19:55:42 2010 +0200
app: flip context and name parameters in GimpDataNewFunc
app/actions/data-commands.c | 2 +-
app/core/gimp-gradients.c | 4 ++--
app/core/gimpbrush.c | 6 +++---
app/core/gimpbrush.h | 4 ++--
app/core/gimpdatafactory.c | 8 ++++----
app/core/gimpdatafactory.h | 8 ++++----
app/core/gimpdynamics.c | 9 ++++++---
app/core/gimpdynamics.h | 4 ++--
app/core/gimpgradient.c | 6 +++---
app/core/gimpgradient.h | 4 ++--
app/core/gimppalette-import.c | 6 +++---
app/core/gimppalette-load.c | 10 +++++-----
app/core/gimppalette.c | 6 +++---
app/core/gimppalette.h | 4 ++--
app/core/gimppattern.c | 7 ++++---
app/core/gimppattern.h | 4 ++--
app/core/gimptoolpreset.c | 11 ++++++-----
app/core/gimptoolpreset.h | 4 ++--
app/pdb/brush-cmds.c | 2 +-
app/pdb/gradient-cmds.c | 2 +-
app/pdb/palette-cmds.c | 2 +-
tools/pdbgen/pdb/brush.pdb | 2 +-
tools/pdbgen/pdb/gradient.pdb | 2 +-
tools/pdbgen/pdb/palette.pdb | 2 +-
24 files changed, 62 insertions(+), 57 deletions(-)
---
diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c
index 34ef598..c0f048e 100644
--- a/app/actions/data-commands.c
+++ b/app/actions/data-commands.c
@@ -130,7 +130,7 @@ data_new_cmd_callback (GtkAction *action,
context =
gimp_container_view_get_context (GIMP_CONTAINER_EDITOR (view)->view);
- data = gimp_data_factory_data_new (factory, _("Untitled"), context);
+ data = gimp_data_factory_data_new (factory, context, _("Untitled"));
if (data)
{
diff --git a/app/core/gimp-gradients.c b/app/core/gimp-gradients.c
index dd6749f..07f3f1a 100644
--- a/app/core/gimp-gradients.c
+++ b/app/core/gimp-gradients.c
@@ -116,8 +116,8 @@ gimp_gradients_add_gradient (Gimp *gimp,
{
GimpGradient *gradient;
- gradient = GIMP_GRADIENT (gimp_gradient_new (name,
- gimp_get_user_context (gimp)));
+ gradient = GIMP_GRADIENT (gimp_gradient_new (gimp_get_user_context (gimp),
+ name));
gimp_data_make_internal (GIMP_DATA (gradient), id);
diff --git a/app/core/gimpbrush.c b/app/core/gimpbrush.c
index aa8cf0e..d5187b5 100644
--- a/app/core/gimpbrush.c
+++ b/app/core/gimpbrush.c
@@ -399,8 +399,8 @@ gimp_brush_get_checksum (GimpTagged *tagged)
/* public functions */
GimpData *
-gimp_brush_new (const gchar *name,
- GimpContext *context)
+gimp_brush_new (GimpContext *context,
+ const gchar *name)
{
g_return_val_if_fail (name != NULL, NULL);
@@ -416,7 +416,7 @@ gimp_brush_get_standard (GimpContext *context)
if (! standard_brush)
{
- standard_brush = gimp_brush_new ("Standard", context);
+ standard_brush = gimp_brush_new (context, "Standard");
gimp_data_clean (standard_brush);
gimp_data_make_internal (standard_brush, "gimp-brush-standard");
diff --git a/app/core/gimpbrush.h b/app/core/gimpbrush.h
index 50d4484..0beeb4e 100644
--- a/app/core/gimpbrush.h
+++ b/app/core/gimpbrush.h
@@ -80,8 +80,8 @@ struct _GimpBrushClass
GType gimp_brush_get_type (void) G_GNUC_CONST;
-GimpData * gimp_brush_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_brush_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_brush_get_standard (GimpContext *context);
GimpBrush * gimp_brush_select_brush (GimpBrush *brush,
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index bcae27f..aecdf2c 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -478,17 +478,17 @@ gimp_data_factory_data_free (GimpDataFactory *factory)
GimpData *
gimp_data_factory_data_new (GimpDataFactory *factory,
- const gchar *name,
- GimpContext *context)
+ GimpContext *context,
+ const gchar *name)
{
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
+ g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (*name != '\0', NULL);
- g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
if (factory->priv->data_new_func)
{
- GimpData *data = factory->priv->data_new_func (name, context);
+ GimpData *data = factory->priv->data_new_func (context, name);
if (data)
{
diff --git a/app/core/gimpdatafactory.h b/app/core/gimpdatafactory.h
index 13b4b1d..62c0505 100644
--- a/app/core/gimpdatafactory.h
+++ b/app/core/gimpdatafactory.h
@@ -25,8 +25,8 @@
#include "gimpobject.h"
-typedef GimpData * (* GimpDataNewFunc) (const gchar *name,
- GimpContext *context);
+typedef GimpData * (* GimpDataNewFunc) (GimpContext *context,
+ const gchar *name);
typedef GList * (* GimpDataLoadFunc) (const gchar *filename,
GError **error);
typedef GimpData * (* GimpDataGetStandardFunc) (GimpContext *context);
@@ -84,8 +84,8 @@ void gimp_data_factory_data_save (GimpDataFactory *factory);
void gimp_data_factory_data_free (GimpDataFactory *factory);
GimpData * gimp_data_factory_data_new (GimpDataFactory *factory,
- const gchar *name,
- GimpContext *context);
+ GimpContext *context,
+ const gchar *name);
GimpData * gimp_data_factory_data_duplicate (GimpDataFactory *factory,
GimpData *data);
gboolean gimp_data_factory_data_delete (GimpDataFactory *factory,
diff --git a/app/core/gimpdynamics.c b/app/core/gimpdynamics.c
index 672e6bf..d4994b3 100644
--- a/app/core/gimpdynamics.c
+++ b/app/core/gimpdynamics.c
@@ -399,9 +399,12 @@ gimp_dynamics_get_extension (GimpData *data)
/* public functions */
GimpData *
-gimp_dynamics_new (const gchar *name,
- GimpContext *context)
+gimp_dynamics_new (GimpContext *context,
+ const gchar *name)
{
+ g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (name[0] != '\0', NULL);
+
return g_object_new (GIMP_TYPE_DYNAMICS,
"name", name,
NULL);
@@ -414,7 +417,7 @@ gimp_dynamics_get_standard (GimpContext *context)
if (! standard_dynamics)
{
- standard_dynamics = gimp_dynamics_new ("Standard dynamics", context);
+ standard_dynamics = gimp_dynamics_new (context, "Standard dynamics");
gimp_data_clean (standard_dynamics);
gimp_data_make_internal (standard_dynamics, "gimp-dynamics-standard");
diff --git a/app/core/gimpdynamics.h b/app/core/gimpdynamics.h
index d1f2545..5c3a470 100644
--- a/app/core/gimpdynamics.h
+++ b/app/core/gimpdynamics.h
@@ -57,8 +57,8 @@ struct _GimpDynamicsClass
GType gimp_dynamics_get_type (void) G_GNUC_CONST;
-GimpData * gimp_dynamics_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_dynamics_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_dynamics_get_standard (GimpContext *context);
GimpDynamicsOutput * gimp_dynamics_get_output (GimpDynamics *dynamics,
diff --git a/app/core/gimpgradient.c b/app/core/gimpgradient.c
index 8e5b74a..7ee4a48 100644
--- a/app/core/gimpgradient.c
+++ b/app/core/gimpgradient.c
@@ -322,8 +322,8 @@ gimp_gradient_get_checksum (GimpTagged *tagged)
/* public functions */
GimpData *
-gimp_gradient_new (const gchar *name,
- GimpContext *context)
+gimp_gradient_new (GimpContext *context,
+ const gchar *name)
{
GimpGradient *gradient;
@@ -346,7 +346,7 @@ gimp_gradient_get_standard (GimpContext *context)
if (! standard_gradient)
{
- standard_gradient = gimp_gradient_new ("Standard", context);
+ standard_gradient = gimp_gradient_new (context, "Standard");
gimp_data_clean (standard_gradient);
gimp_data_make_internal (standard_gradient, "gimp-gradient-standard");
diff --git a/app/core/gimpgradient.h b/app/core/gimpgradient.h
index 2dbff60..55cd2bb 100644
--- a/app/core/gimpgradient.h
+++ b/app/core/gimpgradient.h
@@ -67,8 +67,8 @@ struct _GimpGradientClass
GType gimp_gradient_get_type (void) G_GNUC_CONST;
-GimpData * gimp_gradient_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_gradient_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_gradient_get_standard (GimpContext *context);
GimpGradientSegment * gimp_gradient_get_color_at (GimpGradient *gradient,
diff --git a/app/core/gimppalette-import.c b/app/core/gimppalette-import.c
index 5baf31a..20e79d4 100644
--- a/app/core/gimppalette-import.c
+++ b/app/core/gimppalette-import.c
@@ -65,7 +65,7 @@ gimp_palette_import_from_gradient (GimpGradient *gradient,
g_return_val_if_fail (palette_name != NULL, NULL);
g_return_val_if_fail (n_colors > 1, NULL);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
dx = 1.0 / (n_colors - 1);
@@ -232,7 +232,7 @@ gimp_palette_import_make_palette (GHashTable *table,
GSList *list = NULL;
GSList *iter;
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
if (! table)
return palette;
@@ -426,7 +426,7 @@ gimp_palette_import_from_indexed_image (GimpImage *image,
g_return_val_if_fail (gimp_image_base_type (image) == GIMP_INDEXED, NULL);
g_return_val_if_fail (palette_name != NULL, NULL);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
colormap = gimp_image_get_colormap (image);
n_colors = gimp_image_get_colormap_size (image);
diff --git a/app/core/gimppalette-load.c b/app/core/gimppalette-load.c
index 233f612..5ca57d2 100644
--- a/app/core/gimppalette-load.c
+++ b/app/core/gimppalette-load.c
@@ -275,7 +275,7 @@ gimp_palette_load_act (GimpContext *context,
}
palette_name = g_filename_display_basename (filename);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
g_free (palette_name);
while (read (fd, color_bytes, 3) == 3)
@@ -321,7 +321,7 @@ gimp_palette_load_riff (GimpContext *context,
}
palette_name = g_filename_display_basename (filename);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
g_free (palette_name);
lseek (fd, 28, SEEK_SET);
@@ -378,7 +378,7 @@ gimp_palette_load_psp (GimpContext *context,
}
palette_name = g_filename_display_basename (filename);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
g_free (palette_name);
lseek (fd, 16, SEEK_SET);
@@ -480,7 +480,7 @@ gimp_palette_load_aco (GimpContext *context,
}
palette_name = g_filename_display_basename (filename);
- palette = GIMP_PALETTE (gimp_palette_new (palette_name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, palette_name));
g_free (palette_name);
format_version = header[1] + (header[0] << 8);
@@ -635,7 +635,7 @@ gimp_palette_load_css (GimpContext *context,
}
name = g_filename_display_basename (filename);
- palette = GIMP_PALETTE (gimp_palette_new (name, context));
+ palette = GIMP_PALETTE (gimp_palette_new (context, name));
g_free (name);
do
diff --git a/app/core/gimppalette.c b/app/core/gimppalette.c
index 9f1bce3..075b8ac 100644
--- a/app/core/gimppalette.c
+++ b/app/core/gimppalette.c
@@ -272,8 +272,8 @@ gimp_palette_get_description (GimpViewable *viewable,
}
GimpData *
-gimp_palette_new (const gchar *name,
- GimpContext *context)
+gimp_palette_new (GimpContext *context,
+ const gchar *name)
{
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (*name != '\0', NULL);
@@ -290,7 +290,7 @@ gimp_palette_get_standard (GimpContext *context)
if (! standard_palette)
{
- standard_palette = gimp_palette_new ("Standard", context);
+ standard_palette = gimp_palette_new (context, "Standard");
gimp_data_clean (standard_palette);
gimp_data_make_internal (standard_palette, "gimp-palette-standard");
diff --git a/app/core/gimppalette.h b/app/core/gimppalette.h
index c65e5b2..cb7a748 100644
--- a/app/core/gimppalette.h
+++ b/app/core/gimppalette.h
@@ -60,8 +60,8 @@ struct _GimpPaletteClass
GType gimp_palette_get_type (void) G_GNUC_CONST;
-GimpData * gimp_palette_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_palette_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_palette_get_standard (GimpContext *context);
GimpPaletteEntry * gimp_palette_add_entry (GimpPalette *palette,
diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c
index c57d337..3cab497 100644
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -209,14 +209,15 @@ gimp_pattern_get_checksum (GimpTagged *tagged)
}
GimpData *
-gimp_pattern_new (const gchar *name,
- GimpContext *context)
+gimp_pattern_new (GimpContext *context,
+ const gchar *name)
{
GimpPattern *pattern;
guchar *data;
gint row, col;
g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (name[0] != '\n', NULL);
pattern = g_object_new (GIMP_TYPE_PATTERN,
"name", name,
@@ -243,7 +244,7 @@ gimp_pattern_get_standard (GimpContext *context)
if (! standard_pattern)
{
- standard_pattern = gimp_pattern_new ("Standard", context);
+ standard_pattern = gimp_pattern_new (context, "Standard");
gimp_data_clean (standard_pattern);
gimp_data_make_internal (standard_pattern, "gimp-pattern-standard");
diff --git a/app/core/gimppattern.h b/app/core/gimppattern.h
index dc1158b..e4db634 100644
--- a/app/core/gimppattern.h
+++ b/app/core/gimppattern.h
@@ -47,8 +47,8 @@ struct _GimpPatternClass
GType gimp_pattern_get_type (void) G_GNUC_CONST;
-GimpData * gimp_pattern_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_pattern_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_pattern_get_standard (GimpContext *context);
TempBuf * gimp_pattern_get_mask (const GimpPattern *pattern);
diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c
index 1b99177..3a05dbd 100644
--- a/app/core/gimptoolpreset.c
+++ b/app/core/gimptoolpreset.c
@@ -191,14 +191,15 @@ gimp_tool_preset_get_extension (GimpData *data)
/* public functions */
GimpData *
-gimp_tool_preset_new (const gchar *name,
- GimpContext *context)
+gimp_tool_preset_new (GimpContext *context,
+ const gchar *name)
{
GimpToolInfo *tool_info;
const gchar *stock_id;
- g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (name[0] != '\0', NULL);
tool_info = gimp_context_get_tool (context);
@@ -220,8 +221,8 @@ gimp_tool_preset_get_standard (GimpContext *context)
if (! standard_tool_preset)
{
- standard_tool_preset = gimp_tool_preset_new ("Standard tool preset",
- context);
+ standard_tool_preset = gimp_tool_preset_new (context,
+ "Standard tool preset");
gimp_data_clean (standard_tool_preset);
gimp_data_make_internal (standard_tool_preset, "gimp-tool-preset-standard");
diff --git a/app/core/gimptoolpreset.h b/app/core/gimptoolpreset.h
index 2e3a387..905b201 100644
--- a/app/core/gimptoolpreset.h
+++ b/app/core/gimptoolpreset.h
@@ -47,8 +47,8 @@ struct _GimpToolPresetClass
GType gimp_tool_preset_get_type (void) G_GNUC_CONST;
-GimpData * gimp_tool_preset_new (const gchar *name,
- GimpContext *context);
+GimpData * gimp_tool_preset_new (GimpContext *context,
+ const gchar *name);
GimpData * gimp_tool_preset_get_standard (GimpContext *context);
diff --git a/app/pdb/brush-cmds.c b/app/pdb/brush-cmds.c
index be8e562..6a28a61 100644
--- a/app/pdb/brush-cmds.c
+++ b/app/pdb/brush-cmds.c
@@ -57,7 +57,7 @@ brush_new_invoker (GimpProcedure *procedure,
if (success)
{
GimpData *data = gimp_data_factory_data_new (gimp->brush_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
diff --git a/app/pdb/gradient-cmds.c b/app/pdb/gradient-cmds.c
index a66be6d..180046d 100644
--- a/app/pdb/gradient-cmds.c
+++ b/app/pdb/gradient-cmds.c
@@ -106,7 +106,7 @@ gradient_new_invoker (GimpProcedure *procedure,
if (success)
{
GimpData *data = gimp_data_factory_data_new (gimp->gradient_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
diff --git a/app/pdb/palette-cmds.c b/app/pdb/palette-cmds.c
index a538088..e3168ef 100644
--- a/app/pdb/palette-cmds.c
+++ b/app/pdb/palette-cmds.c
@@ -57,7 +57,7 @@ palette_new_invoker (GimpProcedure *procedure,
if (success)
{
GimpData *data = gimp_data_factory_data_new (gimp->palette_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
diff --git a/tools/pdbgen/pdb/brush.pdb b/tools/pdbgen/pdb/brush.pdb
index 5ebfc66..2abf765 100644
--- a/tools/pdbgen/pdb/brush.pdb
+++ b/tools/pdbgen/pdb/brush.pdb
@@ -36,7 +36,7 @@ sub brush_new {
code => <<'CODE'
{
GimpData *data = gimp_data_factory_data_new (gimp->brush_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
diff --git a/tools/pdbgen/pdb/gradient.pdb b/tools/pdbgen/pdb/gradient.pdb
index 8e7befe..17d36cd 100644
--- a/tools/pdbgen/pdb/gradient.pdb
+++ b/tools/pdbgen/pdb/gradient.pdb
@@ -34,7 +34,7 @@ sub gradient_new {
code => <<'CODE'
{
GimpData *data = gimp_data_factory_data_new (gimp->gradient_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
diff --git a/tools/pdbgen/pdb/palette.pdb b/tools/pdbgen/pdb/palette.pdb
index a3891f5..15f27a7 100644
--- a/tools/pdbgen/pdb/palette.pdb
+++ b/tools/pdbgen/pdb/palette.pdb
@@ -36,7 +36,7 @@ sub palette_new {
code => <<'CODE'
{
GimpData *data = gimp_data_factory_data_new (gimp->palette_factory,
- name, context);
+ context, name);
if (data)
actual_name = g_strdup (gimp_object_get_name (data));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]