Commit 80bfd97a authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

plug-ins/common/Makefile.am plug-ins/common/hot.c plug-ins/common/hrz.c

2000-01-07  Michael Natterer  <mitch@gimp.org>

	* plug-ins/common/Makefile.am
	* plug-ins/common/hot.c
	* plug-ins/common/hrz.c
	* plug-ins/common/illusion.c
	* plug-ins/common/iwarp.c
	* plug-ins/common/jigsaw.c
	* plug-ins/common/jpeg.c
	* plug-ins/common/lic.c
	* plug-ins/common/mail.c
	* plug-ins/common/mapcolor.c
	* plug-ins/common/max_rgb.c
	* plug-ins/common/mblur.c
	* plug-ins/common/newsprint.c
	* plug-ins/common/nlfilt.c
	* plug-ins/common/noisify.c
	* plug-ins/common/nova.c
	* plug-ins/common/oilify.c: some more help-aware plugins.

	* plug-ins/helpbrowser/helpbrowser.c: had the wrong help page
	attached.
parent 39920b20
2000-01-07 Michael Natterer <mitch@gimp.org>
* plug-ins/common/Makefile.am
* plug-ins/common/hot.c
* plug-ins/common/hrz.c
* plug-ins/common/illusion.c
* plug-ins/common/iwarp.c
* plug-ins/common/jigsaw.c
* plug-ins/common/jpeg.c
* plug-ins/common/lic.c
* plug-ins/common/mail.c
* plug-ins/common/mapcolor.c
* plug-ins/common/max_rgb.c
* plug-ins/common/mblur.c
* plug-ins/common/newsprint.c
* plug-ins/common/nlfilt.c
* plug-ins/common/noisify.c
* plug-ins/common/nova.c
* plug-ins/common/oilify.c: some more help-aware plugins.
* plug-ins/helpbrowser/helpbrowser.c: had the wrong help page
attached.
2000-01-06 Kelly Lynn Martin <kelly@poverty.bloomington.in.us>
* plug-ins/gfig/gfig.c (paint_page_menu_type): UI modification (as
......
......@@ -632,6 +632,7 @@ hot_SOURCES = \
hot_LDADD = \
$(top_builddir)/plug-ins/megawidget/libmegawidget.a \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -649,6 +650,7 @@ illusion_SOURCES = \
illusion.c
illusion_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -657,6 +659,7 @@ iwarp_SOURCES = \
iwarp.c
iwarp_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -665,6 +668,7 @@ jigsaw_SOURCES = \
jigsaw.c
jigsaw_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -700,6 +704,7 @@ mail_SOURCES = \
mail.c
mail_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -717,6 +722,7 @@ max_rgb_SOURCES = \
max_rgb.c
max_rgb_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -725,6 +731,7 @@ mblur_SOURCES = \
mblur.c
mblur_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -742,6 +749,7 @@ newsprint_SOURCES = \
newsprint.c
newsprint_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -751,6 +759,7 @@ nlfilt_SOURCES = \
nlfilt_LDADD = \
$(top_builddir)/plug-ins/megawidget/libmegawidget.a \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -759,6 +768,7 @@ noisify_SOURCES = \
noisify.c
noisify_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......@@ -784,6 +794,7 @@ oilify_SOURCES = \
oilify.c
oilify_LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(GTK_LIBS) \
$(INTLLIBS)
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
* HRZ reading and writing code Copyright (C) 1996 Albert Cahalan
......@@ -60,9 +59,11 @@
#define _O_BINARY 0
#endif
#include "gtk/gtk.h"
#include <gtk/gtk.h>
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
#include "libgimp/stdplugins-intl.h"
/* Declare local data types
......@@ -91,7 +92,6 @@ static gint save_image (char *filename,
static void init_gtk (void);
static gint save_dialog (void);
static void save_close_callback (GtkWidget *widget, gpointer data);
static void save_ok_callback (GtkWidget *widget,
gpointer data);
/*
......@@ -228,7 +228,7 @@ run (char *name,
{
case RUN_INTERACTIVE:
case RUN_WITH_LAST_VALS:
INIT_I18N_UI();
INIT_I18N_UI();
init_gtk ();
export = gimp_export_image (&image_ID, &drawable_ID, "HRZ",
(CAN_HANDLE_RGB | CAN_HANDLE_GRAY));
......@@ -239,7 +239,7 @@ run (char *name,
}
break;
default:
INIT_I18N();
INIT_I18N();
break;
}
......@@ -279,11 +279,12 @@ run (char *name,
/************ load HRZ image row *********************/
void
do_hrz_load(void *mapped, GPixelRgn *pixel_rgn)
do_hrz_load (void *mapped,
GPixelRgn *pixel_rgn)
{
unsigned char *data, *d;
int x, y;
int start, end, scanlines;
guchar *data, *d;
int x, y;
int start, end, scanlines;
data = g_malloc (gimp_tile_height () * 256 * 3);
......@@ -497,9 +498,8 @@ save_image (char *filename,
return TRUE;
}
static void
init_gtk ()
init_gtk (void)
{
gchar **argv;
gint argc;
......@@ -514,44 +514,28 @@ init_gtk ()
/*********** Save dialog ************/
static gint
save_dialog ()
save_dialog (void)
{
GtkWidget *dlg;
GtkWidget *hbbox;
GtkWidget *button;
dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dlg), _("Save as HRZ"));
gtk_window_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
dlg = gimp_dialog_new (_("Save as HRZ"), "hrz",
gimp_plugin_help_func, "filters/hrz.html",
GTK_WIN_POS_MOUSE,
FALSE, TRUE, FALSE,
_("OK"), save_ok_callback,
NULL, NULL, NULL, TRUE, FALSE,
_("Cancel"), gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE,
NULL);
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
(GtkSignalFunc) save_close_callback,
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
/* Action area */
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->action_area), 2);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dlg)->action_area), FALSE);
hbbox = gtk_hbutton_box_new ();
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dlg)->action_area), hbbox, FALSE, FALSE, 0);
gtk_widget_show (hbbox);
button = gtk_button_new_with_label ( _("OK"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) save_ok_callback,
dlg);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_widget_grab_default (button);
gtk_widget_show (button);
button = gtk_button_new_with_label ( _("Cancel"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (dlg));
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
gtk_main ();
gdk_flush ();
......@@ -561,18 +545,12 @@ save_dialog ()
/********** Save interface functions **********/
static void
save_close_callback (GtkWidget *widget,
gpointer data)
{
gtk_main_quit ();
}
static void
save_ok_callback (GtkWidget *widget,
gpointer data)
{
psint.run = TRUE;
gtk_widget_destroy (GTK_WIDGET (data));
}
......
......@@ -22,11 +22,16 @@
*******************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include "libgimp/gimpmath.h"
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
#include "libgimp/gimpmath.h"
#include "libgimp/stdplugins-intl.h"
#define PLUG_IN_NAME "plug_in_illusion"
......@@ -35,10 +40,10 @@
/******************************************************************************/
static void query( void );
static void run( char *, int, GParam *, int *, GParam ** );
static void filter( GDrawable *drawable );
static int dialog( void );
static void query (void);
static void run (char *, int, GParam *, int *, GParam **);
static void filter (GDrawable *drawable);
static int dialog (void);
/******************************************************************************/
......@@ -78,10 +83,11 @@ MAIN()
/******************************************************************************/
static void query( void )
static void query (void)
{
static int nargs = 4;
static GParamDef args[] = {
static GParamDef args[] =
{
{ PARAM_INT32, "run_mode", "interactive / non-interactive" },
{ PARAM_IMAGE, "image", "input image" },
{ PARAM_DRAWABLE, "drawable", "input drawable" },
......@@ -92,30 +98,29 @@ static void query( void )
INIT_I18N();
gimp_install_procedure(
PLUG_IN_NAME,
_("produce illusion"),
_("produce illusion"),
"Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>",
"Hirotsuna Mizuno",
PLUG_IN_VERSION,
N_("<Image>/Filters/Map/Illusion..."),
"RGB*, GRAY*",
PROC_PLUG_IN,
nargs,
nreturn_vals,
args,
return_vals
);
gimp_install_procedure (PLUG_IN_NAME,
_("produce illusion"),
_("produce illusion"),
"Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>",
"Hirotsuna Mizuno",
PLUG_IN_VERSION,
N_("<Image>/Filters/Map/Illusion..."),
"RGB*, GRAY*",
PROC_PLUG_IN,
nargs,
nreturn_vals,
args,
return_vals);
}
/******************************************************************************/
static void run( char *name,
int paramc,
GParam *params,
int *returnc,
GParam **returns )
static void
run (char *name,
int paramc,
GParam *params,
int *returnc,
GParam **returns)
{
GDrawable *drawable;
GRunModeType run_mode;
......@@ -123,72 +128,74 @@ static void run( char *name,
GStatusType status = STATUS_SUCCESS;
run_mode = params[0].data.d_int32;
drawable = gimp_drawable_get( params[2].data.d_drawable );
drawable = gimp_drawable_get (params[2].data.d_drawable);
*returnc = 1;
*returns = returnv;
/* get the drawable info */
image_width = gimp_drawable_width( drawable->id );
image_height = gimp_drawable_height( drawable->id );
image_bpp = gimp_drawable_bpp( drawable->id );
image_has_alpha = gimp_drawable_has_alpha( drawable->id );
gimp_drawable_mask_bounds( drawable->id,
&select_x1, &select_y1, &select_x2, &select_y2 );
image_width = gimp_drawable_width (drawable->id);
image_height = gimp_drawable_height (drawable->id);
image_bpp = gimp_drawable_bpp (drawable->id);
image_has_alpha = gimp_drawable_has_alpha (drawable->id);
gimp_drawable_mask_bounds (drawable->id,
&select_x1, &select_y1, &select_x2, &select_y2);
select_width = select_x2 - select_x1;
select_height = select_y2 - select_y1;
center_x = select_x1 + (gdouble)select_width / 2;
center_y = select_y1 + (gdouble)select_height / 2;
/* switch the run mode */
switch( run_mode ){
case RUN_INTERACTIVE:
INIT_I18N_UI();
gimp_get_data( PLUG_IN_NAME, &parameters );
if( ! dialog() ) return;
gimp_set_data( PLUG_IN_NAME, &parameters, sizeof( parameter_t ) );
break;
case RUN_NONINTERACTIVE:
if( paramc != 4 ){
status = STATUS_CALLING_ERROR;
} else {
parameters.division = params[3].data.d_int32;
switch (run_mode)
{
case RUN_INTERACTIVE:
INIT_I18N_UI();
gimp_get_data (PLUG_IN_NAME, &parameters);
if (! dialog()) return;
gimp_set_data (PLUG_IN_NAME, &parameters, sizeof (parameter_t));
break;
case RUN_NONINTERACTIVE:
if (paramc != 4)
{
status = STATUS_CALLING_ERROR;
}
else
{
parameters.division = params[3].data.d_int32;
}
break;
case RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_NAME, &parameters);
break;
}
break;
case RUN_WITH_LAST_VALS:
gimp_get_data( PLUG_IN_NAME, &parameters );
break;
}
if( status == STATUS_SUCCESS ){
if( gimp_drawable_is_rgb( drawable->id ) ||
gimp_drawable_is_gray( drawable->id ) ){
gimp_tile_cache_ntiles( 2 * ( drawable->width / gimp_tile_width() + 1 ) );
filter( drawable );
if( run_mode != RUN_NONINTERACTIVE ) gimp_displays_flush ();
} else {
status = STATUS_EXECUTION_ERROR;
if (status == STATUS_SUCCESS)
{
if (gimp_drawable_is_rgb (drawable->id) ||
gimp_drawable_is_gray (drawable->id))
{
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width() + 1));
filter (drawable);
if (run_mode != RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
else
{
status = STATUS_EXECUTION_ERROR;
}
}
}
returnv[0].type = PARAM_STATUS;
returnv[0].data.d_status = status;
gimp_drawable_detach( drawable );
gimp_drawable_detach (drawable);
}
/******************************************************************************/
static void filter( GDrawable *drawable )
static void
filter (GDrawable *drawable)
{
GPixelRgn srcPR, destPR;
guchar **pixels;
......@@ -197,176 +204,152 @@ static void filter( GDrawable *drawable )
gint xx, yy;
gdouble scale, radius, cx, cy, angle, offset;
gimp_pixel_rgn_init( &srcPR, drawable,
0, 0, image_width, image_height, FALSE, FALSE );
gimp_pixel_rgn_init( &destPR, drawable,
0, 0, image_width, image_height, TRUE, TRUE );
pixels = (guchar **)malloc( image_height * sizeof(guchar *) );
destpixels = (guchar **)malloc( image_height * sizeof(guchar *) );
for( y = 0; y < image_height; y++ ){
pixels[y] = (guchar *)malloc( image_width * image_bpp );
destpixels[y] = (guchar *)malloc( image_width * image_bpp );
gimp_pixel_rgn_get_row( &srcPR, pixels[y], 0, y, image_width );
}
gimp_pixel_rgn_init (&srcPR, drawable,
0, 0, image_width, image_height, FALSE, FALSE);
gimp_pixel_rgn_init (&destPR, drawable,
0, 0, image_width, image_height, TRUE, TRUE);
pixels = (guchar **) g_malloc (image_height * sizeof (guchar *));
destpixels = (guchar **) g_malloc (image_height * sizeof (guchar *));
for (y = 0; y < image_height; y++)
{
pixels[y] = (guchar *) g_malloc (image_width * image_bpp);
destpixels[y] = (guchar *) g_malloc (image_width * image_bpp);
gimp_pixel_rgn_get_row (&srcPR, pixels[y], 0, y, image_width);
}
/*
for( y = select_y1; y < select_y2; y++ ){
for( y = select_y1; y < select_y2; y++ ){
for( x = select_x1; x < select_x2; x++ ){
for( b = 0; b < image_bpp; b++ ){
destpixels[y][x*image_bpp+b] = 0;
}
for( b = 0; b < image_bpp; b++ ){
destpixels[y][x*image_bpp+b] = 0;
}
}
}
}
*/
gimp_progress_init( PLUG_IN_NAME );
scale = sqrt(select_width*select_width+select_height*select_height) / 2;
offset = (gint)(scale / 2);
for( y = select_y1; y < select_y2; y++ ){
cy = ((gdouble)y - center_y) / scale;
for( x = select_x1; x < select_x2; x++ ){
cx = ((gdouble)x - center_x) / scale;
angle = floor( atan2(cy,cx) * parameters.division / G_PI_2 )
* G_PI_2 / parameters.division + ( G_PI / parameters.division );
radius = sqrt((gdouble)(cx*cx+cy*cy));
xx = x - offset * cos( angle );
yy = y - offset * sin( angle );
if( xx < 0 ) xx = 0;
else if( image_width <= xx ) xx = image_width - 1;
if( yy < 0 ) yy = 0;
else if( image_height <= yy ) yy = image_height - 1;
for( b = 0; b < image_bpp; b++ )
destpixels[y][x*image_bpp+b] =
(1-radius)*pixels[y][x*image_bpp+b]
+ radius*pixels[yy][xx*image_bpp+b];
gimp_progress_init (PLUG_IN_NAME);
scale = sqrt (select_width * select_width + select_height * select_height) / 2;
offset = (gint) (scale / 2);
for (y = select_y1; y < select_y2; y++)
{
cy = ((gdouble)y - center_y) / scale;
for (x = select_x1; x < select_x2; x++)
{
cx = ((gdouble)x - center_x) / scale;
angle = floor (atan2 (cy, cx) * parameters.division / G_PI_2)
* G_PI_2 / parameters.division + (G_PI / parameters.division);
radius = sqrt ((gdouble) (cx * cx + cy * cy));
xx = x - offset * cos (angle);
yy = y - offset * sin (angle);
if (xx < 0) xx = 0;
else if (image_width <= xx) xx = image_width - 1;
if (yy < 0) yy = 0;
else if (image_height <= yy) yy = image_height - 1;
for (b = 0; b < image_bpp; b++)
destpixels[y][x*image_bpp+b] =
(1-radius) * pixels[y][x * image_bpp + b]
+ radius * pixels[yy][xx * image_bpp + b];
}
gimp_pixel_rgn_set_row (&destPR, destpixels[y], 0, y, image_width);
gimp_progress_update ((double) (y - select_y1) / (double) select_height);
}
gimp_pixel_rgn_set_row (&destPR, destpixels[y], 0, y, image_width );
gimp_progress_update ( (double)( y - select_y1 ) / (double)select_height );
}
gimp_drawable_flush( drawable );
gimp_drawable_merge_shadow( drawable->id, TRUE );
gimp_drawable_update( drawable->id,
select_x1, select_y1, select_width, select_height );
for( y = select_y1; y < select_y2; y++ ) free( pixels[y-select_y1] );
free( pixels );
for( y = select_y1; y < select_y2; y++ ) free( destpixels[y-select_y1] );
free( destpixels );
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->id, TRUE);
gimp_drawable_update (drawable->id,
select_x1, select_y1, select_width, select_height);
for (y = select_y1; y < select_y2; y++) g_free (pixels[y-select_y1]);
g_free (pixels);
for (y = select_y1; y < select_y2; y++) g_free (destpixels[y-select_y1]);
g_free (destpixels);
}
/******************************************************************************/
static int dialog_status;
static int dialog_status = FALSE;
static GtkWidget *entry_division;
static void dialog_destroy_handler( GtkWidget *widget, gpointer *data )
{
gtk_main_quit();
}
static void dialog_ok_handler( GtkWidget *widget, gpointer *data )
static void
dialog_ok_handler (GtkWidget *widget,
gpointer data)
{
dialog_status = TRUE;
parameters.division =
(gint32)atof(gtk_entry_get_text( GTK_ENTRY( entry_division ) ) );
(gint32) atof (gtk_entry_get_text (GTK_ENTRY (entry_division)));
gtk_widget_destroy( GTK_WIDGET( data ) );
}
static void dialog_cancel_handler( GtkWidget *widget, gpointer *data )
{
dialog_status = FALSE;
gtk_widget_destroy( GTK_WIDGET( data ) );
gtk_widget_destroy (GTK_WIDGET (data));
}
/******************************************************************************/
static int dialog( void )
static int
dialog (void)
{
GtkWidget *window;
dialog_status = FALSE;
{
gint argc = 1;
gchar **argv = g_new( gchar *, 1 );
argv[0] = g_strdup( _("Illusion") );
gtk_init( &argc, &argv );
gtk_rc_parse( gimp_gtkrc () );
gchar **argv = g_new (gchar *, 1);
argv[0] = g_strdup ("illusion");
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
}
/* dialog window */
window = gtk_dialog_new();
gtk_signal_connect( GTK_OBJECT( window ), "destroy",
GTK_SIGNAL_FUNC( dialog_destroy_handler ), NULL );
gtk_container_border_width( GTK_CONTAINER( window ), 0 );
gtk_container_border_width( GTK_CONTAINER( GTK_DIALOG( window )->vbox ), 5 );
window = gimp_dialog_new (_("Illusion"), "illusion",
gimp_plugin_help_func, "filters/illusion.html",
GTK_WIN_POS_MOUSE,
FALSE, TRUE, FALSE,
_("OK"), dialog_ok_handler,
NULL, NULL, NULL, TRUE, FALSE,
_("Cancel"), gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE,
NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
{
/* Action area */
GtkWidget *button;
GtkWidget *hbbox;
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (window)->action_area), 2);
gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (window)->action_area), FALSE);
hbbox = gtk_hbutton_box_new ();
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (window)->action_area), hbbox, FALSE, FALSE, 0);
gtk_widget_show (hbbox);
/* ok button */
button = gtk_button_new_with_label( _("OK") );
GTK_WIDGET_SET_FLAGS( button, GTK_CAN_DEFAULT );
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_ok_handler ),
GTK_OBJECT( window ) );
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_widget_grab_default( button );
gtk_widget_show( button );
/* cancel button */
button = gtk_button_new_with_label( _("Cancel") );
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_signal_connect( GTK_OBJECT( button ), "clicked",
GTK_SIGNAL_FUNC( dialog_cancel_handler ),
GTK_OBJECT( window )) ;
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_widget_show( button );
}
{
/* text boxes */
GtkWidget *table;
GtkWidget *label;
char buffer[32];
gchar buffer[32];
/* table */
table = gtk_table_new( 1, 2, FALSE );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( window )->vbox ),
table, TRUE, TRUE, 0 );
gtk_widget_show( table );
table = gtk_table_new (1, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);