app: flip context and name parameters in GimpDataNewFunc

This commit is contained in:
Michael Natterer 2010-04-10 19:55:42 +02:00
parent 78a4cae2d5
commit 4fcf34699f
24 changed files with 62 additions and 57 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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");

View File

@ -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,

View File

@ -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)
{

View File

@ -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,

View File

@ -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");

View File

@ -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,

View File

@ -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");

View File

@ -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,

View File

@ -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);

View File

@ -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

View File

@ -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");

View File

@ -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,

View File

@ -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");

View File

@ -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);

View File

@ -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");

View File

@ -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);

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));