libgimp: move gimp_plugin_icon_register() to gimplegacy.[ch]

This commit is contained in:
Michael Natterer 2019-07-30 23:59:13 +02:00
parent 7201be78d9
commit 7dec3aa792
4 changed files with 44 additions and 42 deletions

View File

@ -880,3 +880,38 @@ gimp_param_free (gpointer boxed)
G_DEFINE_BOXED_TYPE (GimpParam, gimp_param,
gimp_param_copy,
gimp_param_free)
/* old gimp_plugin cruft */
gboolean
gimp_plugin_icon_register (const gchar *procedure_name,
GimpIconType icon_type,
const guint8 *icon_data)
{
gint icon_data_length;
g_return_val_if_fail (procedure_name != NULL, FALSE);
g_return_val_if_fail (icon_data != NULL, FALSE);
switch (icon_type)
{
case GIMP_ICON_TYPE_ICON_NAME:
case GIMP_ICON_TYPE_IMAGE_FILE:
icon_data_length = strlen ((const gchar *) icon_data) + 1;
break;
case GIMP_ICON_TYPE_INLINE_PIXBUF:
g_return_val_if_fail (g_ntohl (*((gint32 *) icon_data)) == 0x47646b50,
FALSE);
icon_data_length = g_ntohl (*((gint32 *) (icon_data + 4)));
break;
default:
g_return_val_if_reached (FALSE);
}
return _gimp_plugin_icon_register (procedure_name,
icon_type, icon_data_length, icon_data);
}

View File

@ -293,6 +293,15 @@ void gimp_destroy_paramdefs (GimpParamDef *paramdefs,
gint n_params);
/* gimp_plugin API that should now be done by using GimpPlugIn and
* GimpProcedure
*/
gboolean gimp_plugin_icon_register (const gchar *procedure_name,
GimpIconType icon_type,
const guint8 *icon_data);
G_END_DECLS
#endif /* __GIMP_LEGACY_H__ */

View File

@ -221,38 +221,3 @@ gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
return NULL;
}
/* unrelated old API */
gboolean
gimp_plugin_icon_register (const gchar *procedure_name,
GimpIconType icon_type,
const guint8 *icon_data)
{
gint icon_data_length;
g_return_val_if_fail (procedure_name != NULL, FALSE);
g_return_val_if_fail (icon_data != NULL, FALSE);
switch (icon_type)
{
case GIMP_ICON_TYPE_ICON_NAME:
case GIMP_ICON_TYPE_IMAGE_FILE:
icon_data_length = strlen ((const gchar *) icon_data) + 1;
break;
case GIMP_ICON_TYPE_INLINE_PIXBUF:
g_return_val_if_fail (g_ntohl (*((gint32 *) icon_data)) == 0x47646b50,
FALSE);
icon_data_length = g_ntohl (*((gint32 *) (icon_data + 4)));
break;
default:
g_return_val_if_reached (FALSE);
}
return _gimp_plugin_icon_register (procedure_name,
icon_type, icon_data_length, icon_data);
}

View File

@ -100,13 +100,6 @@ GimpProcedure * gimp_plug_in_get_temp_procedure (GimpPlugIn *plug_in,
const gchar *name);
/* unrelated old API */
gboolean gimp_plugin_icon_register (const gchar *procedure_name,
GimpIconType icon_type,
const guint8 *icon_data);
G_END_DECLS
#endif /* __GIMP_PLUG_IN_H__ */