Commit 5e28089d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

use "const GimpParasite*" insted of gpointer for the parasite parameter.

2006-04-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-undo-push.[ch]
	(gimp_image_undo_push_image,item_parasite): use "const GimpParasite*"
	insted of gpointer for the parasite parameter.

	* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): added
	const to the parasite parameter, return the actually added
	parasite (which is a copy).

	* app/core/gimpunit.[ch] (_gimp_unit_new): added const to all
	string parameters.
parent 850dcb48
2006-04-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.[ch]
(gimp_image_undo_push_image,item_parasite): use "const GimpParasite*"
insted of gpointer for the parasite parameter.
* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): added
const to the parasite parameter, return the actually added
parasite (which is a copy).
* app/core/gimpunit.[ch] (_gimp_unit_new): added const to all
string parameters.
2006-04-02 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/lib.pl: use the variable initializer defined with
......
......@@ -3062,9 +3062,9 @@ static void undo_free_parasite (GimpUndo *undo,
GimpUndoMode undo_mode);
gboolean
gimp_image_undo_push_image_parasite (GimpImage *image,
const gchar *undo_desc,
gpointer parasite)
gimp_image_undo_push_image_parasite (GimpImage *image,
const gchar *undo_desc,
const GimpParasite *parasite)
{
GimpUndo *new;
......@@ -3081,7 +3081,7 @@ gimp_image_undo_push_image_parasite (GimpImage *image,
{
ParasiteUndo *pu = new->data;
pu->image = image;
pu->image = image;
pu->item = NULL;
pu->name = g_strdup (gimp_parasite_name (parasite));
pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (image,
......@@ -3113,7 +3113,7 @@ gimp_image_undo_push_image_parasite_remove (GimpImage *image,
{
ParasiteUndo *pu = new->data;
pu->image = image;
pu->image = image;
pu->item = NULL;
pu->name = g_strdup (name);
pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (image,
......@@ -3126,10 +3126,10 @@ gimp_image_undo_push_image_parasite_remove (GimpImage *image,
}
gboolean
gimp_image_undo_push_item_parasite (GimpImage *image,
const gchar *undo_desc,
GimpItem *item,
gpointer parasite)
gimp_image_undo_push_item_parasite (GimpImage *image,
const gchar *undo_desc,
GimpItem *item,
const GimpParasite *parasite)
{
GimpUndo *new;
......@@ -3148,7 +3148,7 @@ gimp_image_undo_push_item_parasite (GimpImage *image,
{
ParasiteUndo *pu = new->data;
pu->image = NULL;
pu->image = NULL;
pu->item = item;
pu->name = g_strdup (gimp_parasite_name (parasite));
pu->parasite = gimp_parasite_copy (gimp_item_parasite_find (item,
......@@ -3182,7 +3182,7 @@ gimp_image_undo_push_item_parasite_remove (GimpImage *image,
{
ParasiteUndo *pu = new->data;
pu->image = NULL;
pu->image = NULL;
pu->item = item;
pu->name = g_strdup (name);
pu->parasite = gimp_parasite_copy (gimp_item_parasite_find (item,
......
......@@ -193,7 +193,7 @@ gboolean gimp_image_undo_push_fs_relax (GimpImage *image,
gboolean gimp_image_undo_push_image_parasite (GimpImage *image,
const gchar *undo_desc,
gpointer parasite);
const GimpParasite *parasite);
gboolean gimp_image_undo_push_image_parasite_remove (GimpImage *image,
const gchar *undo_desc,
const gchar *name);
......@@ -201,7 +201,7 @@ gboolean gimp_image_undo_push_image_parasite_remove (GimpImage *image,
gboolean gimp_image_undo_push_item_parasite (GimpImage *image,
const gchar *undo_desc,
GimpItem *item,
gpointer parasite);
const GimpParasite *parasite);
gboolean gimp_image_undo_push_item_parasite_remove (GimpImage *image,
const gchar *undo_desc,
GimpItem *item,
......
......@@ -258,7 +258,7 @@ gimp_parasite_list_deserialize (GimpConfig *list,
goto cleanup;
parasite_data_size = strlen (str);
parasite_data = str;
parasite_data = (guint8 *) str;
}
else
{
......@@ -330,22 +330,26 @@ gimp_parasite_list_copy (const GimpParasiteList *list)
return newlist;
}
void
gimp_parasite_list_add (GimpParasiteList *list,
GimpParasite *parasite)
GimpParasite *
gimp_parasite_list_add (GimpParasiteList *list,
const GimpParasite *parasite)
{
g_return_if_fail (GIMP_IS_PARASITE_LIST (list));
g_return_if_fail (parasite != NULL);
g_return_if_fail (parasite->name != NULL);
GimpParasite *copy;
g_return_val_if_fail (GIMP_IS_PARASITE_LIST (list), NULL);
g_return_val_if_fail (parasite != NULL, NULL);
g_return_val_if_fail (parasite->name != NULL, NULL);
if (list->table == NULL)
list->table = g_hash_table_new (g_str_hash, g_str_equal);
gimp_parasite_list_remove (list, parasite->name);
parasite = gimp_parasite_copy (parasite);
g_hash_table_insert (list->table, parasite->name, parasite);
copy = gimp_parasite_copy (parasite);
g_hash_table_insert (list->table, copy->name, copy);
g_signal_emit (list, parasite_list_signals[ADD], 0, copy);
g_signal_emit (list, parasite_list_signals[ADD], 0, parasite);
return copy;
}
void
......
......@@ -54,8 +54,8 @@ GType gimp_parasite_list_get_type (void) G_GNUC_CONST;
GimpParasiteList * gimp_parasite_list_new (void);
GimpParasiteList * gimp_parasite_list_copy (const GimpParasiteList *list);
void gimp_parasite_list_add (GimpParasiteList *list,
GimpParasite *parasite);
GimpParasite * gimp_parasite_list_add (GimpParasiteList *list,
const GimpParasite *parasite);
void gimp_parasite_list_remove (GimpParasiteList *list,
const gchar *name);
gint gimp_parasite_list_length (GimpParasiteList *list);
......
......@@ -96,14 +96,14 @@ _gimp_unit_get_number_of_built_in_units (Gimp *gimp)
}
GimpUnit
_gimp_unit_new (Gimp *gimp,
gchar *identifier,
gdouble factor,
gint digits,
gchar *symbol,
gchar *abbreviation,
gchar *singular,
gchar *plural)
_gimp_unit_new (Gimp *gimp,
const gchar *identifier,
gdouble factor,
gint digits,
const gchar *symbol,
const gchar *abbreviation,
const gchar *singular,
const gchar *plural)
{
GimpUnitDef *user_unit;
......
......@@ -20,43 +20,43 @@
#define __APP_GIMP_UNIT_H__
gint _gimp_unit_get_number_of_units (Gimp *gimp);
gint _gimp_unit_get_number_of_built_in_units (Gimp *gimp) G_GNUC_CONST;
GimpUnit _gimp_unit_new (Gimp *gimp,
gchar *identifier,
gdouble factor,
gint digits,
gchar *symbol,
gchar *abbreviation,
gchar *singular,
gchar *plural);
gboolean _gimp_unit_get_deletion_flag (Gimp *gimp,
GimpUnit unit);
void _gimp_unit_set_deletion_flag (Gimp *gimp,
GimpUnit unit,
gboolean deletion_flag);
gdouble _gimp_unit_get_factor (Gimp *gimp,
GimpUnit unit);
gint _gimp_unit_get_digits (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_identifier (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_symbol (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_abbreviation (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_singular (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_plural (Gimp *gimp,
GimpUnit unit);
void gimp_user_units_free (Gimp *gimp);
gint _gimp_unit_get_number_of_units (Gimp *gimp);
gint _gimp_unit_get_number_of_built_in_units (Gimp *gimp) G_GNUC_CONST;
GimpUnit _gimp_unit_new (Gimp *gimp,
const gchar *identifier,
gdouble factor,
gint digits,
const gchar *symbol,
const gchar *abbreviation,
const gchar *singular,
const gchar *plural);
gboolean _gimp_unit_get_deletion_flag (Gimp *gimp,
GimpUnit unit);
void _gimp_unit_set_deletion_flag (Gimp *gimp,
GimpUnit unit,
gboolean deletion_flag);
gdouble _gimp_unit_get_factor (Gimp *gimp,
GimpUnit unit);
gint _gimp_unit_get_digits (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_identifier (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_symbol (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_abbreviation (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_singular (Gimp *gimp,
GimpUnit unit);
const gchar * _gimp_unit_get_plural (Gimp *gimp,
GimpUnit unit);
void gimp_user_units_free (Gimp *gimp);
#endif /* __APP_GIMP_UNIT_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment