free the memory allocated for the GimpLut structure. Removed trailing
2003-09-05 Sven Neumann <sven@gimp.org> * app/base/gimplut.[ch] (gimp_lut_free): free the memory allocated for the GimpLut structure. Removed trailing whitespace. * app/core/gimpbuffer.c: cosmetics. * app/core/gimpedit.[ch]: let gimp_edit_cut() and gimp_edit_copy() return a pointer to the global cut buffer instead of creating a GimpBuffer which was leaked by most callers. * app/gui/edit-commands.c: changed accordingly. * libgimpwidgets/gimpquerybox.[ch] (string_query_box_ok_callback): removed a superfluous g_strdup(); made GimpQueryStringCallback take a const gchar* pointer. * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/palettes-commands.c: changed accordingly.
This commit is contained in:

committed by
Sven Neumann

parent
7dc961ad50
commit
8e38f70b96
21
ChangeLog
21
ChangeLog
@ -1,3 +1,24 @@
|
||||
2003-09-05 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/gimplut.[ch] (gimp_lut_free): free the memory allocated
|
||||
for the GimpLut structure. Removed trailing whitespace.
|
||||
|
||||
* app/core/gimpbuffer.c: cosmetics.
|
||||
|
||||
* app/core/gimpedit.[ch]: let gimp_edit_cut() and gimp_edit_copy()
|
||||
return a pointer to the global cut buffer instead of creating a
|
||||
GimpBuffer which was leaked by most callers.
|
||||
|
||||
* app/gui/edit-commands.c: changed accordingly.
|
||||
|
||||
* libgimpwidgets/gimpquerybox.[ch] (string_query_box_ok_callback):
|
||||
removed a superfluous g_strdup(); made GimpQueryStringCallback take
|
||||
a const gchar* pointer.
|
||||
|
||||
* app/gui/edit-commands.c
|
||||
* app/gui/file-commands.c
|
||||
* app/gui/palettes-commands.c: changed accordingly.
|
||||
|
||||
2003-09-05 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/script-fu/script-fu-scripts.c (script_fu_interface):
|
||||
|
@ -72,10 +72,10 @@
|
||||
/* local function prototypes */
|
||||
|
||||
static void cut_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
static void copy_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBuffer *cut_buffer;
|
||||
const GimpBuffer *cut_buffer;
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) data;
|
||||
@ -314,10 +314,10 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
|
||||
static void
|
||||
copy_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBuffer *copy_buffer;
|
||||
const GimpBuffer *copy_buffer;
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) data;
|
||||
|
@ -85,7 +85,7 @@
|
||||
/* local function prototypes */
|
||||
|
||||
static void file_new_template_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
static void file_revert_confirm_callback (GtkWidget *widget,
|
||||
gboolean revert,
|
||||
@ -392,7 +392,7 @@ file_file_open_dialog (Gimp *gimp,
|
||||
|
||||
static void
|
||||
file_new_template_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTemplate *template;
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
static void palettes_merge_palettes_query (GimpContainerEditor *editor);
|
||||
static void palettes_merge_palettes_callback (GtkWidget *widget,
|
||||
gchar *palette_name,
|
||||
const gchar *palette_name,
|
||||
gpointer data);
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ palettes_merge_palettes_query (GimpContainerEditor *editor)
|
||||
|
||||
static void
|
||||
palettes_merge_palettes_callback (GtkWidget *widget,
|
||||
gchar *palette_name,
|
||||
const gchar *palette_name,
|
||||
gpointer data)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
|
@ -52,6 +52,7 @@ gimp_lut_free (GimpLut *lut)
|
||||
g_free (lut->luts[i]);
|
||||
|
||||
g_free (lut->luts);
|
||||
g_free (lut);
|
||||
}
|
||||
|
||||
void
|
||||
@ -88,6 +89,7 @@ gimp_lut_setup (GimpLut *lut,
|
||||
}
|
||||
}
|
||||
|
||||
/* see comment in gimplut.h */
|
||||
void
|
||||
gimp_lut_setup_exact (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
|
@ -28,8 +28,8 @@ struct _GimpLut
|
||||
gint nchannels;
|
||||
};
|
||||
|
||||
/* TODO: the GimpLutFunc should really be passed the ColorModel of the region,
|
||||
* not just the number of channels
|
||||
/* TODO: the GimpLutFunc should really be passed the ColorModel of the
|
||||
* region, not just the number of channels
|
||||
*/
|
||||
|
||||
/* GimpLutFuncs should assume that the input and output gamma are 1.0
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
GimpBuffer *
|
||||
const GimpBuffer *
|
||||
gimp_edit_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable)
|
||||
{
|
||||
@ -97,13 +97,15 @@ gimp_edit_cut (GimpImage *gimage,
|
||||
/* Set the global edit buffer */
|
||||
gimage->gimp->global_buffer = gimp_buffer_new (cropped_cut,
|
||||
"Global Buffer",
|
||||
TRUE);
|
||||
FALSE);
|
||||
|
||||
return gimage->gimp->global_buffer;
|
||||
}
|
||||
|
||||
return gimp_buffer_new (cropped_cut, "Cut Pixels", FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpBuffer *
|
||||
const GimpBuffer *
|
||||
gimp_edit_copy (GimpImage *gimage,
|
||||
GimpDrawable *drawable)
|
||||
{
|
||||
@ -155,10 +157,12 @@ gimp_edit_copy (GimpImage *gimage,
|
||||
/* Set the global edit buffer */
|
||||
gimage->gimp->global_buffer = gimp_buffer_new (cropped_copy,
|
||||
"Global Buffer",
|
||||
TRUE);
|
||||
FALSE);
|
||||
|
||||
return gimage->gimp->global_buffer;
|
||||
}
|
||||
|
||||
return gimp_buffer_new (cropped_copy, "Copied Pixels", FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpLayer *
|
||||
|
@ -20,9 +20,9 @@
|
||||
#define __GIMP_EDIT_H__
|
||||
|
||||
|
||||
GimpBuffer * gimp_edit_cut (GimpImage *gimage,
|
||||
const GimpBuffer * gimp_edit_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable);
|
||||
GimpBuffer * gimp_edit_copy (GimpImage *gimage,
|
||||
const GimpBuffer * gimp_edit_copy (GimpImage *gimage,
|
||||
GimpDrawable *drawable);
|
||||
GimpLayer * gimp_edit_paste (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -316,7 +316,8 @@ gimp_buffer_new (TileManager *tiles,
|
||||
|
||||
if (copy_pixels)
|
||||
{
|
||||
buffer->tiles = tile_manager_new (width, height, tile_manager_bpp (tiles));
|
||||
buffer->tiles = tile_manager_new (width, height,
|
||||
tile_manager_bpp (tiles));
|
||||
|
||||
pixel_region_init (&srcPR, tiles, 0, 0, width, height, FALSE);
|
||||
pixel_region_init (&destPR, buffer->tiles, 0, 0, width, height, TRUE);
|
||||
@ -327,7 +328,7 @@ gimp_buffer_new (TileManager *tiles,
|
||||
buffer->tiles = tiles;
|
||||
}
|
||||
|
||||
return GIMP_BUFFER (buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
gint
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
GimpBuffer *
|
||||
const GimpBuffer *
|
||||
gimp_edit_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable)
|
||||
{
|
||||
@ -97,13 +97,15 @@ gimp_edit_cut (GimpImage *gimage,
|
||||
/* Set the global edit buffer */
|
||||
gimage->gimp->global_buffer = gimp_buffer_new (cropped_cut,
|
||||
"Global Buffer",
|
||||
TRUE);
|
||||
FALSE);
|
||||
|
||||
return gimage->gimp->global_buffer;
|
||||
}
|
||||
|
||||
return gimp_buffer_new (cropped_cut, "Cut Pixels", FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpBuffer *
|
||||
const GimpBuffer *
|
||||
gimp_edit_copy (GimpImage *gimage,
|
||||
GimpDrawable *drawable)
|
||||
{
|
||||
@ -155,10 +157,12 @@ gimp_edit_copy (GimpImage *gimage,
|
||||
/* Set the global edit buffer */
|
||||
gimage->gimp->global_buffer = gimp_buffer_new (cropped_copy,
|
||||
"Global Buffer",
|
||||
TRUE);
|
||||
FALSE);
|
||||
|
||||
return gimage->gimp->global_buffer;
|
||||
}
|
||||
|
||||
return gimp_buffer_new (cropped_copy, "Copied Pixels", FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpLayer *
|
||||
|
@ -20,9 +20,9 @@
|
||||
#define __GIMP_EDIT_H__
|
||||
|
||||
|
||||
GimpBuffer * gimp_edit_cut (GimpImage *gimage,
|
||||
const GimpBuffer * gimp_edit_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable);
|
||||
GimpBuffer * gimp_edit_copy (GimpImage *gimage,
|
||||
const GimpBuffer * gimp_edit_copy (GimpImage *gimage,
|
||||
GimpDrawable *drawable);
|
||||
GimpLayer * gimp_edit_paste (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
|
@ -72,10 +72,10 @@
|
||||
/* local function prototypes */
|
||||
|
||||
static void cut_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
static void copy_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBuffer *cut_buffer;
|
||||
const GimpBuffer *cut_buffer;
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) data;
|
||||
@ -314,10 +314,10 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
|
||||
static void
|
||||
copy_named_buffer_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBuffer *copy_buffer;
|
||||
const GimpBuffer *copy_buffer;
|
||||
GimpImage *gimage;
|
||||
|
||||
gimage = (GimpImage *) data;
|
||||
|
@ -85,7 +85,7 @@
|
||||
/* local function prototypes */
|
||||
|
||||
static void file_new_template_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
static void file_revert_confirm_callback (GtkWidget *widget,
|
||||
gboolean revert,
|
||||
@ -392,7 +392,7 @@ file_file_open_dialog (Gimp *gimp,
|
||||
|
||||
static void
|
||||
file_new_template_callback (GtkWidget *widget,
|
||||
gchar *name,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTemplate *template;
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
static void palettes_merge_palettes_query (GimpContainerEditor *editor);
|
||||
static void palettes_merge_palettes_callback (GtkWidget *widget,
|
||||
gchar *palette_name,
|
||||
const gchar *palette_name,
|
||||
gpointer data);
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ palettes_merge_palettes_query (GimpContainerEditor *editor)
|
||||
|
||||
static void
|
||||
palettes_merge_palettes_callback (GtkWidget *widget,
|
||||
gchar *palette_name,
|
||||
const gchar *palette_name,
|
||||
gpointer data)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
|
@ -532,12 +532,12 @@ string_query_box_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
QueryBox *query_box;
|
||||
gchar *string;
|
||||
const gchar *string;
|
||||
|
||||
query_box = query_box_disconnect (data);
|
||||
|
||||
/* Get the entry data */
|
||||
string = g_strdup (gtk_entry_get_text (GTK_ENTRY (query_box->entry)));
|
||||
string = gtk_entry_get_text (GTK_ENTRY (query_box->entry));
|
||||
|
||||
/* Call the user defined callback */
|
||||
(* (GimpQueryStringCallback) query_box->callback) (query_box->qbox,
|
||||
|
@ -30,7 +30,7 @@ G_BEGIN_DECLS
|
||||
|
||||
/* query box callback prototypes */
|
||||
typedef void (* GimpQueryStringCallback) (GtkWidget *query_box,
|
||||
gchar *string,
|
||||
const gchar *string,
|
||||
gpointer data);
|
||||
|
||||
typedef void (* GimpQueryIntCallback) (GtkWidget *query_box,
|
||||
|
Reference in New Issue
Block a user