2000-01-11 23:48:00 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
1999-05-29 09:28:24 +08:00
|
|
|
#include <string.h>
|
1999-12-29 03:31:24 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include <libgimp/gimp.h>
|
|
|
|
#include <libgimp/gimpui.h>
|
|
|
|
|
1999-12-28 00:18:06 +08:00
|
|
|
#include "libgimp/stdplugins-intl.h"
|
1999-12-29 03:31:24 +08:00
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
#include "fp.h"
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
AdvancedWindow AW = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
extern FP_Params Current;
|
|
|
|
|
|
|
|
extern GDrawable *drawable, *mask;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
FP_Intensity ShMidHi[] = { SHADOWS, MIDTONES, HIGHLIGHTS };
|
|
|
|
int HueSatVal[] = { BY_HUE, BY_SAT, BY_VAL };
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
gint nudgeArray[256];
|
|
|
|
|
|
|
|
GtkWidget *origPreview, *curPreview;
|
|
|
|
GtkWidget *rPreview, *gPreview, *bPreview;
|
|
|
|
GtkWidget *cPreview, *yPreview, *mPreview;
|
|
|
|
GtkWidget *centerPreview;
|
|
|
|
GtkWidget *darkerPreview, *lighterPreview, *middlePreview;
|
|
|
|
GtkWidget *allOrSell, *dlg;
|
|
|
|
GtkWidget *plusSatPreview, *SatPreview, *minusSatPreview;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *bna,
|
|
|
|
*palette,
|
|
|
|
*rough,
|
|
|
|
*range,
|
|
|
|
*show,
|
|
|
|
*lnd,
|
|
|
|
*pixelsBy,
|
1998-07-14 14:15:10 +08:00
|
|
|
*frameSelect,
|
|
|
|
*satur;
|
|
|
|
} fpFrames;
|
|
|
|
|
|
|
|
fpInterface FPint =
|
|
|
|
{
|
|
|
|
FALSE /* run */
|
|
|
|
};
|
|
|
|
ReducedImage *reduced;
|
|
|
|
|
|
|
|
/***********************************************************/
|
|
|
|
/************ Main Dialog Window ******************/
|
|
|
|
/***********************************************************/
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_bna (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *blabel, *alabel, *bframe, *aframe, *table;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Preview (&origPreview, &bframe, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&curPreview, &aframe, reduced->width, reduced->height);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
frame = gtk_frame_new (_("Before and After"));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
|
|
|
|
/* All the previews */
|
2000-01-11 23:48:00 +08:00
|
|
|
alabel = gtk_label_new (_("Current:"));
|
|
|
|
gtk_widget_show (alabel);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (alabel), 0.0, 0.5);
|
|
|
|
|
|
|
|
blabel = gtk_label_new (_("Original:"));
|
|
|
|
gtk_widget_show (blabel);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (blabel), 0.0, 0.5);
|
|
|
|
|
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), blabel, 0, 1, 0, 1,
|
|
|
|
0, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), alabel, 1, 2, 0, 1,
|
|
|
|
0, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), bframe, 0, 1, 1, 2,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), aframe, 1, 2, 1, 2,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
|
|
|
|
gtk_widget_show (table);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (frame);
|
2000-01-11 23:48:00 +08:00
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
/* close a sub dialog (from window manager) by simulating toggle click */
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
sub_dialog_destroy (GtkWidget *dialog,
|
|
|
|
GdkEvent *ev,
|
|
|
|
gpointer dummy)
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *button =
|
|
|
|
GTK_WIDGET (gtk_object_get_data (GTK_OBJECT (dialog), "ctrlButton"));
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (button), "clicked", dialog);
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_circle_palette (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *table;
|
|
|
|
GtkWidget *rVbox, *rFrame;
|
|
|
|
GtkWidget *gVbox, *gFrame;
|
|
|
|
GtkWidget *bVbox, *bFrame;
|
|
|
|
GtkWidget *cVbox, *cFrame;
|
|
|
|
GtkWidget *yVbox, *yFrame;
|
|
|
|
GtkWidget *mVbox, *mFrame;
|
|
|
|
GtkWidget *centerVbox, *centerFrame;
|
|
|
|
|
|
|
|
GtkWidget *win;
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
1999-12-28 00:18:06 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (frame), 4);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (11, 11, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Preview (&rPreview, &rFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&gPreview, &gFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&bPreview, &bFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&cPreview, &cFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&yPreview, &yFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&mPreview, &mFrame, reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (¢erPreview, ¢erFrame,
|
|
|
|
reduced->width, reduced->height);
|
|
|
|
|
|
|
|
Create_A_Table_Entry (&rVbox, rFrame, _("Red:"));
|
|
|
|
Create_A_Table_Entry (&gVbox, gFrame, _("Green:"));
|
|
|
|
Create_A_Table_Entry (&bVbox, bFrame, _("Blue:"));
|
|
|
|
Create_A_Table_Entry (&cVbox, cFrame, _("Cyan:"));
|
|
|
|
Create_A_Table_Entry (&yVbox, yFrame, _("Yellow:"));
|
|
|
|
Create_A_Table_Entry (&mVbox, mFrame, _("Magenta:"));
|
|
|
|
Create_A_Table_Entry (¢erVbox, centerFrame, _("Current:"));
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), rVbox, 8, 11 ,4 , 7,
|
|
|
|
GTK_EXPAND , GTK_EXPAND, 0 ,0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), gVbox, 2, 5, 0, 3,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), bVbox, 2, 5, 8, 11,
|
1998-07-14 14:15:10 +08:00
|
|
|
GTK_EXPAND, GTK_EXPAND,0,0);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), cVbox, 0, 3, 4, 7,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0 ,0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), yVbox, 6, 9, 0, 3,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0 ,0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), mVbox, 6, 9, 8, 11,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0 ,0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), centerVbox, 4, 7, 4, 7,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0 ,0);
|
|
|
|
|
|
|
|
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
|
|
|
|
|
|
gimp_help_connect_help_accel (win, gimp_plugin_help_func, "filters/fp.html");
|
|
|
|
|
|
|
|
gtk_window_set_title (GTK_WINDOW (win), _("Hue Variations"));
|
|
|
|
gtk_container_add (GTK_CONTAINER (win), frame);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (win), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (sub_dialog_destroy),
|
|
|
|
NULL);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_rough (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *scale, *vbox;
|
|
|
|
GtkObject *data;
|
|
|
|
|
1999-12-28 00:18:06 +08:00
|
|
|
frame = gtk_frame_new (_("Roughness"));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
data = gtk_adjustment_new (Current.Rough, 0, 1.0, 0.05, 0.01, 0.0);
|
|
|
|
Current.roughnessScale = scale = gtk_hscale_new (GTK_ADJUSTMENT (data));
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_set_usize (scale, 60, 0);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
|
|
|
|
gtk_scale_set_digits (GTK_SCALE (scale), 2);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (data), "value_changed",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (fp_scale_update),
|
1998-07-14 14:15:10 +08:00
|
|
|
&Current.Rough);
|
|
|
|
gtk_widget_show (scale);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_container_add (GTK_CONTAINER( frame), vbox);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_range (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *vbox;
|
|
|
|
GSList *group=NULL;
|
|
|
|
|
1999-12-28 00:18:06 +08:00
|
|
|
frame = gtk_frame_new (_("Affected Range"));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
group = Button_In_A_Box (vbox, group, _("Shadows"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_range),
|
|
|
|
ShMidHi + SHADOWS,
|
|
|
|
Current.Range == SHADOWS);
|
|
|
|
group = Button_In_A_Box (vbox, group, _("Midtones"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_range),
|
|
|
|
ShMidHi + MIDTONES,
|
|
|
|
Current.Range == MIDTONES);
|
|
|
|
group=Button_In_A_Box (vbox, group, _("Highlights"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_range),
|
|
|
|
ShMidHi + HIGHLIGHTS,
|
|
|
|
Current.Range == HIGHLIGHTS);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_control (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *box;
|
|
|
|
|
1999-12-28 00:18:06 +08:00
|
|
|
frame = gtk_frame_new (_("Windows"));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
box = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), box);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (box), 4);
|
|
|
|
gtk_widget_show (box);
|
|
|
|
|
|
|
|
Frames_Check_Button_In_A_Box (box, _("Hue"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.palette,
|
|
|
|
Current.VisibleFrames & HUE);
|
|
|
|
Frames_Check_Button_In_A_Box (box, _("Saturation"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.satur,
|
|
|
|
Current.VisibleFrames & SATURATION);
|
|
|
|
Frames_Check_Button_In_A_Box (box, _("Value"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.lnd,
|
|
|
|
Current.VisibleFrames & VALUE);
|
|
|
|
Frames_Check_Button_In_A_Box (box, _("Advanced"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
AW.window,
|
|
|
|
FALSE);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_lnd (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *table, *lighterFrame, *middleFrame, *darkerFrame;
|
|
|
|
GtkWidget *lighterVbox, *middleVbox, *darkerVbox;
|
|
|
|
GtkWidget *win;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Preview (&lighterPreview, &lighterFrame,
|
|
|
|
reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&middlePreview, &middleFrame,
|
|
|
|
reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&darkerPreview, &darkerFrame,
|
|
|
|
reduced->width, reduced->height);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Table_Entry (&lighterVbox, lighterFrame, _("Lighter:"));
|
|
|
|
Create_A_Table_Entry (&middleVbox, middleFrame, _("Current:"));
|
|
|
|
Create_A_Table_Entry (&darkerVbox, darkerFrame, _("Darker:"));
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (frame), 6);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (1, 11, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), lighterVbox, 0, 3, 0, 1,
|
|
|
|
GTK_EXPAND , GTK_EXPAND, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), middleVbox, 4, 7, 0, 1,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), darkerVbox, 8, 11, 0, 1,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
|
|
|
|
|
|
gimp_help_connect_help_accel (win, gimp_plugin_help_func, "filters/fp.html");
|
|
|
|
|
|
|
|
gtk_window_set_title (GTK_WINDOW (win), _("Value Variations"));
|
|
|
|
gtk_container_add (GTK_CONTAINER (win), frame);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (win), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (sub_dialog_destroy),
|
|
|
|
NULL);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_msnls (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *table, *lessFrame, *middleFrame, *moreFrame;
|
|
|
|
GtkWidget *lessVbox, *middleVbox, *moreVbox;
|
|
|
|
GtkWidget *win;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Preview (&minusSatPreview, &lessFrame,
|
|
|
|
reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&SatPreview, &middleFrame,
|
|
|
|
reduced->width, reduced->height);
|
|
|
|
Create_A_Preview (&plusSatPreview, &moreFrame,
|
|
|
|
reduced->width, reduced->height);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Create_A_Table_Entry (&moreVbox, moreFrame, _("More Sat:"));
|
|
|
|
Create_A_Table_Entry (&middleVbox, middleFrame, _("Current:"));
|
|
|
|
Create_A_Table_Entry (&lessVbox, lessFrame, _("Less Sat:"));
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
1999-12-28 00:18:06 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (frame), 4);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (1, 11, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), moreVbox, 0, 3, 0, 1,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), middleVbox, 4, 7, 0, 1,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), lessVbox, 8, 11, 0, 1,
|
|
|
|
GTK_EXPAND, GTK_EXPAND, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
|
|
|
|
|
|
gimp_help_connect_help_accel (win, gimp_plugin_help_func, "filters/fp.html");
|
|
|
|
|
|
|
|
gtk_window_set_title (GTK_WINDOW (win), _("Saturation Variations"));
|
|
|
|
gtk_container_add (GTK_CONTAINER (win), frame);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (win), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (sub_dialog_destroy),
|
|
|
|
NULL);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_pixels_select_by (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *vbox;
|
|
|
|
GSList *group=NULL;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
frame = gtk_frame_new (_("Select Pixels by"));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
group = Button_In_A_Box (vbox, group, _("Hue"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
|
|
|
|
HueSatVal + 0,
|
|
|
|
Current.ValueBy == BY_HUE);
|
|
|
|
group = Button_In_A_Box (vbox,group, _("Saturation"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
|
|
|
|
HueSatVal + 1,
|
|
|
|
Current.ValueBy == BY_SAT);
|
|
|
|
group = Button_In_A_Box (vbox,group, _("Value"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
|
|
|
|
HueSatVal + 2,
|
|
|
|
Current.ValueBy == BY_VAL);
|
1998-07-14 14:15:10 +08:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_show (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *vbox;
|
2000-01-11 23:48:00 +08:00
|
|
|
GSList *group = NULL;
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
frame = gtk_frame_new(_("Show"));
|
|
|
|
gtk_widget_show (frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_widget_show (vbox);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
group = Button_In_A_Box (vbox, group, _("Entire Image"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_entire_image),
|
|
|
|
&Current.SlctnOnly,
|
|
|
|
FALSE);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
group = Button_In_A_Box (vbox, group, _("Selection Only"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_selection_only),
|
|
|
|
&Current.SlctnOnly,
|
|
|
|
TRUE);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
group = Button_In_A_Box (vbox, group, _("Selection In Context"),
|
|
|
|
GTK_SIGNAL_FUNC (fp_selection_in_context),
|
|
|
|
&Current.SlctnOnly,
|
|
|
|
FALSE);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
|
|
|
|
#ifdef __FP_UNUSED_STUFF__
|
2000-01-11 23:48:00 +08:00
|
|
|
GtkWidget *
|
|
|
|
fp_create_frame_select (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *frame, *box;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
frame = gtk_frame_new (_("Display"));
|
1999-12-28 00:18:06 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (frame), 4);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
box = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), box);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (box),4);
|
|
|
|
gtk_widget_show (box);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
1999-12-28 00:18:06 +08:00
|
|
|
Check_Button_In_A_Box (box, _("CirclePalette"),
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.palette,TRUE);
|
1999-12-28 00:18:06 +08:00
|
|
|
Check_Button_In_A_Box (box, _("Lighter And Darker"),
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.lnd,TRUE);
|
1999-12-28 00:18:06 +08:00
|
|
|
Check_Button_In_A_Box (box, _("Saturation"),
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (fp_show_hide_frame),
|
|
|
|
fpFrames.satur,FALSE);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
return frame;
|
|
|
|
}
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
#endif
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void Create_A_Preview (GtkWidget **preview,
|
|
|
|
GtkWidget **frame,
|
|
|
|
int previewWidth,
|
|
|
|
int previewHeight)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
*frame = gtk_frame_new (NULL);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (*frame), GTK_SHADOW_IN);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (*frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
*preview = gtk_preview_new (Current.Color ?
|
|
|
|
GTK_PREVIEW_COLOR : GTK_PREVIEW_GRAYSCALE);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (*preview), previewWidth, previewHeight);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (*preview);
|
|
|
|
gtk_container_add (GTK_CONTAINER (*frame), *preview);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
GSList *
|
|
|
|
Button_In_A_Box (GtkWidget *vbox,
|
|
|
|
GSList *group,
|
|
|
|
guchar *label,
|
|
|
|
GtkSignalFunc function,
|
|
|
|
gpointer data,
|
|
|
|
gboolean clicked)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *button;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
button = gtk_radio_button_new_with_label (group, label);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (function),
|
1998-07-14 14:15:10 +08:00
|
|
|
data);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (button);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
if (clicked)
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_button_clicked (GTK_BUTTON (button));
|
|
|
|
|
|
|
|
return gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
Check_Button_In_A_Box (GtkWidget *vbox,
|
|
|
|
guchar *label,
|
|
|
|
GtkSignalFunc function,
|
|
|
|
gpointer data,
|
|
|
|
gboolean clicked)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
button = gtk_check_button_new_with_label (label);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (function),
|
1998-07-14 14:15:10 +08:00
|
|
|
data);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clicked);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (button);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
Frames_Check_Button_In_A_Box (GtkWidget *vbox,
|
|
|
|
guchar *label,
|
|
|
|
GtkSignalFunc function,
|
|
|
|
GtkWidget *frame,
|
|
|
|
gboolean clicked)
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
button = gtk_check_button_new_with_label (label);
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (function),
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
frame);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clicked);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (frame), "ctrlButton", (gpointer) button);
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (button);
|
applied gimp-lecorfec-99041[02]-0, changes follow
* applied gimp-lecorfec-99041[02]-0, changes follow
* plug-ins/FractalExplorer/Dialogs.h (make_color_map):
replaced free with g_free to fix segfault.
* plug-ins/Lighting/lighting_preview.c (compute_preview):
allocate xpostab and ypostab only when needed (it could also be
allocated on stack with a compilation-fixed size like MapObject).
It avoids to lose some Kb on each preview :)
Also reindented (unfortunate C-c C-q) some other lines.
* plug-ins/Lighting/lighting_main.c (run):
release allocated postabs.
* plug-ins/Lighting/lighting_ui.c:
callbacks now have only one argument because gck widget use
gtk_signal_connect_object. Caused segfault for scale widget.
* plug-ins/autocrop/autocrop.c (doit):
return if image has only background (thus fixing a segfault).
* plug-ins/emboss/emboss.c (pluginCore, emboss_do_preview):
replaced malloc/free with g_malloc/g_free (unneeded, but
shouldn't everyone use glib calls ? :)
* plug-ins/flame/flame.c :
replaced a segfaulting free, and several harmless malloc/free pairs.
* plug-ins/flame/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/fractaltrace/fractaltrace.c (pixels_free):
replaced a bunch of segfaulting free.
(pixels_get, dialog_show): replaced gtk_signal_connect_object
with gtk_signal_connect to accomodate callbacks (caused STRANGE
dialog behaviour, coz you destroyed buttons one by one).
* plug-ins/illusion/illusion.c (dialog):
same gtk_signal_connect_object replacement for same reasons.
* plug-ins/libgck/gck/gckcolor.c :
changed all gck_rgb_to_color* functions to use a static GdkColor
instead of a malloc'ed area. Provided reentrant functions with
the old behaviour (gck_rgb_to_color*_r). Made some private functions
static, too.
gck_rgb_to_gdkcolor now use the new functions while
gck_rgb_to_gdkcolor_r is the reentrant version.
Also affected by this change: gck_gc_set_foreground and
gck_gc_set_background (no more free(color)).
* plug-ins/libgck/gck/gckcolor.h :
added the gck_rgb_to_gdkcolor_r proto.
* plug-ins/lic/lic.c (ok_button_clicked, cancel_button_clicked) :
segfault on gtk_widget_destroy, now calls gtk_main_quit.
(dialog_destroy) : segfault on window closure when called by
"destroy" event. Now called by "delete_event".
* plug-ins/megawidget/megawidget.c (mw_preview_build):
replaced harmless malloc/free pair.
Note : mwp->bits is malloc'ed but seems to be never freed.
* plug-ins/png/png.c (load_image):
replaced 2 segfaulting free.
* plug-ins/print/print-ps.c (ps_print):
replaced a segfaulting free (called many times :).
* plug-ins/sgi/sgi.c (load_image, save_image):
replaced a bunch of segfaulting free, and did some harmless
inits to avoid a few gcc warnings.
* plug-ins/wind/wind.c (render_wind):
replaced a segfaulting free.
(render_blast): replaced harmless malloc/free pair.
* plug-ins/bmp/bmpread.c (ReadImage):
yet another free()/g_free() problem fixed.
* plug-ins/exchange/exchange.c (real_exchange):
ditto.
* plug-ins/fp/fp.h: added Frames_Check_Button_In_A_Box proto.
* plug-ins/fp/fp_gtk.c: closing subdialogs via window manager
wasn't handled, thus leading to errors and crashes.
Now delete_event signals the dialog control button
to close a dialog with the good way.
* plug-ins/ifscompose/ifscompose.c (value_pair_create):
tried to set events mask on scale widget (a NO_WINDOW widget).
* plug-ins/png/png.c (save_image):
Replaced 2 free() with g_free() for g_malloc'ed memory.
Mysteriously I corrected the loading bug but not the saving one :)
-Yosh
1999-04-16 05:49:09 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
Create_A_Table_Entry (GtkWidget **box,
|
|
|
|
GtkWidget *SmallerFrame,
|
|
|
|
gchar *description)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *label, *button, *table;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
*box = gtk_vbox_new (FALSE, 1);
|
|
|
|
gtk_container_border_width (GTK_CONTAINER (*box), PR_BX_BRDR);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (*box);
|
2000-01-11 23:48:00 +08:00
|
|
|
label = gtk_label_new (description);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (2, 1, FALSE);
|
|
|
|
gtk_widget_show (table);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (*box), table, TRUE, TRUE, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
|
|
|
0, 0, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
if (strcmp (description, "Current:"))
|
|
|
|
{
|
|
|
|
button = gtk_button_new ();
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
GTK_SIGNAL_FUNC (selectionMade),
|
|
|
|
description);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), SmallerFrame);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2,
|
|
|
|
0, 0, 0, 4);
|
|
|
|
}
|
1998-07-14 14:15:10 +08:00
|
|
|
else
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), SmallerFrame, 0, 1, 1, 2,
|
|
|
|
0, 0, 0, 4);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_redraw_all_windows (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
reduced = Reduce_The_Image (drawable,mask,
|
|
|
|
Current.PreviewSize,
|
|
|
|
Current.SlctnOnly);
|
|
|
|
Adjust_Preview_Sizes (reduced->width, reduced->height);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
/*gtk_container_check_resize(GTK_CONTAINER(fpFrames.palette), NULL);*/
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_draw (fpFrames.palette, NULL);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
/*gtk_container_check_resize(GTK_CONTAINER(fpFrames.satur), NULL);*/
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_draw (fpFrames.satur, NULL);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
/*gtk_container_check_resize(GTK_CONTAINER(fpFrames.lnd), NULL);*/
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_draw (fpFrames.lnd, NULL);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
/*gtk_container_check_resize(GTK_CONTAINER(dlg), NULL);*/
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_draw (dlg, NULL);
|
|
|
|
|
|
|
|
refreshPreviews (Current.VisibleFrames);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_entire_image (GtkWidget *button,
|
|
|
|
gpointer data)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
if (!GTK_TOGGLE_BUTTON (button)->active)
|
1998-07-14 14:15:10 +08:00
|
|
|
return;
|
|
|
|
Current.SlctnOnly = 0;
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_redraw_all_windows ();
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_selection_only (GtkWidget *button,
|
|
|
|
gpointer data)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
static int notFirstTime = 0;
|
|
|
|
|
|
|
|
if (!(notFirstTime++))
|
|
|
|
return;
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
if (!GTK_TOGGLE_BUTTON (button)->active)
|
1998-07-14 14:15:10 +08:00
|
|
|
return;
|
|
|
|
Current.SlctnOnly = 1;
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_redraw_all_windows ();
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_selection_in_context (GtkWidget *button,
|
|
|
|
gpointer data)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
if (!GTK_TOGGLE_BUTTON (button)->active)
|
1998-07-14 14:15:10 +08:00
|
|
|
return;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
Current.SlctnOnly = 2;
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_redraw_all_windows ();
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
fp_show_hide_frame (GtkWidget *button,
|
|
|
|
GtkWidget *frame)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
int prev = Current.VisibleFrames;
|
|
|
|
|
|
|
|
if (frame == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (button)->active)
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_VISIBLE (frame))
|
|
|
|
{
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
if (frame==fpFrames.palette)
|
|
|
|
Current.VisibleFrames |= HUE;
|
|
|
|
else if (frame==fpFrames.satur)
|
|
|
|
Current.VisibleFrames |= SATURATION;
|
|
|
|
else if (frame==fpFrames.lnd)
|
|
|
|
Current.VisibleFrames |= VALUE;
|
|
|
|
|
|
|
|
refreshPreviews (Current.VisibleFrames & ~prev);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_VISIBLE (frame))
|
|
|
|
{
|
|
|
|
gtk_widget_hide (frame);
|
|
|
|
|
|
|
|
if (frame==fpFrames.palette)
|
|
|
|
Current.VisibleFrames &= ~HUE;
|
|
|
|
else if (frame==fpFrames.satur)
|
|
|
|
Current.VisibleFrames &= ~SATURATION;
|
|
|
|
else if (frame==fpFrames.lnd)
|
|
|
|
Current.VisibleFrames &= ~VALUE;
|
|
|
|
}
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
Adjust_Preview_Sizes (gint width,
|
|
|
|
gint height)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (origPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (curPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (rPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (gPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (bPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (cPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (yPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (mPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (centerPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (lighterPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (darkerPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (middlePreview), width, height);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (minusSatPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (SatPreview), width, height);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (plusSatPreview), width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
selectionMade (GtkWidget *widget,
|
|
|
|
gpointer data)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
Current.Touched[Current.ValueBy] = 1;
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
if (!strcmp ("Red:", data)) Update_Current_FP (HUE, RED);
|
|
|
|
else if (!strcmp ("Green:", data)) Update_Current_FP (HUE, GREEN);
|
|
|
|
else if (!strcmp ("Blue:", data)) Update_Current_FP (HUE, BLUE);
|
|
|
|
else if (!strcmp ("Cyan:", data)) Update_Current_FP (HUE, CYAN);
|
|
|
|
else if (!strcmp ("Yellow:", data)) Update_Current_FP (HUE, YELLOW);
|
|
|
|
else if (!strcmp ("Magenta:", data)) Update_Current_FP (HUE, MAGENTA);
|
|
|
|
else if (!strcmp ("Darker:", data)) Update_Current_FP (VALUE, DOWN);
|
|
|
|
else if (!strcmp ("Lighter:", data)) Update_Current_FP (VALUE, UP);
|
|
|
|
else if (!strcmp ("More Sat:", data))
|
|
|
|
Update_Current_FP (SATURATION, UP);
|
|
|
|
else if (!strcmp ("Less Sat:", data))
|
|
|
|
Update_Current_FP (SATURATION, DOWN );
|
|
|
|
|
|
|
|
refreshPreviews (Current.VisibleFrames);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
refreshPreviews (gint which)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_Create_Nudge (nudgeArray);
|
|
|
|
fp_render_preview (origPreview, NONEATALL, 0);
|
|
|
|
fp_render_preview (curPreview, CURRENT, 0);
|
|
|
|
if (which & HUE)
|
|
|
|
{
|
|
|
|
fp_render_preview (rPreview, HUE, RED);
|
|
|
|
fp_render_preview (gPreview, HUE, GREEN);
|
|
|
|
fp_render_preview (bPreview, HUE, BLUE);
|
|
|
|
fp_render_preview (cPreview, HUE, CYAN);
|
|
|
|
fp_render_preview (yPreview, HUE, YELLOW);
|
|
|
|
fp_render_preview (mPreview, HUE, MAGENTA);
|
|
|
|
fp_render_preview (centerPreview, CURRENT, 0);
|
|
|
|
}
|
|
|
|
if (which & VALUE)
|
|
|
|
{
|
|
|
|
fp_render_preview (lighterPreview, VALUE, UP);
|
|
|
|
fp_render_preview (middlePreview, CURRENT, 0);
|
|
|
|
fp_render_preview (darkerPreview, VALUE, DOWN);
|
|
|
|
}
|
|
|
|
if (which & SATURATION)
|
|
|
|
{
|
|
|
|
fp_render_preview (plusSatPreview, SATURATION, UP);
|
|
|
|
fp_render_preview (SatPreview, CURRENT, 0);
|
|
|
|
fp_render_preview (minusSatPreview, SATURATION, DOWN);
|
|
|
|
}
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
fp_ok_callback (GtkWidget *widget,
|
2000-01-11 23:48:00 +08:00
|
|
|
gpointer data)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
FPint.run = TRUE;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_destroy (GTK_WIDGET (data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
fp_scale_update (GtkAdjustment *adjustment,
|
|
|
|
float *scale_val)
|
|
|
|
{
|
|
|
|
static float prevValue=.25;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
*scale_val = adjustment->value;
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
if (prevValue != adjustment->value)
|
|
|
|
{
|
|
|
|
fp_Create_Nudge (nudgeArray);
|
|
|
|
refreshPreviews (Current.VisibleFrames);
|
|
|
|
if (AW.window != NULL && GTK_WIDGET_VISIBLE (AW.window))
|
|
|
|
fp_create_smoothness_graph (AW.aliasingPreview);
|
|
|
|
prevValue = adjustment->value;
|
|
|
|
}
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_change_current_range (GtkAdjustment *button,
|
|
|
|
gint *Intensity)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
static FP_Intensity prevValue=MIDTONES;
|
|
|
|
static int notFirstTime=0;
|
|
|
|
|
|
|
|
if (!(notFirstTime++)) return;
|
2000-01-11 23:48:00 +08:00
|
|
|
if (!GTK_TOGGLE_BUTTON (button)->active) return;
|
1998-07-14 14:15:10 +08:00
|
|
|
if (*Intensity == prevValue) return;
|
|
|
|
|
|
|
|
Current.Range = *Intensity;
|
2000-01-11 23:48:00 +08:00
|
|
|
refreshPreviews (Current.VisibleFrames);
|
1998-07-14 14:15:10 +08:00
|
|
|
if (AW.window != NULL && GTK_WIDGET_VISIBLE (AW.window))
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_create_smoothness_graph (AW.aliasingPreview);
|
1998-07-14 14:15:10 +08:00
|
|
|
prevValue = *Intensity;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_change_current_pixels_by (GtkWidget *button,
|
|
|
|
gint *valueBy)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
int prevValue=VALUE;
|
|
|
|
static int notFirstTime=0;
|
|
|
|
|
|
|
|
if (!(notFirstTime++)) return;
|
|
|
|
if (!GTK_TOGGLE_BUTTON(button)->active) return;
|
|
|
|
if (*valueBy == prevValue) return;
|
|
|
|
|
|
|
|
Current.ValueBy = *valueBy;
|
2000-01-11 23:48:00 +08:00
|
|
|
refreshPreviews (Current.VisibleFrames);
|
|
|
|
if (AW.window != NULL &&
|
|
|
|
GTK_WIDGET_VISIBLE (AW.window) &&
|
|
|
|
AW.rangePreview != NULL)
|
|
|
|
fp_range_preview_spill (AW.rangePreview,Current.ValueBy);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
prevValue = *valueBy;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_advanced_call (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
if (AW.window!=NULL)
|
2000-01-11 23:48:00 +08:00
|
|
|
if (GTK_WIDGET_VISIBLE (AW.window))
|
|
|
|
gtk_widget_hide (AW.window);
|
1998-07-14 14:15:10 +08:00
|
|
|
else
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_show (AW.window);
|
1998-07-14 14:15:10 +08:00
|
|
|
else
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_advanced_dialog ();
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
int
|
|
|
|
fp_dialog (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
|
|
|
GtkWidget *bna;
|
|
|
|
GtkWidget *palette;
|
|
|
|
GtkWidget *lnd;
|
|
|
|
GtkWidget *show;
|
|
|
|
GtkWidget *rough;
|
|
|
|
GtkWidget *range;
|
|
|
|
GtkWidget *pixelsBy;
|
|
|
|
GtkWidget *satur;
|
|
|
|
GtkWidget *control;
|
|
|
|
|
|
|
|
GtkWidget *table;
|
|
|
|
|
|
|
|
guchar *color_cube;
|
|
|
|
gchar **argv;
|
2000-01-11 23:48:00 +08:00
|
|
|
gint argc;
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
reduced = Reduce_The_Image (drawable,mask,
|
|
|
|
Current.PreviewSize,
|
|
|
|
Current.SlctnOnly);
|
|
|
|
argc = 1;
|
|
|
|
argv = g_new (gchar *, 1);
|
1998-07-14 14:15:10 +08:00
|
|
|
argv[0] = g_strdup ("fp");
|
|
|
|
|
|
|
|
gtk_init (&argc, &argv);
|
|
|
|
gtk_rc_parse (gimp_gtkrc ());
|
|
|
|
|
|
|
|
gtk_preview_set_gamma (gimp_gamma ());
|
|
|
|
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
|
|
|
color_cube = gimp_color_cube ();
|
|
|
|
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
|
|
|
color_cube[2], color_cube[3]);
|
|
|
|
|
|
|
|
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
|
|
|
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
|
|
|
|
|
|
|
/********************************************************************/
|
|
|
|
/************************* All the Standard Stuff *******************/
|
2000-01-11 23:48:00 +08:00
|
|
|
dlg = gimp_dialog_new (_("Filter Pack Simulation"), "fp",
|
|
|
|
gimp_plugin_help_func, "filters/fp.html",
|
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, TRUE, FALSE,
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
_("OK"), fp_ok_callback,
|
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
|
|
|
_("Reset"), resetFilterPacks,
|
|
|
|
NULL, NULL, NULL, FALSE, FALSE,
|
|
|
|
_("Cancel"), gtk_widget_destroy,
|
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
NULL);
|
1999-11-27 04:58:27 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_main_quit),
|
|
|
|
NULL);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
/********************************************************************/
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
fp_advanced_dialog ();
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
fpFrames.bna = bna = fp_create_bna();
|
|
|
|
fpFrames.rough = rough = fp_create_rough();
|
|
|
|
fpFrames.range = range = fp_create_range();
|
|
|
|
fpFrames.palette = palette = fp_create_circle_palette();
|
|
|
|
fpFrames.lnd = lnd = fp_create_lnd();
|
|
|
|
fpFrames.show = show = fp_create_show();
|
|
|
|
fpFrames.satur = satur = fp_create_msnls();
|
|
|
|
fpFrames.pixelsBy = pixelsBy = fp_create_pixels_select_by();
|
|
|
|
control = fp_create_control();
|
|
|
|
/********************************************************************/
|
|
|
|
/******************** PUT EVRYTHING TOGETHER ******************/
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (4, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), bna, 0, 2, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), control, 1, 2, 1, 3,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), rough, 1, 2, 3, 4,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), show, 0, 1, 1, 2,
|
|
|
|
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), range, 0, 1, 2, 3,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), pixelsBy, 0, 1, 3, 4,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (table);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (dlg);
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
refreshPreviews (Current.VisibleFrames);
|
|
|
|
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_main ();
|
|
|
|
gdk_flush ();
|
|
|
|
|
|
|
|
return FPint.run;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************/
|
|
|
|
/************ Advanced Options Window ******************/
|
|
|
|
/***********************************************************/
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
void
|
|
|
|
fp_advanced_ok (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_widget_hide (AW.window);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
As_You_Drag (GtkWidget *button)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
static gboolean notFirstTime = FALSE;
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
if (! notFirstTime)
|
|
|
|
return;
|
|
|
|
|
|
|
|
notFirstTime = TRUE;
|
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (button)->active)
|
|
|
|
{
|
|
|
|
Current.RealTime=TRUE;
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.roughnessScale),0);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.aliasingScale),0);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.previewSizeScale),0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Current.RealTime=FALSE;
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.roughnessScale),
|
|
|
|
GTK_UPDATE_DELAYED);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.aliasingScale),
|
|
|
|
GTK_UPDATE_DELAYED);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (Current.previewSizeScale),
|
|
|
|
GTK_UPDATE_DELAYED);
|
|
|
|
}
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
preview_size_scale_update (GtkAdjustment *adjustment,
|
|
|
|
float *scale_val)
|
|
|
|
{
|
|
|
|
Current.PreviewSize = adjustment->value;
|
|
|
|
fp_redraw_all_windows();
|
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gint
|
|
|
|
fp_advanced_dialog (void)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
1999-12-28 00:18:06 +08:00
|
|
|
guchar *rangeNames[] = { N_("Shadows:"), N_("Midtones:"), N_("Highlights:")};
|
1998-07-14 14:15:10 +08:00
|
|
|
GtkWidget *frame, *mainvbox;
|
|
|
|
GtkObject *smoothnessData;
|
|
|
|
GtkWidget *graphFrame, *table, *scale;
|
|
|
|
GtkWidget *vbox, *label, *labelTable;
|
|
|
|
GtkWidget *optionsFrame;
|
2000-01-11 23:48:00 +08:00
|
|
|
gint i;
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gimp_help_connect_help_accel (AW.window, gimp_plugin_help_func,
|
|
|
|
"filters/fp.html");
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (AW.window),
|
|
|
|
_("Advanced Filter Pack Options"));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (AW.window), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (sub_dialog_destroy),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
mainvbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (mainvbox), 6);
|
|
|
|
gtk_container_add (GTK_CONTAINER (AW.window), mainvbox);
|
|
|
|
gtk_widget_show (mainvbox);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Smoothness of Aliasing"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (mainvbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
table = gtk_table_new (3, 1, FALSE);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_widget_show (table);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
graphFrame = gtk_frame_new (NULL);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (graphFrame), GTK_SHADOW_IN);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_container_border_width (GTK_CONTAINER (graphFrame),0);
|
|
|
|
gtk_widget_show (graphFrame);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), graphFrame, 0, 1, 0, 1,
|
|
|
|
GTK_EXPAND, 0, 0, 0);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_container_add (GTK_CONTAINER (graphFrame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
AW.aliasingPreview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (AW.aliasingPreview), 256, MAX_ROUGHNESS);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox),AW.aliasingPreview, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (AW.aliasingPreview);
|
|
|
|
|
|
|
|
fp_create_smoothness_graph (AW.aliasingPreview);
|
|
|
|
|
|
|
|
AW.rangePreview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (AW.rangePreview), 256, RANGE_HEIGHT);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox),AW.rangePreview, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (AW.rangePreview);
|
|
|
|
|
|
|
|
fp_range_preview_spill (AW.rangePreview, Current.ValueBy);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
labelTable = gtk_table_new (3, 4, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (labelTable), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (labelTable), 2);
|
|
|
|
gtk_widget_show (labelTable);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), labelTable, 0, 1, 1, 2,
|
|
|
|
GTK_EXPAND, 0, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
for (i = 0; i < 12; i++)
|
1998-07-14 14:15:10 +08:00
|
|
|
{
|
2000-01-11 23:48:00 +08:00
|
|
|
label = Current.rangeLabels[i] = gtk_label_new ("-");
|
|
|
|
if (!(i % 4))
|
|
|
|
{
|
|
|
|
gtk_label_set_text (GTK_LABEL(label), gettext (rangeNames[i/4]));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
|
|
|
}
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_table_attach (GTK_TABLE (labelTable), label, i%4, i%4+1, i/4, i/4+1,
|
|
|
|
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
}
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
/************************************************************/
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
AW.aliasingGraph = gtk_drawing_area_new ();
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (AW.aliasingGraph),
|
2000-01-11 23:48:00 +08:00
|
|
|
2 * MARGIN + 256,
|
1998-07-14 14:15:10 +08:00
|
|
|
RANGE_HEIGHT);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), AW.aliasingGraph, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (AW.aliasingGraph);
|
|
|
|
gtk_widget_set_events (AW.aliasingGraph, RANGE_ADJUST_MASK);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (AW.aliasingGraph),"event",
|
|
|
|
GTK_SIGNAL_FUNC (FP_Range_Change_Events),
|
1998-07-14 14:15:10 +08:00
|
|
|
&Current);
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
|
|
|
|
smoothnessData = gtk_adjustment_new (Current.Alias, 0, 1.0, 0.05, 0.01, 0.0);
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Current.aliasingScale = scale =
|
|
|
|
gtk_hscale_new (GTK_ADJUSTMENT (smoothnessData));
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_set_usize (scale, 200, 0);
|
|
|
|
gtk_scale_set_digits (GTK_SCALE (scale), 2);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (scale), 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (smoothnessData), "value_changed",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (fp_scale_update),
|
|
|
|
&Current.Alias);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_show (scale);
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), scale, 0, 1, 2, 3,
|
|
|
|
0, 0, 0, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
/******************* MISC OPTIONS ***************************/
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
optionsFrame = gtk_frame_new (_("Miscellaneous Options"));
|
|
|
|
gtk_widget_show (optionsFrame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (mainvbox), optionsFrame, TRUE, TRUE, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (optionsFrame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
Check_Button_In_A_Box (vbox, _("Preview as You Drag"),
|
|
|
|
GTK_SIGNAL_FUNC (As_You_Drag),
|
|
|
|
NULL, TRUE);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Preview Size"));
|
|
|
|
gtk_widget_show (frame);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
smoothnessData = gtk_adjustment_new (Current.PreviewSize,
|
|
|
|
50, MAX_PREVIEW_SIZE,
|
|
|
|
5, 5, 0.0);
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
Current.previewSizeScale = scale =
|
|
|
|
gtk_hscale_new (GTK_ADJUSTMENT (smoothnessData));
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame),scale);
|
1998-07-14 14:15:10 +08:00
|
|
|
gtk_widget_set_usize (scale, 100, 0);
|
|
|
|
gtk_scale_set_digits (GTK_SCALE (scale), 0);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (scale), 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (smoothnessData), "value_changed",
|
2000-01-11 23:48:00 +08:00
|
|
|
GTK_SIGNAL_FUNC (preview_size_scale_update),
|
1998-07-14 14:15:10 +08:00
|
|
|
&Current.PreviewSize);
|
|
|
|
gtk_widget_show (scale);
|
2000-01-11 23:48:00 +08:00
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
1998-07-14 14:15:10 +08:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|