1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <string.h>
|
1999-10-27 02:27:27 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/temp-buf.h"
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
#include "core/gimppattern.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "pdb/procedural_db.h"
|
|
|
|
|
2001-04-11 09:13:53 +08:00
|
|
|
#include "widgets/gimpdatafactoryview.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "pattern-select.h"
|
|
|
|
|
1998-12-16 08:37:09 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-04-29 16:50:22 +08:00
|
|
|
#define MIN_CELL_SIZE 32
|
2001-02-13 02:05:12 +08:00
|
|
|
#define STD_PATTERN_COLUMNS 6
|
|
|
|
#define STD_PATTERN_ROWS 5
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* local function prototypes */
|
2001-07-31 19:33:13 +08:00
|
|
|
static void pattern_select_change_callbacks (PatternSelect *psp,
|
|
|
|
gboolean closing);
|
2001-02-13 02:05:12 +08:00
|
|
|
|
2001-07-31 19:33:13 +08:00
|
|
|
static void pattern_select_pattern_changed (GimpContext *context,
|
|
|
|
GimpPattern *pattern,
|
|
|
|
PatternSelect *psp);
|
2001-02-05 01:34:30 +08:00
|
|
|
|
2001-07-31 19:33:13 +08:00
|
|
|
static void pattern_select_close_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2001-02-13 02:05:12 +08:00
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* The main pattern selection dialog */
|
2001-10-25 21:30:01 +08:00
|
|
|
static PatternSelect *pattern_select_dialog = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-23 22:47:50 +08:00
|
|
|
/* List of active dialogs */
|
2001-10-25 21:30:01 +08:00
|
|
|
static GSList *pattern_active_dialogs = NULL;
|
1998-10-02 06:09:01 +08:00
|
|
|
|
2001-02-13 02:05:12 +08:00
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
GtkWidget *
|
2001-10-25 21:30:01 +08:00
|
|
|
pattern_dialog_create (Gimp *gimp)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (! pattern_select_dialog)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
pattern_select_dialog = pattern_select_new (gimp, NULL, NULL, NULL);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
2001-04-18 00:00:27 +08:00
|
|
|
|
|
|
|
return pattern_select_dialog->shell;
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-02-05 01:34:30 +08:00
|
|
|
pattern_dialog_free (void)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
if (pattern_select_dialog)
|
|
|
|
{
|
|
|
|
pattern_select_free (pattern_select_dialog);
|
|
|
|
pattern_select_dialog = NULL;
|
|
|
|
}
|
|
|
|
}
|
1999-04-23 22:47:50 +08:00
|
|
|
|
2001-02-13 02:05:12 +08:00
|
|
|
|
1999-04-23 22:47:50 +08:00
|
|
|
/* If title == NULL then it is the main pattern dialog */
|
1999-10-27 02:27:27 +08:00
|
|
|
PatternSelect *
|
2001-10-25 21:30:01 +08:00
|
|
|
pattern_select_new (Gimp *gimp,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *initial_pattern,
|
|
|
|
const gchar *callback_name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
PatternSelect *psp;
|
2001-02-13 02:05:12 +08:00
|
|
|
GtkWidget *vbox;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-02-05 01:34:30 +08:00
|
|
|
GimpPattern *active = NULL;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
static gboolean first_call = TRUE;
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
2001-02-13 02:05:12 +08:00
|
|
|
psp = g_new0 (PatternSelect, 1);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
psp->callback_name = g_strdup (callback_name);
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* The shell */
|
|
|
|
psp->shell = gimp_dialog_new (title ? title : _("Pattern Selection"),
|
|
|
|
"pattern_selection",
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/pattern_selection.html",
|
2000-01-30 07:06:06 +08:00
|
|
|
title ? GTK_WIN_POS_MOUSE : GTK_WIN_POS_NONE,
|
1999-10-27 02:27:27 +08:00
|
|
|
FALSE, TRUE, FALSE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2001-02-14 22:57:14 +08:00
|
|
|
"_delete_event_", pattern_select_close_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
psp, NULL, NULL, TRUE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
NULL);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
gtk_dialog_set_has_separator (GTK_DIALOG (psp->shell), FALSE);
|
2001-02-14 22:57:14 +08:00
|
|
|
gtk_widget_hide (GTK_DIALOG (psp->shell)->action_area);
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (title)
|
|
|
|
{
|
2001-12-08 01:39:51 +08:00
|
|
|
psp->context = gimp_context_new (gimp, title, NULL);
|
1998-10-02 06:09:01 +08:00
|
|
|
}
|
1999-09-28 01:58:10 +08:00
|
|
|
else
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
psp->context = gimp_get_user_context (gimp);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
if (gimp->no_data && first_call)
|
|
|
|
gimp_data_factory_data_init (gimp->pattern_factory, FALSE);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
first_call = FALSE;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (title && initial_pattern && strlen (initial_pattern))
|
|
|
|
{
|
2001-02-06 01:48:50 +08:00
|
|
|
active = (GimpPattern *)
|
2001-10-25 21:30:01 +08:00
|
|
|
gimp_container_get_child_by_name (gimp->pattern_factory->container,
|
2001-02-06 01:48:50 +08:00
|
|
|
initial_pattern);
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
active = gimp_context_get_pattern (gimp_get_user_context (gimp));
|
1999-09-28 01:58:10 +08:00
|
|
|
}
|
1998-10-02 06:09:01 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
if (!active)
|
2001-10-25 21:30:01 +08:00
|
|
|
active = gimp_context_get_pattern (gimp_get_standard_context (gimp));
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (title)
|
2001-02-13 08:12:15 +08:00
|
|
|
gimp_context_set_pattern (psp->context, active);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-04-29 16:50:22 +08:00
|
|
|
/* The main vbox */
|
|
|
|
vbox = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (psp->shell)->vbox), vbox);
|
|
|
|
|
2001-02-13 02:05:12 +08:00
|
|
|
/* The Brush Grid */
|
2001-02-14 22:57:14 +08:00
|
|
|
psp->view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
2001-10-25 21:30:01 +08:00
|
|
|
gimp->pattern_factory,
|
2001-02-14 22:57:14 +08:00
|
|
|
NULL,
|
|
|
|
psp->context,
|
|
|
|
MIN_CELL_SIZE,
|
|
|
|
STD_PATTERN_COLUMNS,
|
2001-07-09 05:44:52 +08:00
|
|
|
STD_PATTERN_ROWS,
|
|
|
|
NULL);
|
2001-02-13 02:05:12 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), psp->view, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (psp->view);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (vbox);
|
2001-02-05 01:34:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (psp->shell);
|
|
|
|
|
2001-07-31 19:33:13 +08:00
|
|
|
g_signal_connect (G_OBJECT (psp->context), "pattern_changed",
|
|
|
|
G_CALLBACK (pattern_select_pattern_changed),
|
|
|
|
psp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* Add to active pattern dialogs list */
|
|
|
|
pattern_active_dialogs = g_slist_append (pattern_active_dialogs, psp);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return psp;
|
|
|
|
}
|
|
|
|
|
1998-10-02 06:09:01 +08:00
|
|
|
void
|
1999-10-27 02:27:27 +08:00
|
|
|
pattern_select_free (PatternSelect *psp)
|
|
|
|
{
|
2001-10-25 21:30:01 +08:00
|
|
|
g_return_if_fail (psp != NULL);
|
|
|
|
|
|
|
|
gtk_widget_destroy (psp->shell);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
/* remove from active list */
|
|
|
|
pattern_active_dialogs = g_slist_remove (pattern_active_dialogs, psp);
|
|
|
|
|
2001-07-31 19:33:13 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (G_OBJECT (psp->context),
|
|
|
|
pattern_select_pattern_changed,
|
|
|
|
psp);
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
if (psp->callback_name)
|
|
|
|
{
|
|
|
|
g_free (psp->callback_name);
|
2001-07-28 03:41:54 +08:00
|
|
|
g_object_unref (G_OBJECT (psp->context));
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (psp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Call this dialog's PDB callback */
|
|
|
|
|
1999-10-28 23:05:49 +08:00
|
|
|
static void
|
2001-02-13 02:05:12 +08:00
|
|
|
pattern_select_change_callbacks (PatternSelect *psp,
|
|
|
|
gboolean closing)
|
1998-10-02 06:09:01 +08:00
|
|
|
{
|
2001-02-05 01:34:30 +08:00
|
|
|
gchar *name;
|
|
|
|
ProcRecord *prec = NULL;
|
|
|
|
GimpPattern *pattern;
|
|
|
|
gint nreturn_vals;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
static gboolean busy = FALSE;
|
1998-10-02 06:09:01 +08:00
|
|
|
|
|
|
|
/* Any procs registered to callback? */
|
|
|
|
Argument *return_vals;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
if (!psp || !psp->callback_name || busy)
|
1998-10-02 06:09:01 +08:00
|
|
|
return;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
busy = TRUE;
|
2001-02-13 02:05:12 +08:00
|
|
|
|
1998-10-02 06:09:01 +08:00
|
|
|
name = psp->callback_name;
|
1999-10-27 02:27:27 +08:00
|
|
|
pattern = gimp_context_get_pattern (psp->context);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
|
|
|
/* If its still registered run it */
|
2001-07-05 03:31:35 +08:00
|
|
|
prec = procedural_db_lookup (psp->context->gimp, name);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (prec && pattern)
|
1998-10-02 06:09:01 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
return_vals =
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_run_proc (psp->context->gimp,
|
|
|
|
name,
|
1999-10-27 02:27:27 +08:00
|
|
|
&nreturn_vals,
|
2001-05-21 21:58:46 +08:00
|
|
|
GIMP_PDB_STRING, GIMP_OBJECT (pattern)->name,
|
|
|
|
GIMP_PDB_INT32, pattern->mask->width,
|
|
|
|
GIMP_PDB_INT32, pattern->mask->height,
|
|
|
|
GIMP_PDB_INT32, pattern->mask->bytes,
|
|
|
|
GIMP_PDB_INT32, (pattern->mask->bytes *
|
2001-02-13 02:05:12 +08:00
|
|
|
pattern->mask->height *
|
|
|
|
pattern->mask->width),
|
2001-05-21 21:58:46 +08:00
|
|
|
GIMP_PDB_INT8ARRAY, temp_buf_data (pattern->mask),
|
|
|
|
GIMP_PDB_INT32, (gint) closing,
|
|
|
|
GIMP_PDB_END);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if (!return_vals || return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("failed to run pattern callback function");
|
2001-02-13 02:05:12 +08:00
|
|
|
|
1998-10-02 06:09:01 +08:00
|
|
|
procedural_db_destroy_args (return_vals, nreturn_vals);
|
|
|
|
}
|
2001-02-13 02:05:12 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
busy = FALSE;
|
1998-10-02 06:09:01 +08:00
|
|
|
}
|
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
PatternSelect *
|
|
|
|
pattern_select_get_by_callback (const gchar *callback_name)
|
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
PatternSelect *psp;
|
|
|
|
|
|
|
|
for (list = pattern_active_dialogs; list; list = g_slist_next (list))
|
|
|
|
{
|
|
|
|
psp = (PatternSelect *) list->data;
|
|
|
|
|
|
|
|
if (psp->callback_name && ! strcmp (callback_name, psp->callback_name))
|
|
|
|
return psp;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* Close active dialogs that no longer have PDB registered for them */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2001-02-13 02:05:12 +08:00
|
|
|
pattern_select_dialogs_check (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
PatternSelect *psp;
|
2001-02-05 01:34:30 +08:00
|
|
|
GSList *list;
|
|
|
|
gchar *name;
|
|
|
|
ProcRecord *prec = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
list = pattern_active_dialogs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
while (list)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
psp = (PatternSelect *) list->data;
|
1999-10-28 23:05:49 +08:00
|
|
|
list = g_slist_next (list);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
name = psp->callback_name;
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (name)
|
|
|
|
{
|
2001-07-05 03:31:35 +08:00
|
|
|
prec = procedural_db_lookup (psp->context->gimp, name);
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (!prec)
|
|
|
|
{
|
|
|
|
/* Can alter pattern_active_dialogs list */
|
|
|
|
pattern_select_close_callback (NULL, psp);
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
1999-05-02 05:37:34 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
static void
|
|
|
|
pattern_select_pattern_changed (GimpContext *context,
|
2001-02-05 01:34:30 +08:00
|
|
|
GimpPattern *pattern,
|
1999-10-27 02:27:27 +08:00
|
|
|
PatternSelect *psp)
|
|
|
|
{
|
|
|
|
if (pattern)
|
1999-10-29 22:15:55 +08:00
|
|
|
{
|
|
|
|
if (psp->callback_name)
|
2001-02-13 02:05:12 +08:00
|
|
|
pattern_select_change_callbacks (psp, FALSE);
|
1999-10-29 22:15:55 +08:00
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pattern_select_close_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
PatternSelect *psp;
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
psp = (PatternSelect *) data;
|
1998-10-02 06:09:01 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (GTK_WIDGET_VISIBLE (psp->shell))
|
|
|
|
gtk_widget_hide (psp->shell);
|
|
|
|
|
|
|
|
/* Free memory if poping down dialog which is not the main one */
|
|
|
|
if (psp != pattern_select_dialog)
|
|
|
|
{
|
|
|
|
/* Send data back */
|
2001-02-13 02:05:12 +08:00
|
|
|
pattern_select_change_callbacks (psp, TRUE);
|
1999-10-27 02:27:27 +08:00
|
|
|
pattern_select_free (psp);
|
|
|
|
}
|
|
|
|
}
|