1998-11-05 07:30:18 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
* Copyright (C) 1998 Andy Thomas.
|
|
|
|
*
|
|
|
|
* Gradient editor module copyight (C) 1996-1997 Federico Mena Quintero
|
|
|
|
* federico@nuclecu.unam.mx
|
|
|
|
*
|
|
|
|
* 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 PURIGHTE. 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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This is the popup for the gradient selection stuff..
|
|
|
|
* idea is a cut down version of the gradient selection widget
|
|
|
|
* just a clist on which each gradient can be selected.
|
|
|
|
* Of course all the support functions for getting the slected gradient and
|
|
|
|
* setting the slection all need to be done as well.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Main structure for the dialog. There can be multiple of these
|
|
|
|
* so every thing has to go into the strcuture and we have to have a list
|
|
|
|
* the structures so we can find which one we are taking about.
|
|
|
|
*/
|
1999-02-21 07:20:54 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1998-11-05 07:30:18 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#ifdef HAVE_UNISTD_H
|
1998-11-05 07:30:18 +08:00
|
|
|
#include <unistd.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
#include "appenv.h"
|
|
|
|
#include "colormaps.h"
|
|
|
|
#include "cursorutil.h"
|
|
|
|
#include "datafiles.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "dialog_handler.h"
|
1998-11-05 07:30:18 +08:00
|
|
|
#include "errors.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gimpcontext.h"
|
1998-11-05 07:30:18 +08:00
|
|
|
#include "gimprc.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "gimpui.h"
|
1998-11-05 07:30:18 +08:00
|
|
|
#include "gradient.h"
|
|
|
|
#include "gradient_header.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "session.h"
|
|
|
|
|
1998-12-16 08:37:09 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *grad_active_dialogs = NULL; /* List of active dialogs */
|
|
|
|
GradSelectP gradient_select_dialog = NULL; /* The main selection dialog */
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
static void grad_select_close_callback (GtkWidget *, gpointer);
|
1998-11-05 07:30:18 +08:00
|
|
|
static void grad_select_edit_callback (GtkWidget *, gpointer);
|
1999-09-28 01:58:10 +08:00
|
|
|
static void grad_change_callbacks (GradSelectP gsp, gint closing);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_free_gradient_editor (void)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
if (gradient_select_dialog)
|
1999-09-28 01:58:10 +08:00
|
|
|
session_get_window_info (gradient_select_dialog->shell,
|
|
|
|
&gradient_select_session_info);
|
|
|
|
}
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_sel_rename_all (gint n,
|
|
|
|
gradient_t *grad)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_set_text (GTK_CLIST (gsp->clist), n, 1, grad->name);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_set_text (GTK_CLIST (gradient_select_dialog->clist),
|
|
|
|
n, 1, grad->name);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_sel_new_all (gint pos,
|
|
|
|
gradient_t *grad)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_freeze (GTK_CLIST (gsp->clist));
|
|
|
|
ed_insert_in_gradients_listbox (gsp->gc, gsp->clist, grad, pos, 1);
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gsp->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_freeze (GTK_CLIST (gradient_select_dialog->clist));
|
|
|
|
ed_insert_in_gradients_listbox (gradient_select_dialog->gc,
|
|
|
|
gradient_select_dialog->clist,
|
|
|
|
grad, pos, 1);
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gradient_select_dialog->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_sel_copy_all (gint pos,
|
|
|
|
gradient_t *grad)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_freeze (GTK_CLIST (gsp->clist));
|
|
|
|
ed_insert_in_gradients_listbox (gsp->gc, gsp->clist, grad, pos, 1);
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gsp->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_freeze (GTK_CLIST (gradient_select_dialog->clist));
|
|
|
|
ed_insert_in_gradients_listbox (gradient_select_dialog->gc,
|
|
|
|
gradient_select_dialog->clist,
|
|
|
|
grad, pos, 1);
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gradient_select_dialog->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_sel_delete_all (gint n)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_remove (GTK_CLIST (gsp->clist), n);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_remove (GTK_CLIST (gradient_select_dialog->clist), n);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-27 02:27:27 +08:00
|
|
|
grad_sel_free_all ()
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
|
|
|
gtk_clist_freeze (GTK_CLIST (gsp->clist));
|
|
|
|
gtk_clist_clear (GTK_CLIST (gsp->clist));
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gsp->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_freeze (GTK_CLIST (gradient_select_dialog->clist));
|
|
|
|
gtk_clist_clear (GTK_CLIST (gradient_select_dialog->clist));
|
|
|
|
gtk_clist_thaw (GTK_CLIST (gradient_select_dialog->clist));
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_sel_refill_all ()
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
GradSelectP gsp;
|
|
|
|
int select_pos = -1;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1998-11-05 07:30:18 +08:00
|
|
|
gsp->grad = curr_gradient;
|
1999-09-28 01:58:10 +08:00
|
|
|
select_pos = ed_set_list_of_gradients (gsp->gc,
|
|
|
|
gsp->clist,
|
|
|
|
curr_gradient);
|
|
|
|
if (select_pos != -1)
|
|
|
|
gtk_clist_moveto (GTK_CLIST (gsp->clist), select_pos, 0, 0.0, 0.0);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
gradient_select_dialog->grad = curr_gradient;
|
1999-09-28 01:58:10 +08:00
|
|
|
select_pos = ed_set_list_of_gradients (gradient_select_dialog->gc,
|
|
|
|
gradient_select_dialog->clist,
|
|
|
|
curr_gradient);
|
|
|
|
if (select_pos != -1)
|
|
|
|
gtk_clist_moveto (GTK_CLIST (gradient_select_dialog->clist),
|
|
|
|
select_pos, 0, 0.0, 0.0);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
sel_update_dialogs (gint row,
|
|
|
|
gradient_t *grad)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
/* Go around each updating the names and hopefully the previews */
|
|
|
|
GradSelectP gsp;
|
1999-10-27 02:27:27 +08:00
|
|
|
GSList *list;
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_set_text (GTK_CLIST (gsp->clist), row, 1, grad->name);
|
1998-11-05 07:30:18 +08:00
|
|
|
/* Are we updating one that is selected in a popup dialog? */
|
1999-09-28 01:58:10 +08:00
|
|
|
if (grad == gsp->grad)
|
|
|
|
grad_change_callbacks (gsp, 0);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog)
|
|
|
|
gtk_clist_set_text (GTK_CLIST (gradient_select_dialog->clist),
|
|
|
|
row, 1, grad->name);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_update_gradients (grad);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-09-28 01:58:10 +08:00
|
|
|
sel_list_item_update (GtkWidget *widget,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
GradSelectP gsp = (GradSelectP) data;
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
GSList* tmp = g_slist_nth (gradients_list, row);
|
|
|
|
gsp->grad = (gradient_t *) (tmp->data);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* If main one then make it the current selection */
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gsp == gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_set_grad_to_name (gsp->grad->name);
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_gradient (gimp_context_get_user (), gsp->grad);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_change_callbacks (gsp, 0);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_select_edit_callback (GtkWidget *widget,
|
1999-10-27 02:27:27 +08:00
|
|
|
gpointer data)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gsp = (GradSelectP) data;
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_create_gradient_editor_init (TRUE);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* Set the current gradient in this dialog to the "real current" */
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gsp && gsp->grad)
|
|
|
|
grad_set_grad_to_name (gsp->grad->name);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
grad_select_free (GradSelectP gsp)
|
|
|
|
{
|
|
|
|
if (gsp)
|
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gsp->callback_name)
|
|
|
|
g_free (gsp->callback_name);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
/* remove from active list */
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_active_dialogs = g_slist_remove (grad_active_dialogs, gsp);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
g_free (gsp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Close active dialogs that no longer have PDB registered for them */
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
gradients_check_dialogs (void)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
GradSelectP gsp;
|
|
|
|
gchar * name;
|
|
|
|
ProcRecord *prec = NULL;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = grad_active_dialogs; list;)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
gsp = (GradSelectP) list->data;
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
list = g_slist_next (list);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
name = gsp->callback_name;
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (name)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
prec = procedural_db_lookup (name);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
if (!prec)
|
|
|
|
{
|
|
|
|
grad_active_dialogs = g_slist_remove (grad_active_dialogs, gsp);
|
|
|
|
|
|
|
|
/* Can alter grad_active_dialogs list*/
|
|
|
|
grad_select_close_callback (NULL, gsp);
|
|
|
|
}
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-10-27 02:27:27 +08:00
|
|
|
grad_change_callbacks (GradSelectP gsp,
|
|
|
|
gint closing)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
gchar * name;
|
|
|
|
ProcRecord *prec = NULL;
|
|
|
|
gradient_t *grad;
|
|
|
|
int nreturn_vals;
|
|
|
|
static int busy = 0;
|
|
|
|
|
|
|
|
/* Any procs registered to callback? */
|
|
|
|
Argument *return_vals;
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
if (!gsp || !gsp->callback_name || busy != 0)
|
1998-11-05 07:30:18 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
busy = 1;
|
|
|
|
name = gsp->callback_name;
|
|
|
|
grad = gsp->grad;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
/* If its still registered run it */
|
1999-09-28 01:58:10 +08:00
|
|
|
prec = procedural_db_lookup (name);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
if (prec && grad)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
gdouble *values, *pv;
|
|
|
|
double pos, delta;
|
|
|
|
double r, g, b, a;
|
|
|
|
int i = gsp->sample_size;
|
|
|
|
pos = 0.0;
|
|
|
|
delta = 1.0 / (i - 1);
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
values = g_new (gdouble, 4 * i);
|
1998-11-05 07:30:18 +08:00
|
|
|
pv = values;
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
while (i--)
|
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
gradient_get_color_at (grad, pos, &r, &g, &b, &a);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
*pv++ = r;
|
|
|
|
*pv++ = g;
|
|
|
|
*pv++ = b;
|
|
|
|
*pv++ = a;
|
|
|
|
|
|
|
|
pos += delta;
|
|
|
|
}
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
return_vals = procedural_db_run_proc (name,
|
|
|
|
&nreturn_vals,
|
1999-09-28 01:58:10 +08:00
|
|
|
PDB_STRING, grad->name,
|
|
|
|
PDB_INT32, gsp->sample_size*4,
|
|
|
|
PDB_FLOATARRAY, values,
|
|
|
|
PDB_INT32, closing,
|
1998-11-05 07:30:18 +08:00
|
|
|
PDB_END);
|
|
|
|
|
|
|
|
if (!return_vals || return_vals[0].value.pdb_int != PDB_SUCCESS)
|
1999-05-30 00:35:47 +08:00
|
|
|
g_message ("failed to run gradient callback function");
|
1998-11-05 07:30:18 +08:00
|
|
|
else
|
|
|
|
procedural_db_destroy_args (return_vals, nreturn_vals);
|
|
|
|
}
|
|
|
|
busy = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_select_close_callback (GtkWidget *widget,
|
1999-10-27 02:27:27 +08:00
|
|
|
gpointer data)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
GradSelectP gsp;
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gsp = (GradSelectP) data;
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (gsp->shell))
|
|
|
|
gtk_widget_hide (gsp->shell);
|
|
|
|
|
|
|
|
/* Free memory if poping down dialog which is not the main one */
|
1999-10-27 02:27:27 +08:00
|
|
|
if (gsp != gradient_select_dialog)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
grad_change_callbacks (gsp, 1);
|
|
|
|
gtk_widget_destroy (gsp->shell);
|
|
|
|
grad_select_free (gsp);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GradSelectP
|
1999-09-28 01:58:10 +08:00
|
|
|
gsel_new_selection (gchar *title,
|
|
|
|
gchar *initial_gradient)
|
1998-11-05 07:30:18 +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
|
|
|
GradSelectP gsp;
|
|
|
|
gradient_t *grad = NULL;
|
|
|
|
GSList *list;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *scrolled_win;
|
1998-11-05 07:30:18 +08:00
|
|
|
GdkColormap *colormap;
|
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
|
|
|
gint select_pos;
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
/* Load them if they are not already loaded */
|
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 (g_editor == NULL)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
grad_create_gradient_editor_init(FALSE);
|
|
|
|
}
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp = g_new (_GradSelect, 1);
|
1998-11-05 07:30:18 +08:00
|
|
|
gsp->callback_name = NULL;
|
|
|
|
|
|
|
|
/* The shell and main vbox */
|
1999-09-28 01:58:10 +08:00
|
|
|
gsp->shell = gimp_dialog_new (title ? title : _("Gradient Selection"),
|
|
|
|
"gradient_selection",
|
|
|
|
gimp_standard_help_func,
|
1999-10-03 21:50:19 +08:00
|
|
|
"dialogs/gradient_selection.html",
|
1999-09-28 01:58:10 +08:00
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
FALSE, TRUE, FALSE,
|
1999-01-11 07:20:33 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
_("Edit"), grad_select_edit_callback,
|
|
|
|
gsp, NULL, FALSE, FALSE,
|
|
|
|
_("Close"), grad_select_close_callback,
|
|
|
|
gsp, NULL, TRUE, TRUE,
|
|
|
|
|
|
|
|
NULL);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
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
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 1);
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gsp->shell)->vbox), vbox);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
/* clist preview of gradients */
|
1998-11-06 07:10:31 +08:00
|
|
|
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
|
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
|
|
|
gsp->clist = gtk_clist_new (2);
|
|
|
|
gtk_clist_set_shadow_type (GTK_CLIST (gsp->clist), GTK_SHADOW_IN);
|
|
|
|
|
|
|
|
gtk_clist_set_row_height (GTK_CLIST (gsp->clist), 18);
|
|
|
|
|
|
|
|
gtk_clist_set_column_width (GTK_CLIST (gsp->clist), 0, 52);
|
|
|
|
gtk_clist_set_column_title (GTK_CLIST (gsp->clist), 0, _("Gradient"));
|
|
|
|
gtk_clist_set_column_title (GTK_CLIST (gsp->clist), 1, _("Name"));
|
|
|
|
gtk_clist_column_titles_show (GTK_CLIST (gsp->clist));
|
1998-11-05 07:30:18 +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
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
1998-11-05 07:30:18 +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
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0);
|
1998-11-06 07:10:31 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_win), gsp->clist);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
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
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_ALWAYS);
|
1998-11-06 07:10:31 +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
|
|
|
gtk_widget_show (scrolled_win);
|
|
|
|
gtk_widget_show (gsp->clist);
|
1998-11-05 07:30:18 +08:00
|
|
|
gtk_widget_set_usize (gsp->clist, 200, 250);
|
|
|
|
|
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
|
|
|
colormap = gtk_widget_get_colormap (gsp->clist);
|
|
|
|
gdk_color_parse ("black", &gsp->black);
|
|
|
|
gdk_color_alloc (colormap, &gsp->black);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gsp->clist), "select_row",
|
|
|
|
GTK_SIGNAL_FUNC (sel_list_item_update),
|
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
|
|
|
(gpointer) gsp);
|
1998-11-05 07:30:18 +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 (initial_gradient && strlen (initial_gradient))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
for (list = gradients_list; list; list = g_slist_next (list))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
grad = (gradient_t *) list->data;
|
|
|
|
|
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 (strcmp (grad->name, initial_gradient) == 0)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
|
|
|
/* We found it! */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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 (grad == NULL)
|
1998-11-05 07:30:18 +08:00
|
|
|
grad = curr_gradient;
|
|
|
|
|
|
|
|
gsp->grad = grad;
|
|
|
|
|
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
|
|
|
gtk_widget_realize (gsp->shell);
|
|
|
|
gsp->gc = gdk_gc_new (gsp->shell->window);
|
1998-11-05 07:30:18 +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
|
|
|
select_pos = ed_set_list_of_gradients (gsp->gc,
|
|
|
|
gsp->clist,
|
|
|
|
grad);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
/* Now show the dialog */
|
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
|
|
|
gtk_widget_show (vbox);
|
|
|
|
gtk_widget_show (gsp->shell);
|
1998-11-05 07:30:18 +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 (select_pos != -1)
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_clist_moveto (GTK_CLIST (gsp->clist), select_pos, 0, 0.0, 0.0);
|
1998-11-05 07:30:18 +08:00
|
|
|
|
|
|
|
return gsp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-09-28 01:58:10 +08:00
|
|
|
grad_create_gradient_editor (void)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
if (gradient_select_dialog == NULL)
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gradient_select_dialog = gsel_new_selection (_("Gradients"), NULL);
|
1999-01-11 07:20:33 +08:00
|
|
|
|
|
|
|
/* register this one only */
|
1999-09-28 01:58:10 +08:00
|
|
|
dialog_register (gradient_select_dialog->shell);
|
1999-01-11 07:20:33 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
session_set_window_geometry (gradient_select_dialog->shell,
|
|
|
|
&gradient_select_session_info, TRUE);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
if (!GTK_WIDGET_VISIBLE (gradient_select_dialog->shell))
|
1998-11-05 07:30:18 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
gtk_widget_show (gradient_select_dialog->shell);
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
|
|
|
gdk_window_raise (gradient_select_dialog->shell->window);
|
|
|
|
}
|
1998-11-05 07:30:18 +08:00
|
|
|
}
|
|
|
|
}
|