changed "icon_data" from gchar* to guint8*.
2006-03-31 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-proc-def.h (struct PlugInProcDef) (plug_in_proc_def_set_icon): changed "icon_data" from gchar* to guint8*. * app/plug-in/plug-in-proc-def.c * app/plug-in/plug-in-rc.c * app/xcf/xcf.c: cast a bit to the fix resulting warnings. There are less casts needed than before.
This commit is contained in:

committed by
Michael Natterer

parent
8cffac44d5
commit
c1475c4adb
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2006-03-31 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/plug-in/plug-in-proc-def.h (struct PlugInProcDef)
|
||||||
|
(plug_in_proc_def_set_icon): changed "icon_data" from gchar* to
|
||||||
|
guint8*.
|
||||||
|
|
||||||
|
* app/plug-in/plug-in-proc-def.c
|
||||||
|
* app/plug-in/plug-in-rc.c
|
||||||
|
* app/xcf/xcf.c: cast a bit to the fix resulting warnings. There
|
||||||
|
are less casts needed than before.
|
||||||
|
|
||||||
2006-03-31 Michael Natterer <mitch@gimp.org>
|
2006-03-31 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/pdb/gimpprocedure.[ch] (struct ProcRecord): added new member
|
* app/pdb/gimpprocedure.[ch] (struct ProcRecord): added new member
|
||||||
|
@ -56,8 +56,6 @@ plug_in_proc_def_new (void)
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
||||||
{
|
{
|
||||||
gint i;
|
|
||||||
|
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
|
|
||||||
gimp_procedure_free (proc_def->procedure);
|
gimp_procedure_free (proc_def->procedure);
|
||||||
@ -166,7 +164,7 @@ plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType icon_type,
|
GimpIconType icon_type,
|
||||||
const gchar *icon_data,
|
const guint8 *icon_data,
|
||||||
gint icon_data_length)
|
gint icon_data_length)
|
||||||
{
|
{
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
@ -187,7 +185,7 @@ plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
|||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
proc_def->icon_data_length = -1;
|
proc_def->icon_data_length = -1;
|
||||||
proc_def->icon_data = g_strdup (icon_data);
|
proc_def->icon_data = (guint8 *) g_strdup ((gchar *) icon_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
@ -206,7 +204,7 @@ plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def)
|
|||||||
switch (proc_def->icon_type)
|
switch (proc_def->icon_type)
|
||||||
{
|
{
|
||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
return proc_def->icon_data;
|
return (gchar *) proc_def->icon_data;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -226,26 +224,23 @@ plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def)
|
|||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
||||||
proc_def->icon_data, TRUE, &error);
|
proc_def->icon_data, TRUE, &error);
|
||||||
if (! pixbuf)
|
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
pixbuf = gdk_pixbuf_new_from_file (proc_def->icon_data, &error);
|
pixbuf = gdk_pixbuf_new_from_file ((gchar *) proc_def->icon_data,
|
||||||
if (! pixbuf)
|
&error);
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! pixbuf && error)
|
||||||
|
{
|
||||||
|
g_printerr (error->message);
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ struct _PlugInProcDef
|
|||||||
GList *menu_paths;
|
GList *menu_paths;
|
||||||
GimpIconType icon_type;
|
GimpIconType icon_type;
|
||||||
gint icon_data_length;
|
gint icon_data_length;
|
||||||
gchar *icon_data;
|
guint8 *icon_data;
|
||||||
gchar *image_types;
|
gchar *image_types;
|
||||||
PlugInImageType image_types_val;
|
PlugInImageType image_types_val;
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
@ -67,7 +67,7 @@ gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
|
|
||||||
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType type,
|
GimpIconType type,
|
||||||
const gchar *data,
|
const guint8 *data,
|
||||||
gint data_length);
|
gint data_length);
|
||||||
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
||||||
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
||||||
|
@ -56,8 +56,6 @@ plug_in_proc_def_new (void)
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
||||||
{
|
{
|
||||||
gint i;
|
|
||||||
|
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
|
|
||||||
gimp_procedure_free (proc_def->procedure);
|
gimp_procedure_free (proc_def->procedure);
|
||||||
@ -166,7 +164,7 @@ plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType icon_type,
|
GimpIconType icon_type,
|
||||||
const gchar *icon_data,
|
const guint8 *icon_data,
|
||||||
gint icon_data_length)
|
gint icon_data_length)
|
||||||
{
|
{
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
@ -187,7 +185,7 @@ plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
|||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
proc_def->icon_data_length = -1;
|
proc_def->icon_data_length = -1;
|
||||||
proc_def->icon_data = g_strdup (icon_data);
|
proc_def->icon_data = (guint8 *) g_strdup ((gchar *) icon_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
@ -206,7 +204,7 @@ plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def)
|
|||||||
switch (proc_def->icon_type)
|
switch (proc_def->icon_type)
|
||||||
{
|
{
|
||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
return proc_def->icon_data;
|
return (gchar *) proc_def->icon_data;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -226,26 +224,23 @@ plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def)
|
|||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
||||||
proc_def->icon_data, TRUE, &error);
|
proc_def->icon_data, TRUE, &error);
|
||||||
if (! pixbuf)
|
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
pixbuf = gdk_pixbuf_new_from_file (proc_def->icon_data, &error);
|
pixbuf = gdk_pixbuf_new_from_file ((gchar *) proc_def->icon_data,
|
||||||
if (! pixbuf)
|
&error);
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! pixbuf && error)
|
||||||
|
{
|
||||||
|
g_printerr (error->message);
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ struct _PlugInProcDef
|
|||||||
GList *menu_paths;
|
GList *menu_paths;
|
||||||
GimpIconType icon_type;
|
GimpIconType icon_type;
|
||||||
gint icon_data_length;
|
gint icon_data_length;
|
||||||
gchar *icon_data;
|
guint8 *icon_data;
|
||||||
gchar *image_types;
|
gchar *image_types;
|
||||||
PlugInImageType image_types_val;
|
PlugInImageType image_types_val;
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
@ -67,7 +67,7 @@ gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
|
|
||||||
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType type,
|
GimpIconType type,
|
||||||
const gchar *data,
|
const guint8 *data,
|
||||||
gint data_length);
|
gint data_length);
|
||||||
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
||||||
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
||||||
|
@ -56,8 +56,6 @@ plug_in_proc_def_new (void)
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
plug_in_proc_def_free (PlugInProcDef *proc_def)
|
||||||
{
|
{
|
||||||
gint i;
|
|
||||||
|
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
|
|
||||||
gimp_procedure_free (proc_def->procedure);
|
gimp_procedure_free (proc_def->procedure);
|
||||||
@ -166,7 +164,7 @@ plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
void
|
void
|
||||||
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType icon_type,
|
GimpIconType icon_type,
|
||||||
const gchar *icon_data,
|
const guint8 *icon_data,
|
||||||
gint icon_data_length)
|
gint icon_data_length)
|
||||||
{
|
{
|
||||||
g_return_if_fail (proc_def != NULL);
|
g_return_if_fail (proc_def != NULL);
|
||||||
@ -187,7 +185,7 @@ plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
|||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
proc_def->icon_data_length = -1;
|
proc_def->icon_data_length = -1;
|
||||||
proc_def->icon_data = g_strdup (icon_data);
|
proc_def->icon_data = (guint8 *) g_strdup ((gchar *) icon_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
@ -206,7 +204,7 @@ plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def)
|
|||||||
switch (proc_def->icon_type)
|
switch (proc_def->icon_type)
|
||||||
{
|
{
|
||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
return proc_def->icon_data;
|
return (gchar *) proc_def->icon_data;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -226,26 +224,23 @@ plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def)
|
|||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
pixbuf = gdk_pixbuf_new_from_inline (proc_def->icon_data_length,
|
||||||
proc_def->icon_data, TRUE, &error);
|
proc_def->icon_data, TRUE, &error);
|
||||||
if (! pixbuf)
|
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
pixbuf = gdk_pixbuf_new_from_file (proc_def->icon_data, &error);
|
pixbuf = gdk_pixbuf_new_from_file ((gchar *) proc_def->icon_data,
|
||||||
if (! pixbuf)
|
&error);
|
||||||
{
|
|
||||||
g_printerr (error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! pixbuf && error)
|
||||||
|
{
|
||||||
|
g_printerr (error->message);
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ struct _PlugInProcDef
|
|||||||
GList *menu_paths;
|
GList *menu_paths;
|
||||||
GimpIconType icon_type;
|
GimpIconType icon_type;
|
||||||
gint icon_data_length;
|
gint icon_data_length;
|
||||||
gchar *icon_data;
|
guint8 *icon_data;
|
||||||
gchar *image_types;
|
gchar *image_types;
|
||||||
PlugInImageType image_types_val;
|
PlugInImageType image_types_val;
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
@ -67,7 +67,7 @@ gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
|||||||
|
|
||||||
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
void plug_in_proc_def_set_icon (PlugInProcDef *proc_def,
|
||||||
GimpIconType type,
|
GimpIconType type,
|
||||||
const gchar *data,
|
const guint8 *data,
|
||||||
gint data_length);
|
gint data_length);
|
||||||
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
const gchar * plug_in_proc_def_get_stock_id (const PlugInProcDef *proc_def);
|
||||||
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
GdkPixbuf * plug_in_proc_def_get_pixbuf (const PlugInProcDef *proc_def);
|
||||||
|
@ -505,7 +505,7 @@ plug_in_icon_deserialize (GScanner *scanner,
|
|||||||
|
|
||||||
proc_def->icon_type = icon_type;
|
proc_def->icon_type = icon_type;
|
||||||
proc_def->icon_data_length = icon_data_length;
|
proc_def->icon_data_length = icon_data_length;
|
||||||
proc_def->icon_data = (gchar *) icon_data;
|
proc_def->icon_data = icon_data;
|
||||||
|
|
||||||
if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
|
if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
|
||||||
return G_TOKEN_RIGHT_PAREN;
|
return G_TOKEN_RIGHT_PAREN;
|
||||||
@ -810,12 +810,13 @@ plug_in_rc_write (GSList *plug_in_defs,
|
|||||||
{
|
{
|
||||||
case GIMP_ICON_TYPE_STOCK_ID:
|
case GIMP_ICON_TYPE_STOCK_ID:
|
||||||
case GIMP_ICON_TYPE_IMAGE_FILE:
|
case GIMP_ICON_TYPE_IMAGE_FILE:
|
||||||
gimp_config_writer_string (writer, proc_def->icon_data);
|
gimp_config_writer_string (writer,
|
||||||
|
(gchar *) proc_def->icon_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
case GIMP_ICON_TYPE_INLINE_PIXBUF:
|
||||||
gimp_config_writer_data (writer, proc_def->icon_data_length,
|
gimp_config_writer_data (writer, proc_def->icon_data_length,
|
||||||
(guint8 *) proc_def->icon_data);
|
proc_def->icon_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ static PlugInProcDef xcf_plug_in_load_proc =
|
|||||||
NULL,
|
NULL,
|
||||||
GIMP_ICON_TYPE_STOCK_ID,
|
GIMP_ICON_TYPE_STOCK_ID,
|
||||||
-1,
|
-1,
|
||||||
"gimp-wilber",
|
(guint8 *) "gimp-wilber",
|
||||||
NULL, /* ignored for load */
|
NULL, /* ignored for load */
|
||||||
0, /* ignored for load */
|
0, /* ignored for load */
|
||||||
0,
|
0,
|
||||||
@ -130,7 +130,7 @@ static PlugInProcDef xcf_plug_in_save_proc =
|
|||||||
NULL,
|
NULL,
|
||||||
GIMP_ICON_TYPE_STOCK_ID,
|
GIMP_ICON_TYPE_STOCK_ID,
|
||||||
-1,
|
-1,
|
||||||
"gimp-wilber",
|
(guint8 *) "gimp-wilber",
|
||||||
"RGB*, GRAY*, INDEXED*",
|
"RGB*, GRAY*, INDEXED*",
|
||||||
0, /* fill me in at runtime */
|
0, /* fill me in at runtime */
|
||||||
0,
|
0,
|
||||||
|
Reference in New Issue
Block a user