mirror of https://github.com/GNOME/gimp.git
app/dialogs/channel-options-dialog.c app/dialogs/convert-dialog.c
2007-05-23 Sven Neumann <sven@gimp.org> * app/dialogs/channel-options-dialog.c * app/dialogs/convert-dialog.c * app/dialogs/desaturate-dialog.c * app/dialogs/fade-dialog.c * app/dialogs/image-merge-layers-dialog.c * app/dialogs/image-new-dialog.c * app/dialogs/image-scale-dialog.c * app/dialogs/layer-add-mask-dialog.c * app/dialogs/layer-options-dialog.c * app/dialogs/module-dialog.c * app/dialogs/offset-dialog.c * app/dialogs/palette-import-dialog.c * app/dialogs/print-size-dialog.c * app/dialogs/resize-dialog.c * app/dialogs/scale-dialog.c * app/dialogs/template-options-dialog.c * app/dialogs/vectors-export-dialog.c * app/dialogs/vectors-import-dialog.c * app/dialogs/vectors-options-dialog.c: allocate structs using GSlice. svn path=/trunk/; revision=22598
This commit is contained in:
parent
ac2f30c485
commit
2381068a89
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
|||
2007-05-23 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/dialogs/channel-options-dialog.c
|
||||
* app/dialogs/convert-dialog.c
|
||||
* app/dialogs/desaturate-dialog.c
|
||||
* app/dialogs/fade-dialog.c
|
||||
* app/dialogs/image-merge-layers-dialog.c
|
||||
* app/dialogs/image-new-dialog.c
|
||||
* app/dialogs/image-scale-dialog.c
|
||||
* app/dialogs/layer-add-mask-dialog.c
|
||||
* app/dialogs/layer-options-dialog.c
|
||||
* app/dialogs/module-dialog.c
|
||||
* app/dialogs/offset-dialog.c
|
||||
* app/dialogs/palette-import-dialog.c
|
||||
* app/dialogs/print-size-dialog.c
|
||||
* app/dialogs/resize-dialog.c
|
||||
* app/dialogs/scale-dialog.c
|
||||
* app/dialogs/template-options-dialog.c
|
||||
* app/dialogs/vectors-export-dialog.c
|
||||
* app/dialogs/vectors-import-dialog.c
|
||||
* app/dialogs/vectors-options-dialog.c: allocate structs using GSlice.
|
||||
|
||||
2007-05-23 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimpiscissorstool.[ch]: use a GQueue to store the points.
|
||||
|
|
|
@ -39,10 +39,11 @@
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void channel_options_opacity_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
static void channel_options_color_changed (GimpColorButton *button,
|
||||
gpointer data);
|
||||
static void channel_options_opacity_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
static void channel_options_color_changed (GimpColorButton *button,
|
||||
gpointer data);
|
||||
static void channel_options_dialog_free (ChannelOptionsDialog *options);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -83,7 +84,7 @@ channel_options_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (color_label != NULL, NULL);
|
||||
g_return_val_if_fail (opacity_label != NULL, NULL);
|
||||
|
||||
options = g_new0 (ChannelOptionsDialog, 1);
|
||||
options = g_slice_new0 (ChannelOptionsDialog);
|
||||
|
||||
options->image = image;
|
||||
options->context = context;
|
||||
|
@ -113,7 +114,7 @@ channel_options_dialog_new (GimpImage *image,
|
|||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||
(GWeakNotify) g_free,
|
||||
(GWeakNotify) channel_options_dialog_free,
|
||||
options);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (options->dialog),
|
||||
|
@ -204,3 +205,9 @@ channel_options_color_changed (GimpColorButton *button,
|
|||
gimp_color_button_get_color (button, &color);
|
||||
gtk_adjustment_set_value (adj, color.a * 100.0);
|
||||
}
|
||||
|
||||
static void
|
||||
channel_options_dialog_free (ChannelOptionsDialog *options)
|
||||
{
|
||||
g_slice_free (ChannelOptionsDialog, options);
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ static gboolean convert_dialog_palette_filter (const GimpObject *object,
|
|||
static void convert_dialog_palette_changed (GimpContext *context,
|
||||
GimpPalette *palette,
|
||||
IndexedDialog *dialog);
|
||||
static void convert_dialog_free (IndexedDialog *dialog);
|
||||
|
||||
|
||||
/* defaults */
|
||||
|
@ -109,7 +110,7 @@ convert_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
|
||||
dialog = g_new0 (IndexedDialog, 1);
|
||||
dialog = g_slice_new0 (IndexedDialog);
|
||||
|
||||
dialog->image = image;
|
||||
dialog->progress = progress;
|
||||
|
@ -147,7 +148,7 @@ convert_dialog_new (GimpImage *image,
|
|||
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) convert_dialog_free, dialog);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
G_CALLBACK (convert_dialog_response),
|
||||
|
@ -406,3 +407,9 @@ convert_dialog_palette_changed (GimpContext *context,
|
|||
dialog->custom_palette = palette;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
convert_dialog_free (IndexedDialog *dialog)
|
||||
{
|
||||
g_slice_free (IndexedDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void desaturate_dialog_free (DesaturateDialog *dialog);
|
||||
|
||||
|
||||
DesaturateDialog *
|
||||
desaturate_dialog_new (GimpDrawable *drawable,
|
||||
|
@ -52,7 +53,7 @@ desaturate_dialog_new (GimpDrawable *drawable,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (DesaturateDialog, 1);
|
||||
dialog = g_slice_new0 (DesaturateDialog);
|
||||
|
||||
dialog->drawable = drawable;
|
||||
dialog->mode = mode;
|
||||
|
@ -84,7 +85,7 @@ desaturate_dialog_new (GimpDrawable *drawable,
|
|||
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) desaturate_dialog_free, dialog);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 12);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||
|
@ -105,3 +106,9 @@ desaturate_dialog_new (GimpDrawable *drawable,
|
|||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
desaturate_dialog_free (DesaturateDialog *dialog)
|
||||
{
|
||||
g_slice_free (DesaturateDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -42,9 +42,7 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
typedef struct _FadeDialog FadeDialog;
|
||||
|
||||
struct _FadeDialog
|
||||
typedef struct
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
|
@ -53,7 +51,7 @@ struct _FadeDialog
|
|||
gboolean applied;
|
||||
GimpLayerModeEffects orig_paint_mode;
|
||||
gdouble orig_opacity;
|
||||
};
|
||||
} FadeDialog;
|
||||
|
||||
|
||||
static void fade_dialog_response (GtkWidget *dialog,
|
||||
|
@ -61,6 +59,7 @@ static void fade_dialog_response (GtkWidget *dialog,
|
|||
FadeDialog *private);
|
||||
|
||||
static void fade_dialog_context_changed (FadeDialog *private);
|
||||
static void fade_dialog_free (FadeDialog *private);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -93,7 +92,7 @@ fade_dialog_new (GimpImage *image,
|
|||
item = GIMP_ITEM_UNDO (undo)->item;
|
||||
drawable = GIMP_DRAWABLE (item);
|
||||
|
||||
private = g_new0 (FadeDialog, 1);
|
||||
private = g_slice_new0 (FadeDialog);
|
||||
|
||||
private->image = image;
|
||||
private->drawable = drawable;
|
||||
|
@ -133,7 +132,8 @@ fade_dialog_new (GimpImage *image,
|
|||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_free, private);
|
||||
g_object_weak_ref (G_OBJECT (dialog),
|
||||
(GWeakNotify) fade_dialog_free, private);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (fade_dialog_response),
|
||||
|
@ -207,3 +207,9 @@ fade_dialog_context_changed (FadeDialog *private)
|
|||
gimp_image_flush (private->image);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fade_dialog_free (FadeDialog *private)
|
||||
{
|
||||
g_slice_free (FadeDialog, private);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void image_merge_layers_dialog_free (ImageMergeLayersDialog *dialog);
|
||||
|
||||
|
||||
ImageMergeLayersDialog *
|
||||
image_merge_layers_dialog_new (GimpImage *image,
|
||||
|
@ -52,7 +53,7 @@ image_merge_layers_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
dialog = g_new0 (ImageMergeLayersDialog, 1);
|
||||
dialog = g_slice_new0 (ImageMergeLayersDialog);
|
||||
|
||||
dialog->image = image;
|
||||
dialog->context = context;
|
||||
|
@ -75,7 +76,7 @@ image_merge_layers_dialog_new (GimpImage *image,
|
|||
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) image_merge_layers_dialog_free, dialog);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog),
|
||||
GTK_RESPONSE_OK,
|
||||
|
@ -118,3 +119,9 @@ image_merge_layers_dialog_new (GimpImage *image,
|
|||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
image_merge_layers_dialog_free (ImageMergeLayersDialog *dialog)
|
||||
{
|
||||
g_slice_free (ImageMergeLayersDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -64,8 +64,8 @@ typedef struct
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void image_new_free (ImageNewDialog *dialog);
|
||||
static void image_new_response (GtkWidget *widget,
|
||||
static void image_new_dialog_free (ImageNewDialog *dialog);
|
||||
static void image_new_dialog_response (GtkWidget *widget,
|
||||
gint response_id,
|
||||
ImageNewDialog *dialog);
|
||||
static void image_new_template_changed (GimpContext *context,
|
||||
|
@ -87,7 +87,7 @@ image_new_dialog_new (GimpContext *context)
|
|||
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
dialog = g_new0 (ImageNewDialog, 1);
|
||||
dialog = g_slice_new0 (ImageNewDialog);
|
||||
|
||||
dialog->context = gimp_context_new (context->gimp, "image-new-dialog",
|
||||
context);
|
||||
|
@ -108,10 +108,10 @@ image_new_dialog_new (GimpContext *context)
|
|||
|
||||
g_object_set_data_full (G_OBJECT (dialog->dialog),
|
||||
"gimp-image-new-dialog", dialog,
|
||||
(GDestroyNotify) image_new_free);
|
||||
(GDestroyNotify) image_new_dialog_free);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
G_CALLBACK (image_new_response),
|
||||
G_CALLBACK (image_new_dialog_response),
|
||||
dialog);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog),
|
||||
|
@ -197,17 +197,18 @@ image_new_dialog_set (GtkWidget *widget,
|
|||
/* private functions */
|
||||
|
||||
static void
|
||||
image_new_free (ImageNewDialog *dialog)
|
||||
image_new_dialog_free (ImageNewDialog *dialog)
|
||||
{
|
||||
g_object_unref (dialog->context);
|
||||
g_object_unref (dialog->template);
|
||||
g_free (dialog);
|
||||
|
||||
g_slice_free (ImageNewDialog, dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
image_new_response (GtkWidget *widget,
|
||||
gint response_id,
|
||||
ImageNewDialog *dialog)
|
||||
image_new_dialog_response (GtkWidget *widget,
|
||||
gint response_id,
|
||||
ImageNewDialog *dialog)
|
||||
{
|
||||
switch (response_id)
|
||||
{
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
typedef struct _ImageScaleDialog ImageScaleDialog;
|
||||
|
||||
struct _ImageScaleDialog
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
@ -61,7 +59,8 @@ struct _ImageScaleDialog
|
|||
|
||||
GimpScaleCallback callback;
|
||||
gpointer user_data;
|
||||
};
|
||||
} ImageScaleDialog;
|
||||
|
||||
|
||||
static void image_scale_callback (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
|
@ -74,6 +73,8 @@ static void image_scale_callback (GtkWidget *widget,
|
|||
GimpUnit resolution_unit,
|
||||
gpointer data);
|
||||
|
||||
static void image_scale_dialog_free (ImageScaleDialog *dialog);
|
||||
|
||||
static GtkWidget * image_scale_confirm_dialog (ImageScaleDialog *dialog);
|
||||
static void image_scale_confirm_large (ImageScaleDialog *dialog,
|
||||
gint64 new_memsize,
|
||||
|
@ -101,7 +102,7 @@ image_scale_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
|
||||
dialog = g_new0 (ImageScaleDialog, 1);
|
||||
dialog = g_slice_new0 (ImageScaleDialog);
|
||||
|
||||
dialog->image = image;
|
||||
dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
|
@ -115,7 +116,8 @@ image_scale_dialog_new (GimpImage *image,
|
|||
image_scale_callback,
|
||||
dialog);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog), (GWeakNotify) g_free, dialog);
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) image_scale_dialog_free, dialog);
|
||||
|
||||
dialog->callback = callback;
|
||||
dialog->user_data = user_data;
|
||||
|
@ -187,6 +189,12 @@ image_scale_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
image_scale_dialog_free (ImageScaleDialog *dialog)
|
||||
{
|
||||
g_slice_free (ImageScaleDialog, dialog);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
image_scale_confirm_dialog (ImageScaleDialog *dialog)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@ static gboolean layer_add_mask_dialog_channel_selected (GimpContainerView *vi
|
|||
GimpViewable *viewable,
|
||||
gpointer insert_data,
|
||||
LayerAddMaskDialog *dialog);
|
||||
static void layer_add_mask_dialog_free (LayerAddMaskDialog *dialog);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -69,7 +70,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
|
|||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
dialog = g_new0 (LayerAddMaskDialog, 1);
|
||||
dialog = g_slice_new0 (LayerAddMaskDialog);
|
||||
|
||||
dialog->layer = layer;
|
||||
dialog->add_mask_type = add_mask_type;
|
||||
|
@ -92,7 +93,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
|
|||
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) layer_add_mask_dialog_free, dialog);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog),
|
||||
GTK_RESPONSE_OK,
|
||||
|
@ -161,3 +162,9 @@ layer_add_mask_dialog_channel_selected (GimpContainerView *view,
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
layer_add_mask_dialog_free (LayerAddMaskDialog *dialog)
|
||||
{
|
||||
g_slice_free (LayerAddMaskDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
static void layer_options_dialog_toggle_rename (GtkWidget *widget,
|
||||
LayerOptionsDialog *options);
|
||||
static void layer_options_dialog_free (LayerOptionsDialog *options);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -75,7 +76,7 @@ layer_options_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
options = g_new0 (LayerOptionsDialog, 1);
|
||||
options = g_slice_new0 (LayerOptionsDialog);
|
||||
|
||||
options->image = image;
|
||||
options->context = context;
|
||||
|
@ -249,3 +250,9 @@ layer_options_dialog_toggle_rename (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
layer_options_dialog_free (LayerOptionsDialog *options)
|
||||
{
|
||||
g_slice_free (LayerOptionsDialog, options);
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define RESPONSE_REFRESH 1
|
||||
#define NUM_INFO_LINES 9
|
||||
#define RESPONSE_REFRESH 1
|
||||
#define NUM_INFO_LINES 9
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -50,9 +50,7 @@ enum
|
|||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
typedef struct _ModuleDialog ModuleDialog;
|
||||
|
||||
struct _ModuleDialog
|
||||
typedef struct
|
||||
{
|
||||
Gimp *gimp;
|
||||
|
||||
|
@ -63,7 +61,7 @@ struct _ModuleDialog
|
|||
GtkWidget *label[NUM_INFO_LINES];
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_label;
|
||||
};
|
||||
} ModuleDialog;
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
@ -113,7 +111,7 @@ module_dialog_new (Gimp *gimp)
|
|||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
|
||||
dialog = g_new0 (ModuleDialog, 1);
|
||||
dialog = g_slice_new0 (ModuleDialog);
|
||||
|
||||
dialog->gimp = gimp;
|
||||
|
||||
|
@ -261,7 +259,7 @@ dialog_destroy_callback (GtkWidget *widget,
|
|||
dialog_info_update,
|
||||
dialog);
|
||||
|
||||
g_free (dialog);
|
||||
g_slice_free (ModuleDialog, dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -47,9 +47,7 @@
|
|||
#define FILL_MASK (GIMP_OFFSET_BACKGROUND | GIMP_OFFSET_TRANSPARENT)
|
||||
|
||||
|
||||
typedef struct _OffsetDialog OffsetDialog;
|
||||
|
||||
struct _OffsetDialog
|
||||
typedef struct
|
||||
{
|
||||
GimpContext *context;
|
||||
|
||||
|
@ -59,7 +57,7 @@ struct _OffsetDialog
|
|||
GimpOffsetType fill_type;
|
||||
|
||||
GimpImage *image;
|
||||
};
|
||||
} OffsetDialog;
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
@ -69,6 +67,7 @@ static void offset_response (GtkWidget *widget,
|
|||
OffsetDialog *dialog);
|
||||
static void offset_halfheight_callback (GtkWidget *widget,
|
||||
OffsetDialog *dialog);
|
||||
static void offset_dialog_free (OffsetDialog *dialog);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -94,7 +93,7 @@ offset_dialog_new (GimpDrawable *drawable,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (OffsetDialog, 1);
|
||||
dialog = g_slice_new0 (OffsetDialog);
|
||||
|
||||
dialog->context = context;
|
||||
dialog->fill_type = gimp_drawable_has_alpha (drawable) | WRAP_AROUND;
|
||||
|
@ -133,7 +132,7 @@ offset_dialog_new (GimpDrawable *drawable,
|
|||
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) offset_dialog_free, dialog);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
G_CALLBACK (offset_response),
|
||||
|
@ -293,3 +292,9 @@ offset_halfheight_callback (GtkWidget *widget,
|
|||
1, item->height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
offset_dialog_free (OffsetDialog *dialog)
|
||||
{
|
||||
g_slice_free (OffsetDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -58,9 +58,7 @@ typedef enum
|
|||
} ImportType;
|
||||
|
||||
|
||||
typedef struct _ImportDialog ImportDialog;
|
||||
|
||||
struct _ImportDialog
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
@ -88,7 +86,7 @@ struct _ImportDialog
|
|||
|
||||
GtkWidget *preview;
|
||||
GtkWidget *no_colors_label;
|
||||
};
|
||||
} ImportDialog;
|
||||
|
||||
|
||||
static void palette_import_free (ImportDialog *dialog);
|
||||
|
@ -149,7 +147,7 @@ palette_import_dialog_new (GimpContext *context)
|
|||
|
||||
gradient = gimp_context_get_gradient (context);
|
||||
|
||||
dialog = g_new0 (ImportDialog, 1);
|
||||
dialog = g_slice_new0 (ImportDialog);
|
||||
|
||||
dialog->import_type = GRADIENT_IMPORT;
|
||||
dialog->context = gimp_context_new (context->gimp, "Palette Import",
|
||||
|
@ -437,7 +435,7 @@ palette_import_free (ImportDialog *dialog)
|
|||
|
||||
g_object_unref (dialog->context);
|
||||
|
||||
g_free (dialog);
|
||||
g_slice_free (ImportDialog, dialog);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,9 +41,7 @@
|
|||
#define SB_WIDTH 8
|
||||
|
||||
|
||||
typedef struct _PrintSizeDialog PrintSizeDialog;
|
||||
|
||||
struct _PrintSizeDialog
|
||||
typedef struct
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpSizeEntry *size_entry;
|
||||
|
@ -53,7 +51,7 @@ struct _PrintSizeDialog
|
|||
gdouble yres;
|
||||
GimpResolutionCallback callback;
|
||||
gpointer user_data;
|
||||
};
|
||||
} PrintSizeDialog;
|
||||
|
||||
|
||||
static void print_size_dialog_response (GtkWidget *dialog,
|
||||
|
@ -71,6 +69,7 @@ static void print_size_dialog_set_size (PrintSizeDialog *private,
|
|||
static void print_size_dialog_set_resolution (PrintSizeDialog *private,
|
||||
gdouble xres,
|
||||
gdouble yres);
|
||||
static void print_size_dialog_free (PrintSizeDialog *private);
|
||||
|
||||
|
||||
GtkWidget *
|
||||
|
@ -115,9 +114,10 @@ print_size_dialog_new (GimpImage *image,
|
|||
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
|
||||
private = g_new0 (PrintSizeDialog, 1);
|
||||
private = g_slice_new0 (PrintSizeDialog);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_free, private);
|
||||
g_object_weak_ref (G_OBJECT (dialog),
|
||||
(GWeakNotify) print_size_dialog_free, private);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (print_size_dialog_response),
|
||||
|
@ -428,3 +428,9 @@ print_size_dialog_set_resolution (PrintSizeDialog *private,
|
|||
print_size_dialog_size_changed,
|
||||
private);
|
||||
}
|
||||
|
||||
static void
|
||||
print_size_dialog_free (PrintSizeDialog *private)
|
||||
{
|
||||
g_slice_free (PrintSizeDialog, private);
|
||||
}
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
#define SB_WIDTH 8
|
||||
|
||||
|
||||
typedef struct _ResizeDialog ResizeDialog;
|
||||
|
||||
struct _ResizeDialog
|
||||
typedef struct
|
||||
{
|
||||
GimpViewable *viewable;
|
||||
gint old_width;
|
||||
|
@ -57,13 +55,14 @@ struct _ResizeDialog
|
|||
GimpItemSet layer_set;
|
||||
GimpResizeCallback callback;
|
||||
gpointer user_data;
|
||||
};
|
||||
} ResizeDialog;
|
||||
|
||||
|
||||
static void resize_dialog_response (GtkWidget *dialog,
|
||||
gint response_id,
|
||||
ResizeDialog *private);
|
||||
static void resize_dialog_reset (ResizeDialog *private);
|
||||
static void resize_dialog_free (ResizeDialog *private);
|
||||
|
||||
static void size_notify (GimpSizeBox *box,
|
||||
GParamSpec *pspec,
|
||||
|
@ -154,9 +153,10 @@ resize_dialog_new (GimpViewable *viewable,
|
|||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
|
||||
private = g_new0 (ResizeDialog, 1);
|
||||
private = g_slice_new0 (ResizeDialog);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_free, private);
|
||||
g_object_weak_ref (G_OBJECT (dialog),
|
||||
(GWeakNotify) resize_dialog_free, private);
|
||||
|
||||
private->viewable = viewable;
|
||||
private->old_width = width;
|
||||
|
@ -368,6 +368,12 @@ resize_dialog_reset (ResizeDialog *private)
|
|||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
resize_dialog_free (ResizeDialog *private)
|
||||
{
|
||||
g_slice_free (ResizeDialog, private);
|
||||
}
|
||||
|
||||
static void
|
||||
size_notify (GimpSizeBox *box,
|
||||
GParamSpec *pspec,
|
||||
|
|
|
@ -41,9 +41,7 @@
|
|||
#define RESPONSE_RESET 1
|
||||
|
||||
|
||||
typedef struct _ScaleDialog ScaleDialog;
|
||||
|
||||
struct _ScaleDialog
|
||||
typedef struct
|
||||
{
|
||||
GimpViewable *viewable;
|
||||
GimpUnit unit;
|
||||
|
@ -52,13 +50,14 @@ struct _ScaleDialog
|
|||
GtkWidget *combo;
|
||||
GimpScaleCallback callback;
|
||||
gpointer user_data;
|
||||
};
|
||||
} ScaleDialog;
|
||||
|
||||
|
||||
static void scale_dialog_response (GtkWidget *dialog,
|
||||
gint response_id,
|
||||
ScaleDialog *private);
|
||||
static void scale_dialog_reset (ScaleDialog *private);
|
||||
static void scale_dialog_free (ScaleDialog *private);
|
||||
|
||||
|
||||
GtkWidget *
|
||||
|
@ -133,9 +132,10 @@ scale_dialog_new (GimpViewable *viewable,
|
|||
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
|
||||
private = g_new0 (ScaleDialog, 1);
|
||||
private = g_slice_new0 (ScaleDialog);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_free, private);
|
||||
g_object_weak_ref (G_OBJECT (dialog),
|
||||
(GWeakNotify) scale_dialog_free, private);
|
||||
|
||||
private->viewable = viewable;
|
||||
private->interpolation = interpolation;
|
||||
|
@ -309,3 +309,9 @@ scale_dialog_reset (ScaleDialog *private)
|
|||
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (private->combo),
|
||||
private->interpolation);
|
||||
}
|
||||
|
||||
static void
|
||||
scale_dialog_free (ScaleDialog *private)
|
||||
{
|
||||
g_slice_free (ScaleDialog, private);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void template_options_dialog_free (TemplateOptionsDialog *dialog);
|
||||
|
||||
|
||||
TemplateOptionsDialog *
|
||||
template_options_dialog_new (GimpTemplate *template,
|
||||
|
@ -64,7 +65,7 @@ template_options_dialog_new (GimpTemplate *template,
|
|||
g_return_val_if_fail (desc != NULL, NULL);
|
||||
g_return_val_if_fail (help_id != NULL, NULL);
|
||||
|
||||
options = g_new0 (TemplateOptionsDialog, 1);
|
||||
options = g_slice_new0 (TemplateOptionsDialog);
|
||||
|
||||
options->gimp = context->gimp;
|
||||
options->template = template;
|
||||
|
@ -99,7 +100,7 @@ template_options_dialog_new (GimpTemplate *template,
|
|||
-1);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||
(GWeakNotify) g_free, options);
|
||||
(GWeakNotify) template_options_dialog_free, options);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 12);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||
|
@ -114,3 +115,9 @@ template_options_dialog_new (GimpTemplate *template,
|
|||
|
||||
return options;
|
||||
}
|
||||
|
||||
static void
|
||||
template_options_dialog_free (TemplateOptionsDialog *dialog)
|
||||
{
|
||||
g_slice_free (TemplateOptionsDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void vectors_export_dialog_free (VectorsExportDialog *dialog);
|
||||
|
||||
|
||||
VectorsExportDialog *
|
||||
vectors_export_dialog_new (GimpImage *image,
|
||||
|
@ -45,7 +46,7 @@ vectors_export_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (VectorsExportDialog, 1);
|
||||
dialog = g_slice_new0 (VectorsExportDialog);
|
||||
|
||||
dialog->image = image;
|
||||
dialog->active_only = active_only;
|
||||
|
@ -76,7 +77,7 @@ vectors_export_dialog_new (GimpImage *image,
|
|||
gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) vectors_export_dialog_free, dialog);
|
||||
|
||||
g_signal_connect_object (image, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
|
@ -99,3 +100,9 @@ vectors_export_dialog_new (GimpImage *image,
|
|||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
vectors_export_dialog_free (VectorsExportDialog *dialog)
|
||||
{
|
||||
g_slice_free (VectorsExportDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void vectors_import_dialog_free (VectorsImportDialog *dialog);
|
||||
|
||||
|
||||
VectorsImportDialog *
|
||||
vectors_import_dialog_new (GimpImage *image,
|
||||
|
@ -47,7 +48,7 @@ vectors_import_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (VectorsImportDialog, 1);
|
||||
dialog = g_slice_new0 (VectorsImportDialog);
|
||||
|
||||
dialog->image = image;
|
||||
dialog->merge_vectors = merge_vectors;
|
||||
|
@ -77,7 +78,7 @@ vectors_import_dialog_new (GimpImage *image,
|
|||
GTK_RESPONSE_OK);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog->dialog),
|
||||
(GWeakNotify) g_free, dialog);
|
||||
(GWeakNotify) vectors_import_dialog_free, dialog);
|
||||
|
||||
g_signal_connect_object (image, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
|
@ -127,3 +128,9 @@ vectors_import_dialog_new (GimpImage *image,
|
|||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
vectors_import_dialog_free (VectorsImportDialog *dialog)
|
||||
{
|
||||
g_slice_free (VectorsImportDialog, dialog);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
static void vectors_options_dialog_free (VectorsOptionsDialog *dialog);
|
||||
|
||||
|
||||
VectorsOptionsDialog *
|
||||
vectors_options_dialog_new (GimpImage *image,
|
||||
|
@ -68,7 +69,7 @@ vectors_options_dialog_new (GimpImage *image,
|
|||
g_return_val_if_fail (desc != NULL, NULL);
|
||||
g_return_val_if_fail (help_id != NULL, NULL);
|
||||
|
||||
options = g_new0 (VectorsOptionsDialog, 1);
|
||||
options = g_slice_new0 (VectorsOptionsDialog);
|
||||
|
||||
options->image = image;
|
||||
options->vectors = vectors;
|
||||
|
@ -96,8 +97,7 @@ vectors_options_dialog_new (GimpImage *image,
|
|||
-1);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->dialog),
|
||||
(GWeakNotify) g_free,
|
||||
options);
|
||||
(GWeakNotify) vectors_options_dialog_free, options);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 12);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
|
||||
|
@ -125,3 +125,9 @@ vectors_options_dialog_new (GimpImage *image,
|
|||
|
||||
return options;
|
||||
}
|
||||
|
||||
static void
|
||||
vectors_options_dialog_free (VectorsOptionsDialog *dialog)
|
||||
{
|
||||
g_slice_free (VectorsOptionsDialog, dialog);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue