mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-20 19:43:01 +00:00
app/Makefile.am app/gui/Makefile.am app/about_dialog.[ch]
2001-04-17 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gui/Makefile.am * app/about_dialog.[ch] * app/brush_edit.[ch] * app/brush_select.[ch] * app/channels_dialog.[ch] * app/color_area.[ch] * app/color_notebook.[ch] * app/color_select.[ch] * app/colormap_dialog.[ch] * app/commands.[ch] * app/file_new_dialog.[ch] * app/gradient_editor.[ch] * app/gradient_select.[ch] * app/indicator_area.[ch] * app/info_dialog.[ch] * app/info_window.[ch] * app/layer_select.[ch] * app/layers_dialog.[ch] * app/menus.[ch] * app/palette.[ch] * app/palette_import.[ch] * app/palette_select.[ch] * app/paths_dialog.[ch] * app/pattern_select.[ch] * app/preferences_dialog.[ch] * app/session.[ch] * app/test_commands.[ch] * app/tips_dialog.[ch] * app/toolbox.[ch]: moved to gui/ (s/_/-/ and some more useful filenames on the way). * app/app_procs.c * app/context_manager.c * app/convert.c * app/disp_callbacks.c * app/errorconsole.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/gdisplay.c * app/gimage.c * app/gimprc.c * app/image_new.c * app/interface.c * app/nav_window.c * app/path.c * app/plug_in.c * app/gui/dialogs-constructors.c * app/pdb/brush_select_cmds.c * app/pdb/convert_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/pattern_select_cmds.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpscaletool.c * app/tools/gimptransformtool.c * app/widgets/gimpcolorpanel.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * po/POTFILES.in: changed accordingly.
This commit is contained in:
parent
f283b957b1
commit
ddc9145256
68
ChangeLog
68
ChangeLog
|
@ -1,3 +1,71 @@
|
|||
2001-04-17 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
* app/gui/Makefile.am
|
||||
* app/about_dialog.[ch]
|
||||
* app/brush_edit.[ch]
|
||||
* app/brush_select.[ch]
|
||||
* app/channels_dialog.[ch]
|
||||
* app/color_area.[ch]
|
||||
* app/color_notebook.[ch]
|
||||
* app/color_select.[ch]
|
||||
* app/colormap_dialog.[ch]
|
||||
* app/commands.[ch]
|
||||
* app/file_new_dialog.[ch]
|
||||
* app/gradient_editor.[ch]
|
||||
* app/gradient_select.[ch]
|
||||
* app/indicator_area.[ch]
|
||||
* app/info_dialog.[ch]
|
||||
* app/info_window.[ch]
|
||||
* app/layer_select.[ch]
|
||||
* app/layers_dialog.[ch]
|
||||
* app/menus.[ch]
|
||||
* app/palette.[ch]
|
||||
* app/palette_import.[ch]
|
||||
* app/palette_select.[ch]
|
||||
* app/paths_dialog.[ch]
|
||||
* app/pattern_select.[ch]
|
||||
* app/preferences_dialog.[ch]
|
||||
* app/session.[ch]
|
||||
* app/test_commands.[ch]
|
||||
* app/tips_dialog.[ch]
|
||||
* app/toolbox.[ch]: moved to gui/ (s/_/-/ and some more useful
|
||||
filenames on the way).
|
||||
|
||||
* app/app_procs.c
|
||||
* app/context_manager.c
|
||||
* app/convert.c
|
||||
* app/disp_callbacks.c
|
||||
* app/errorconsole.c
|
||||
* app/file-open.c
|
||||
* app/file-save.c
|
||||
* app/file-utils.c
|
||||
* app/gdisplay.c
|
||||
* app/gimage.c
|
||||
* app/gimprc.c
|
||||
* app/image_new.c
|
||||
* app/interface.c
|
||||
* app/nav_window.c
|
||||
* app/path.c
|
||||
* app/plug_in.c
|
||||
* app/gui/dialogs-constructors.c
|
||||
* app/pdb/brush_select_cmds.c
|
||||
* app/pdb/convert_cmds.c
|
||||
* app/pdb/gradient_select_cmds.c
|
||||
* app/pdb/pattern_select_cmds.c
|
||||
* app/tools/gimpcolorpickertool.c
|
||||
* app/tools/gimpcroptool.c
|
||||
* app/tools/gimpmagnifytool.c
|
||||
* app/tools/gimpmeasuretool.c
|
||||
* app/tools/gimpscaletool.c
|
||||
* app/tools/gimptransformtool.c
|
||||
* app/widgets/gimpcolorpanel.c
|
||||
* tools/pdbgen/pdb/brush_select.pdb
|
||||
* tools/pdbgen/pdb/convert.pdb
|
||||
* tools/pdbgen/pdb/gradient_select.pdb
|
||||
* tools/pdbgen/pdb/pattern_select.pdb
|
||||
* po/POTFILES.in: changed accordingly.
|
||||
|
||||
2001-04-17 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/session.[ch]
|
||||
|
|
|
@ -22,61 +22,6 @@ endif
|
|||
bin_PROGRAMS = gimp
|
||||
|
||||
gimp_SOURCES = \
|
||||
about_dialog.c \
|
||||
about_dialog.h \
|
||||
brush_edit.c \
|
||||
brush_edit.h \
|
||||
brush_select.c \
|
||||
brush_select.h \
|
||||
channels_dialog.c \
|
||||
channels_dialog.h \
|
||||
color_area.c \
|
||||
color_area.h \
|
||||
color_notebook.c \
|
||||
color_notebook.h \
|
||||
color_select.c \
|
||||
color_select.h \
|
||||
colormap_dialog.c \
|
||||
colormap_dialog.h \
|
||||
commands.c \
|
||||
commands.h \
|
||||
file_new_dialog.c \
|
||||
file_new_dialog.h \
|
||||
gradient_editor.c \
|
||||
gradient_editor.h \
|
||||
gradient_select.h \
|
||||
gradient_select.c \
|
||||
indicator_area.c \
|
||||
indicator_area.h \
|
||||
info_dialog.c \
|
||||
info_dialog.h \
|
||||
info_window.c \
|
||||
info_window.h \
|
||||
layer_select.c \
|
||||
layer_select.h \
|
||||
layers_dialog.c \
|
||||
layers_dialog.h \
|
||||
menus.c \
|
||||
menus.h \
|
||||
palette.c \
|
||||
palette.h \
|
||||
palette_import.c \
|
||||
palette_import.h \
|
||||
palette_select.c \
|
||||
palette_select.h \
|
||||
paths_dialog.c \
|
||||
paths_dialog.h \
|
||||
preferences_dialog.c \
|
||||
preferences_dialog.h \
|
||||
session.c \
|
||||
session.h \
|
||||
test_commands.c \
|
||||
test_commands.h \
|
||||
tips_dialog.c \
|
||||
tips_dialog.h \
|
||||
toolbox.c \
|
||||
toolbox.h \
|
||||
\
|
||||
cursorutil.c \
|
||||
cursorutil.h \
|
||||
devices.c \
|
||||
|
@ -256,8 +201,6 @@ gimp_SOURCES = \
|
|||
path_bezier.h \
|
||||
path_bezier.c \
|
||||
pattern_header.h \
|
||||
pattern_select.c \
|
||||
pattern_select.h \
|
||||
pixel_processor.c \
|
||||
pixel_processor.h \
|
||||
pixel_region.c \
|
||||
|
|
|
@ -1,719 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "tools/gimptoolinfo.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "authors.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimphelp.h"
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber2.xpm"
|
||||
|
||||
|
||||
#define ANIMATION_STEPS 16
|
||||
#define ANIMATION_SIZE 2
|
||||
|
||||
static gboolean about_dialog_load_logo (GtkWidget *window);
|
||||
static void about_dialog_destroy (GtkObject *object,
|
||||
gpointer data);
|
||||
static void about_dialog_unmap (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static gint about_dialog_logo_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data);
|
||||
static gint about_dialog_button (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
static gint about_dialog_key (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data);
|
||||
static void about_dialog_tool_drop (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
gpointer data);
|
||||
static gint about_dialog_timer (gpointer data);
|
||||
|
||||
|
||||
static GtkWidget *about_dialog = NULL;
|
||||
static GtkWidget *logo_area = NULL;
|
||||
static GtkWidget *scroll_area = NULL;
|
||||
static GdkPixmap *logo_pixmap = NULL;
|
||||
static GdkPixmap *scroll_pixmap = NULL;
|
||||
static guchar *dissolve_map = NULL;
|
||||
static gint dissolve_width;
|
||||
static gint dissolve_height;
|
||||
static gint logo_width = 0;
|
||||
static gint logo_height = 0;
|
||||
static gboolean do_animation = FALSE;
|
||||
static gboolean do_scrolling = FALSE;
|
||||
static gint scroll_state = 0;
|
||||
static gint frame = 0;
|
||||
static gint offset = 0;
|
||||
static gint timer = 0;
|
||||
static gint hadja_state = 0;
|
||||
static gchar **scroll_text = authors;
|
||||
static gint nscroll_texts = sizeof (authors) / sizeof (authors[0]);
|
||||
static gint scroll_text_widths[sizeof (authors) / sizeof (authors[0])];
|
||||
static gint cur_scroll_text = 0;
|
||||
static gint cur_scroll_index = 0;
|
||||
static gint shuffle_array[sizeof (authors) / sizeof (authors[0])];
|
||||
|
||||
|
||||
static gchar *drop_text[] =
|
||||
{
|
||||
"We are The GIMP." ,
|
||||
"Prepare to be manipulated.",
|
||||
"Resistance is futile."
|
||||
};
|
||||
|
||||
static gchar *hadja_text[] =
|
||||
{
|
||||
"Hadjaha!",
|
||||
"Nej!",
|
||||
#ifndef GDK_USE_UTF8_MBS
|
||||
"Tvärtom!"
|
||||
#else
|
||||
"Tvärtom!"
|
||||
#endif
|
||||
};
|
||||
|
||||
void
|
||||
about_dialog_create (void)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *aboutframe;
|
||||
GtkWidget *label;
|
||||
GtkWidget *alignment;
|
||||
GtkStyle *style;
|
||||
GdkFont *font;
|
||||
gint max_width;
|
||||
gint i;
|
||||
gchar *label_text;
|
||||
|
||||
if (!about_dialog)
|
||||
{
|
||||
about_dialog = gtk_window_new (GTK_WINDOW_DIALOG);
|
||||
gtk_window_set_wmclass (GTK_WINDOW (about_dialog), "about_dialog", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (about_dialog), _("About the GIMP"));
|
||||
gtk_window_set_policy (GTK_WINDOW (about_dialog), FALSE, FALSE, FALSE);
|
||||
gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
|
||||
|
||||
gimp_help_connect_help_accel (about_dialog, gimp_standard_help_func,
|
||||
"dialogs/about.html");
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (about_dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC (about_dialog_destroy),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (about_dialog), "unmap_event",
|
||||
GTK_SIGNAL_FUNC (about_dialog_unmap),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (about_dialog), "button_press_event",
|
||||
GTK_SIGNAL_FUNC (about_dialog_button),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (about_dialog), "key_press_event",
|
||||
GTK_SIGNAL_FUNC (about_dialog_key),
|
||||
NULL);
|
||||
|
||||
/* dnd stuff */
|
||||
gimp_gtk_drag_dest_set_by_type (about_dialog,
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
GIMP_TYPE_TOOL_INFO,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_viewable_dest_set (about_dialog,
|
||||
GIMP_TYPE_TOOL_INFO,
|
||||
about_dialog_tool_drop, NULL);
|
||||
|
||||
gtk_widget_set_events (about_dialog, GDK_BUTTON_PRESS_MASK);
|
||||
|
||||
if (!about_dialog_load_logo (about_dialog))
|
||||
{
|
||||
gtk_widget_destroy (about_dialog);
|
||||
about_dialog = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 1);
|
||||
gtk_container_add (GTK_CONTAINER (about_dialog), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
aboutframe = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (aboutframe), 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0);
|
||||
gtk_widget_show (aboutframe);
|
||||
|
||||
logo_area = gtk_drawing_area_new ();
|
||||
gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event",
|
||||
GTK_SIGNAL_FUNC (about_dialog_logo_expose),
|
||||
NULL);
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area),
|
||||
logo_width, logo_height);
|
||||
gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK);
|
||||
gtk_container_add (GTK_CONTAINER (aboutframe), logo_area);
|
||||
gtk_widget_show (logo_area);
|
||||
|
||||
gtk_widget_realize (logo_area);
|
||||
gdk_window_set_background (logo_area->window, &logo_area->style->black);
|
||||
|
||||
/* this is a font, provide only one single font definition */
|
||||
font = gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
|
||||
if (font)
|
||||
{
|
||||
style = gtk_style_new ();
|
||||
gdk_font_unref (style->font);
|
||||
style->font = font;
|
||||
gdk_font_ref (style->font);
|
||||
gtk_widget_push_style (style);
|
||||
gtk_style_unref (style);
|
||||
}
|
||||
label_text = g_strdup_printf (_("Version %s brought to you by"),
|
||||
GIMP_VERSION);
|
||||
label = gtk_label_new (label_text);
|
||||
g_free (label_text);
|
||||
label_text = NULL;
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
label = gtk_label_new ("Spencer Kimball & Peter Mattis");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_widget_pop_style ();
|
||||
|
||||
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
|
||||
gtk_widget_show (alignment);
|
||||
|
||||
aboutframe = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (aboutframe), 0);
|
||||
gtk_container_add (GTK_CONTAINER (alignment), aboutframe);
|
||||
gtk_widget_show (aboutframe);
|
||||
|
||||
max_width = 0;
|
||||
for (i = 0; i < nscroll_texts; i++)
|
||||
{
|
||||
scroll_text_widths[i] = gdk_string_width (aboutframe->style->font,
|
||||
scroll_text[i]);
|
||||
max_width = MAX (max_width, scroll_text_widths[i]);
|
||||
}
|
||||
for (i = 0; i < (sizeof (drop_text) / sizeof (drop_text[0])); i++)
|
||||
{
|
||||
max_width = MAX (max_width,
|
||||
gdk_string_width (aboutframe->style->font, drop_text[i]));
|
||||
}
|
||||
for (i = 0; i < (sizeof (hadja_text) / sizeof (hadja_text[0])); i++)
|
||||
{
|
||||
max_width = MAX (max_width,
|
||||
gdk_string_width (aboutframe->style->font, hadja_text[i]));
|
||||
}
|
||||
scroll_area = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area),
|
||||
max_width + 10,
|
||||
aboutframe->style->font->ascent +
|
||||
aboutframe->style->font->descent);
|
||||
gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK);
|
||||
gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area);
|
||||
gtk_widget_show (scroll_area);
|
||||
|
||||
label = gtk_label_new (_("Please visit http://www.gimp.org/ for more info"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_widget_realize (scroll_area);
|
||||
gdk_window_set_background (scroll_area->window,
|
||||
&scroll_area->style->white);
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (about_dialog))
|
||||
{
|
||||
gtk_widget_show (about_dialog);
|
||||
|
||||
do_animation = TRUE;
|
||||
do_scrolling = FALSE;
|
||||
scroll_state = 0;
|
||||
frame = 0;
|
||||
offset = 0;
|
||||
cur_scroll_text = 0;
|
||||
|
||||
if (!double_speed && hadja_state != 7)
|
||||
{
|
||||
for (i = 0; i < nscroll_texts; i++)
|
||||
{
|
||||
shuffle_array[i] = i;
|
||||
}
|
||||
|
||||
for (i = 0; i < nscroll_texts; i++)
|
||||
{
|
||||
gint j;
|
||||
|
||||
j = rand() % nscroll_texts;
|
||||
if (i != j)
|
||||
{
|
||||
gint t;
|
||||
|
||||
t = shuffle_array[j];
|
||||
shuffle_array[j] = shuffle_array[i];
|
||||
shuffle_array[i] = t;
|
||||
}
|
||||
}
|
||||
cur_scroll_text = rand() % nscroll_texts;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_raise (about_dialog->window);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
about_dialog_load_logo (GtkWidget *window)
|
||||
{
|
||||
GtkWidget *preview;
|
||||
GdkGC *gc;
|
||||
gchar buf[1024];
|
||||
gchar *filename;
|
||||
guchar *pixelrow;
|
||||
FILE *fp;
|
||||
gint count;
|
||||
gint i, j, k;
|
||||
|
||||
if (logo_pixmap)
|
||||
return TRUE;
|
||||
|
||||
filename = g_strconcat (gimp_data_directory (),
|
||||
G_DIR_SEPARATOR_S,
|
||||
"gimp_logo.ppm",
|
||||
NULL);
|
||||
fp = fopen (filename, "rb");
|
||||
g_free (filename);
|
||||
|
||||
if (!fp)
|
||||
return FALSE;
|
||||
|
||||
fgets (buf, 1024, fp);
|
||||
|
||||
if (strncmp (buf, "P6", 2) != 0)
|
||||
{
|
||||
fclose (fp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fgets (buf, 1024, fp);
|
||||
fgets (buf, 1024, fp);
|
||||
sscanf (buf, "%d %d", &logo_width, &logo_height);
|
||||
|
||||
fgets (buf, 1024, fp);
|
||||
if (strncmp (buf, "255", 3) != 0)
|
||||
{
|
||||
fclose (fp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_size (GTK_PREVIEW (preview), logo_width, logo_height);
|
||||
pixelrow = g_new (guchar, logo_width * 3);
|
||||
|
||||
for (i = 0; i < logo_height; i++)
|
||||
{
|
||||
count = fread (pixelrow, sizeof (guchar), logo_width * 3, fp);
|
||||
if (count != (logo_width * 3))
|
||||
{
|
||||
gtk_widget_destroy (preview);
|
||||
g_free (pixelrow);
|
||||
fclose (fp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_preview_draw_row (GTK_PREVIEW (preview), pixelrow, 0, i, logo_width);
|
||||
}
|
||||
|
||||
gtk_widget_realize (window);
|
||||
logo_pixmap = gdk_pixmap_new (window->window, logo_width, logo_height,
|
||||
gtk_preview_get_visual ()->depth);
|
||||
gc = gdk_gc_new (logo_pixmap);
|
||||
gtk_preview_put (GTK_PREVIEW (preview),
|
||||
logo_pixmap, gc,
|
||||
0, 0, 0, 0, logo_width, logo_height);
|
||||
gdk_gc_destroy (gc);
|
||||
|
||||
gtk_widget_unref (preview);
|
||||
g_free (pixelrow);
|
||||
|
||||
fclose (fp);
|
||||
|
||||
dissolve_width =
|
||||
(logo_width / ANIMATION_SIZE) + (logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
|
||||
dissolve_height =
|
||||
(logo_height / ANIMATION_SIZE) + (logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
|
||||
|
||||
dissolve_map = g_new (guchar, dissolve_width * dissolve_height);
|
||||
|
||||
srand (time (NULL));
|
||||
|
||||
for (i = 0, k = 0; i < dissolve_height; i++)
|
||||
for (j = 0; j < dissolve_width; j++, k++)
|
||||
dissolve_map[k] = rand () % ANIMATION_STEPS;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_destroy (GtkObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
about_dialog = NULL;
|
||||
about_dialog_unmap (NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_unmap (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (timer)
|
||||
{
|
||||
gtk_timeout_remove (timer);
|
||||
timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
about_dialog_logo_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (do_animation)
|
||||
{
|
||||
if (!timer)
|
||||
{
|
||||
about_dialog_timer (widget);
|
||||
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we draw beyond the boundaries of the pixmap, then X
|
||||
will generate an expose area for those areas, starting
|
||||
an infinite cycle. We now set allow_grow = FALSE, so
|
||||
the drawing area can never be bigger than the preview.
|
||||
Otherwise, it would be necessary to intersect event->area
|
||||
with the pixmap boundary rectangle. */
|
||||
|
||||
gdk_draw_pixmap (widget->window,
|
||||
widget->style->black_gc,
|
||||
logo_pixmap,
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gint
|
||||
about_dialog_button (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (timer)
|
||||
gtk_timeout_remove (timer);
|
||||
timer = 0;
|
||||
frame = 0;
|
||||
|
||||
gtk_widget_hide (about_dialog);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gint
|
||||
about_dialog_key (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
gint i;
|
||||
|
||||
if (hadja_state == 7)
|
||||
return FALSE;
|
||||
|
||||
switch (event->keyval)
|
||||
{
|
||||
case GDK_h:
|
||||
case GDK_H:
|
||||
if (hadja_state == 0 || hadja_state == 5)
|
||||
hadja_state++;
|
||||
else
|
||||
hadja_state = 1;
|
||||
break;
|
||||
case GDK_a:
|
||||
case GDK_A:
|
||||
if (hadja_state == 1 || hadja_state == 4 || hadja_state == 6)
|
||||
hadja_state++;
|
||||
else
|
||||
hadja_state = 0;
|
||||
break;
|
||||
case GDK_d:
|
||||
case GDK_D:
|
||||
if (hadja_state == 2)
|
||||
hadja_state++;
|
||||
else
|
||||
hadja_state = 0;
|
||||
break;
|
||||
case GDK_j:
|
||||
case GDK_J:
|
||||
if (hadja_state == 3)
|
||||
hadja_state++;
|
||||
else
|
||||
hadja_state = 0;
|
||||
break;
|
||||
default:
|
||||
hadja_state = 0;
|
||||
}
|
||||
|
||||
if (hadja_state == 7)
|
||||
{
|
||||
scroll_text = hadja_text;
|
||||
nscroll_texts = sizeof (hadja_text) / sizeof (hadja_text[0]);
|
||||
|
||||
for (i = 0; i < nscroll_texts; i++)
|
||||
{
|
||||
shuffle_array[i] = i;
|
||||
scroll_text_widths[i] = gdk_string_width (scroll_area->style->font,
|
||||
scroll_text[i]);
|
||||
}
|
||||
|
||||
scroll_state = 0;
|
||||
cur_scroll_index = 0;
|
||||
cur_scroll_text = 0;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_tool_drop (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
GdkPixmap *pixmap = NULL;
|
||||
GdkBitmap *mask = NULL;
|
||||
gint width = 0;
|
||||
gint height = 0;
|
||||
gint i;
|
||||
|
||||
if (do_animation)
|
||||
return;
|
||||
|
||||
if (timer)
|
||||
gtk_timeout_remove (timer);
|
||||
|
||||
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
|
||||
|
||||
frame = 0;
|
||||
do_animation = TRUE;
|
||||
do_scrolling = FALSE;
|
||||
|
||||
gdk_draw_rectangle (logo_pixmap,
|
||||
logo_area->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
logo_area->allocation.width,
|
||||
logo_area->allocation.height);
|
||||
|
||||
pixmap =
|
||||
gdk_pixmap_create_from_xpm_d (widget->window,
|
||||
&mask,
|
||||
NULL,
|
||||
wilber2_xpm);
|
||||
|
||||
gdk_window_get_size (pixmap, &width, &height);
|
||||
|
||||
if (logo_area->allocation.width >= width &&
|
||||
logo_area->allocation.height >= height)
|
||||
{
|
||||
gint x, y;
|
||||
|
||||
x = (logo_area->allocation.width - width) / 2;
|
||||
y = (logo_area->allocation.height - height) / 2;
|
||||
|
||||
gdk_gc_set_clip_mask (logo_area->style->black_gc, mask);
|
||||
gdk_gc_set_clip_origin (logo_area->style->black_gc, x, y);
|
||||
|
||||
gdk_draw_pixmap (logo_pixmap,
|
||||
logo_area->style->black_gc,
|
||||
pixmap, 0, 0,
|
||||
x, y,
|
||||
width, height);
|
||||
|
||||
gdk_gc_set_clip_mask (logo_area->style->black_gc, NULL);
|
||||
gdk_gc_set_clip_origin (logo_area->style->black_gc, 0, 0);
|
||||
}
|
||||
|
||||
gdk_pixmap_unref (pixmap);
|
||||
gdk_bitmap_unref (mask);
|
||||
|
||||
scroll_text = drop_text;
|
||||
nscroll_texts = sizeof (drop_text) / sizeof (drop_text[0]);
|
||||
|
||||
for (i = 0; i < nscroll_texts; i++)
|
||||
{
|
||||
shuffle_array[i] = i;
|
||||
scroll_text_widths[i] = gdk_string_width (scroll_area->style->font,
|
||||
scroll_text[i]);
|
||||
}
|
||||
|
||||
scroll_state = 0;
|
||||
cur_scroll_index = 0;
|
||||
cur_scroll_text = 0;
|
||||
offset = 0;
|
||||
|
||||
double_speed = TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
about_dialog_timer (gpointer data)
|
||||
{
|
||||
gint i, j, k;
|
||||
gint return_val;
|
||||
|
||||
return_val = TRUE;
|
||||
|
||||
if (do_animation)
|
||||
{
|
||||
if (logo_area->allocation.width != 1)
|
||||
{
|
||||
for (i = 0, k = 0; i < dissolve_height; i++)
|
||||
for (j = 0; j < dissolve_width; j++, k++)
|
||||
if (frame == dissolve_map[k])
|
||||
{
|
||||
gdk_draw_pixmap (logo_area->window,
|
||||
logo_area->style->black_gc,
|
||||
logo_pixmap,
|
||||
j * ANIMATION_SIZE, i * ANIMATION_SIZE,
|
||||
j * ANIMATION_SIZE, i * ANIMATION_SIZE,
|
||||
ANIMATION_SIZE, ANIMATION_SIZE);
|
||||
}
|
||||
|
||||
frame += 1;
|
||||
|
||||
if (frame == ANIMATION_STEPS)
|
||||
{
|
||||
do_animation = FALSE;
|
||||
do_scrolling = TRUE;
|
||||
frame = 0;
|
||||
|
||||
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (do_scrolling)
|
||||
{
|
||||
if (!scroll_pixmap)
|
||||
scroll_pixmap = gdk_pixmap_new (scroll_area->window,
|
||||
scroll_area->allocation.width,
|
||||
scroll_area->allocation.height,
|
||||
-1);
|
||||
|
||||
switch (scroll_state)
|
||||
{
|
||||
case 1:
|
||||
scroll_state = 2;
|
||||
timer = gtk_timeout_add (700, about_dialog_timer, NULL);
|
||||
return_val = FALSE;
|
||||
break;
|
||||
case 2:
|
||||
scroll_state = 3;
|
||||
timer = gtk_timeout_add (75, about_dialog_timer, NULL);
|
||||
return_val = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (offset > (scroll_text_widths[cur_scroll_text] +
|
||||
scroll_area->allocation.width))
|
||||
{
|
||||
scroll_state = 0;
|
||||
cur_scroll_index += 1;
|
||||
if (cur_scroll_index == nscroll_texts)
|
||||
cur_scroll_index = 0;
|
||||
|
||||
cur_scroll_text = shuffle_array[cur_scroll_index];
|
||||
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
gdk_draw_rectangle (scroll_pixmap,
|
||||
scroll_area->style->white_gc,
|
||||
TRUE, 0, 0,
|
||||
scroll_area->allocation.width,
|
||||
scroll_area->allocation.height);
|
||||
gdk_draw_string (scroll_pixmap,
|
||||
scroll_area->style->font,
|
||||
scroll_area->style->black_gc,
|
||||
scroll_area->allocation.width - offset,
|
||||
scroll_area->style->font->ascent,
|
||||
scroll_text[cur_scroll_text]);
|
||||
gdk_draw_pixmap (scroll_area->window,
|
||||
scroll_area->style->black_gc,
|
||||
scroll_pixmap, 0, 0, 0, 0,
|
||||
scroll_area->allocation.width,
|
||||
scroll_area->allocation.height);
|
||||
|
||||
offset += 15;
|
||||
if (scroll_state == 0)
|
||||
{
|
||||
if (offset > ((scroll_area->allocation.width +
|
||||
scroll_text_widths[cur_scroll_text]) / 2))
|
||||
{
|
||||
scroll_state = 1;
|
||||
offset = (scroll_area->allocation.width +
|
||||
scroll_text_widths[cur_scroll_text]) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return return_val;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __ABOUT_DIALOG_H__
|
||||
#define __ABOUT_DIALOG_H__
|
||||
|
||||
void about_dialog_create (void);
|
||||
|
||||
#endif /* __ABOUT_DIALOG_H__ */
|
|
@ -33,10 +33,17 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "about_dialog.h"
|
||||
#include "about-dialog.h"
|
||||
#include "color-area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "errorconsole.h"
|
||||
#include "info-dialog.h"
|
||||
#include "info-window.h"
|
||||
#include "layer-select.h"
|
||||
#include "preferences-dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
|
@ -44,7 +51,6 @@
|
|||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
#include "equalize.h"
|
||||
#include "errorconsole.h"
|
||||
#include "file-open.h"
|
||||
#include "file-save.h"
|
||||
#include "floating_sel.h"
|
||||
|
@ -60,20 +66,15 @@
|
|||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "image_render.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "nav_window.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "module_db.h"
|
||||
#include "plug_in.h"
|
||||
#include "preferences_dialog.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "selection.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "toolbox.h"
|
||||
#include "undo.h"
|
||||
#include "undo_history.h"
|
||||
|
|
|
@ -79,29 +79,30 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "gui/brush-select.h"
|
||||
#include "gui/gradient-select.h"
|
||||
#include "gui/menus.h"
|
||||
#include "gui/pattern-select.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "brush_select.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "general.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "gradient_select.h"
|
||||
#include "menus.h"
|
||||
#include "pattern_select.h"
|
||||
#include "plug_in.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gui/gui.h"
|
||||
#include "gui/splash.h"
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "pdb/internal_procs.h"
|
||||
|
@ -57,10 +54,20 @@
|
|||
#include "tools/hue_saturation.h"
|
||||
#include "tools/levels.h"
|
||||
|
||||
#include "gui/color-notebook.h"
|
||||
#include "gui/color-select.h"
|
||||
#include "gui/colormap-dialog.h"
|
||||
#include "gui/brush-select.h"
|
||||
#include "gui/gui.h"
|
||||
#include "gui/gradient-select.h"
|
||||
#include "gui/palette-editor.h"
|
||||
#include "gui/pattern-select.h"
|
||||
#include "gui/splash.h"
|
||||
#include "gui/tips-dialog.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "batch.h"
|
||||
#include "brush_select.h"
|
||||
#include "color_transfer.h"
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
|
@ -75,29 +82,22 @@
|
|||
#include "gimprc.h"
|
||||
#include "gimpparasite.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient_select.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "palette.h"
|
||||
#include "pattern_select.h"
|
||||
#include "plug_in.h"
|
||||
#include "module_db.h"
|
||||
|
||||
#include "temp_buf.h"
|
||||
#include "tile_swap.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "undo.h"
|
||||
#include "unitrc.h"
|
||||
#include "xcf.h"
|
||||
#include "errors.h"
|
||||
#include "docindex.h"
|
||||
#include "colormap_dialog.h"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "color_notebook.h"
|
||||
#include "color_select.h"
|
||||
#include "gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
415
app/brush_edit.c
415
app/brush_edit.c
|
@ -1,415 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* brush_edit module Copyright 1998 Jay Cox <jaycox@earthlink.net>
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimpbrushgenerated.h"
|
||||
#include "brush_edit.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
struct _BrushEditGeneratedWindow
|
||||
{
|
||||
GtkWidget *shell;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *scale_label;
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *name;
|
||||
GtkAdjustment *radius_data;
|
||||
GtkAdjustment *hardness_data;
|
||||
GtkAdjustment *angle_data;
|
||||
GtkAdjustment *aspect_ratio_data;
|
||||
|
||||
/* Brush preview */
|
||||
GtkWidget *brush_preview;
|
||||
GimpBrushGenerated *brush;
|
||||
gint scale;
|
||||
};
|
||||
|
||||
|
||||
static void brush_edit_close_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void brush_edit_name_activate (GtkWidget *widget,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
static void brush_edit_name_focus_out (GtkWidget *wid1,
|
||||
GtkWidget *wid2,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
static void brush_edit_update_brush (GtkAdjustment *adjustment,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
static gint brush_edit_preview_resize (GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
|
||||
static void brush_edit_clear_preview (BrushEditGeneratedWindow *begw);
|
||||
static gint brush_edit_brush_dirty (GimpBrush *brush,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
static void brush_name_changed_callback (GtkWidget *widget,
|
||||
BrushEditGeneratedWindow *begw);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
BrushEditGeneratedWindow *
|
||||
brush_edit_generated_new (void)
|
||||
{
|
||||
BrushEditGeneratedWindow *begw;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *slider;
|
||||
GtkWidget *table;
|
||||
|
||||
begw = g_new0 (BrushEditGeneratedWindow, 1);
|
||||
|
||||
begw->shell = gimp_dialog_new (_("Brush Editor"), "generated_brush_editor",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/brush_editor.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
|
||||
"_delete_event_", brush_edit_close_callback,
|
||||
begw, NULL, NULL, TRUE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (begw->shell)->vbox)), 0)));
|
||||
|
||||
gtk_widget_hide (GTK_DIALOG (begw->shell)->action_area);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (begw->shell)->vbox), vbox);
|
||||
|
||||
/* Brush's name */
|
||||
begw->name = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), begw->name, FALSE, FALSE, 0);
|
||||
gtk_widget_show (begw->name);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (begw->name), "activate",
|
||||
GTK_SIGNAL_FUNC (brush_edit_name_activate),
|
||||
begw);
|
||||
gtk_signal_connect (GTK_OBJECT (begw->name), "focus_out_event",
|
||||
GTK_SIGNAL_FUNC (brush_edit_name_focus_out),
|
||||
begw);
|
||||
|
||||
/* brush's preview widget w/frame */
|
||||
begw->frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (begw->frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), begw->frame, TRUE, TRUE, 0);
|
||||
|
||||
begw->preview = gtk_preview_new (GTK_PREVIEW_GRAYSCALE);
|
||||
gtk_preview_size (GTK_PREVIEW (begw->preview), 125, 100);
|
||||
gtk_signal_connect_after (GTK_OBJECT (begw->frame), "size_allocate",
|
||||
GTK_SIGNAL_FUNC (brush_edit_preview_resize),
|
||||
begw);
|
||||
gtk_container_add (GTK_CONTAINER (begw->frame), begw->preview);
|
||||
|
||||
gtk_widget_show (begw->preview);
|
||||
gtk_widget_show (begw->frame);
|
||||
|
||||
/* table for sliders/labels */
|
||||
begw->scale_label = gtk_label_new ("-1:1");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), begw->scale_label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (begw->scale_label);
|
||||
|
||||
begw->scale = -1;
|
||||
|
||||
/* table for sliders/labels */
|
||||
table = gtk_table_new (4, 2, FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
|
||||
/* brush radius scale */
|
||||
begw->radius_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new (10.0, 0.0, 100.0, 0.1, 1.0, 0.0));
|
||||
slider = gtk_hscale_new (begw->radius_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (begw->radius_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (brush_edit_update_brush),
|
||||
begw);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Radius:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
/* brush hardness scale */
|
||||
begw->hardness_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0, 0.01, 0.01, 0.0));
|
||||
slider = gtk_hscale_new (begw->hardness_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (begw->hardness_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (brush_edit_update_brush),
|
||||
begw);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Hardness:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
/* brush aspect ratio scale */
|
||||
begw->aspect_ratio_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 1.0, 20.0, 0.1, 1.0, 0.0));
|
||||
slider = gtk_hscale_new (begw->aspect_ratio_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (begw->aspect_ratio_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (brush_edit_update_brush),
|
||||
begw);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
|
||||
_("Aspect Ratio:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
/* brush angle scale */
|
||||
begw->angle_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new (00.0, 0.0, 180.0, 0.1, 1.0, 0.0));
|
||||
slider = gtk_hscale_new (begw->angle_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (begw->angle_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (brush_edit_update_brush),
|
||||
begw);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Angle:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||
gtk_widget_show (table);
|
||||
|
||||
gtk_widget_show (vbox);
|
||||
gtk_widget_show (begw->shell);
|
||||
|
||||
return begw;
|
||||
}
|
||||
|
||||
void
|
||||
brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw,
|
||||
GimpBrush *gbrush)
|
||||
{
|
||||
GimpBrushGenerated *brush = NULL;
|
||||
|
||||
g_return_if_fail (begw != NULL);
|
||||
|
||||
if (begw->brush == (GimpBrushGenerated *) gbrush)
|
||||
return;
|
||||
|
||||
if (begw->brush)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (begw->brush), begw);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (begw->brush));
|
||||
begw->brush = NULL;
|
||||
}
|
||||
|
||||
if (!gbrush || !GIMP_IS_BRUSH_GENERATED (gbrush))
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (begw->shell))
|
||||
gtk_widget_hide (begw->shell);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
brush = GIMP_BRUSH_GENERATED (gbrush);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (brush), "invalidate_preview",
|
||||
GTK_SIGNAL_FUNC (brush_edit_brush_dirty),
|
||||
begw);
|
||||
gtk_signal_connect (GTK_OBJECT (brush), "name_changed",
|
||||
GTK_SIGNAL_FUNC (brush_name_changed_callback),
|
||||
begw);
|
||||
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (begw->radius_data),
|
||||
gimp_brush_generated_get_radius (brush));
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (begw->hardness_data),
|
||||
gimp_brush_generated_get_hardness (brush));
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (begw->angle_data),
|
||||
gimp_brush_generated_get_angle (brush));
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (begw->aspect_ratio_data),
|
||||
gimp_brush_generated_get_aspect_ratio (brush));
|
||||
gtk_entry_set_text (GTK_ENTRY (begw->name),
|
||||
gimp_object_get_name (GIMP_OBJECT (gbrush)));
|
||||
|
||||
begw->brush = brush;
|
||||
gtk_object_ref (GTK_OBJECT (begw->brush));
|
||||
|
||||
brush_edit_brush_dirty (GIMP_BRUSH (brush), begw);
|
||||
|
||||
if (! GTK_WIDGET_VISIBLE (begw->shell))
|
||||
gtk_widget_show (begw->shell);
|
||||
else
|
||||
gdk_window_raise (begw->shell->window);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
brush_edit_close_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
BrushEditGeneratedWindow *begw = (BrushEditGeneratedWindow *) data;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (begw->shell))
|
||||
gtk_widget_hide (begw->shell);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_edit_name_activate (GtkWidget *widget,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
gchar *entry_text;
|
||||
|
||||
entry_text = gtk_entry_get_text (GTK_ENTRY (widget));
|
||||
gimp_object_set_name (GIMP_OBJECT (begw->brush), entry_text);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_edit_name_focus_out (GtkWidget *wid1,
|
||||
GtkWidget *wid2,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
brush_edit_name_activate (wid1, begw);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_edit_update_brush (GtkAdjustment *adjustment,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
if (begw->brush &&
|
||||
((begw->radius_data->value
|
||||
!= gimp_brush_generated_get_radius (begw->brush))
|
||||
|| (begw->hardness_data->value
|
||||
!= gimp_brush_generated_get_hardness (begw->brush))
|
||||
|| (begw->aspect_ratio_data->value
|
||||
!= gimp_brush_generated_get_aspect_ratio (begw->brush))
|
||||
|| (begw->angle_data->value
|
||||
!= gimp_brush_generated_get_angle (begw->brush))))
|
||||
{
|
||||
gimp_brush_generated_freeze (begw->brush);
|
||||
gimp_brush_generated_set_radius (begw->brush,
|
||||
begw->radius_data->value);
|
||||
gimp_brush_generated_set_hardness (begw->brush,
|
||||
begw->hardness_data->value);
|
||||
gimp_brush_generated_set_aspect_ratio (begw->brush,
|
||||
begw->aspect_ratio_data->value);
|
||||
gimp_brush_generated_set_angle (begw->brush,
|
||||
begw->angle_data->value);
|
||||
gimp_brush_generated_thaw (begw->brush);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
brush_edit_preview_resize (GtkWidget *widget,
|
||||
GtkAllocation *allocation,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
gtk_preview_size (GTK_PREVIEW (begw->preview),
|
||||
widget->allocation.width - 4,
|
||||
widget->allocation.height - 4);
|
||||
|
||||
/* update the display */
|
||||
if (begw->brush)
|
||||
brush_edit_brush_dirty (GIMP_BRUSH (begw->brush), begw);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
brush_edit_clear_preview (BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
guchar *buf;
|
||||
gint i;
|
||||
|
||||
buf = g_new (guchar, begw->preview->requisition.width);
|
||||
|
||||
/* Set the buffer to white */
|
||||
memset (buf, 255, begw->preview->requisition.width);
|
||||
|
||||
/* Set the image buffer to white */
|
||||
for (i = 0; i < begw->preview->requisition.height; i++)
|
||||
gtk_preview_draw_row (GTK_PREVIEW (begw->preview), buf, 0, i,
|
||||
begw->preview->requisition.width);
|
||||
|
||||
g_free (buf);
|
||||
}
|
||||
|
||||
static gint
|
||||
brush_edit_brush_dirty (GimpBrush *brush,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
gint x, y, width, yend, ystart, xo;
|
||||
gint scale;
|
||||
gchar *src, *buf;
|
||||
|
||||
brush_edit_clear_preview (begw);
|
||||
if (brush == NULL || brush->mask == NULL)
|
||||
return TRUE;
|
||||
scale = MAX (ceil (brush->mask->width/
|
||||
(float) begw->preview->requisition.width),
|
||||
ceil (brush->mask->height/
|
||||
(float) begw->preview->requisition.height));
|
||||
|
||||
ystart = 0;
|
||||
xo = begw->preview->requisition.width/2 - brush->mask->width/(2*scale);
|
||||
ystart = begw->preview->requisition.height/2 - brush->mask->height/(2*scale);
|
||||
yend = ystart + brush->mask->height/(scale);
|
||||
width = CLAMP (brush->mask->width/scale, 0, begw->preview->requisition.width);
|
||||
|
||||
buf = g_new (gchar, width);
|
||||
src = (gchar *) temp_buf_data (brush->mask);
|
||||
|
||||
for (y = ystart; y < yend; y++)
|
||||
{
|
||||
/* Invert the mask for display.
|
||||
*/
|
||||
for (x = 0; x < width; x++)
|
||||
buf[x] = 255 - src[x*scale];
|
||||
gtk_preview_draw_row (GTK_PREVIEW (begw->preview), (guchar *)buf, xo, y,
|
||||
width);
|
||||
src += brush->mask->width*scale;
|
||||
}
|
||||
g_free (buf);
|
||||
if (begw->scale != scale)
|
||||
{
|
||||
gchar str[255];
|
||||
begw->scale = scale;
|
||||
g_snprintf (str, sizeof (str), "%d:1", scale);
|
||||
gtk_label_set_text (GTK_LABEL (begw->scale_label), str);
|
||||
gtk_widget_draw (begw->scale_label, NULL);
|
||||
}
|
||||
gtk_widget_draw (begw->preview, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
brush_name_changed_callback (GtkWidget *widget,
|
||||
BrushEditGeneratedWindow *begw)
|
||||
{
|
||||
gtk_entry_set_text (GTK_ENTRY (begw->name),
|
||||
gimp_object_get_name (GIMP_OBJECT (begw->brush)));
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* brush_edit module Copyright 1998 Jay Cox <jaycox@earthlink.net>
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BRUSH_EDIT_H__
|
||||
#define __BRUSH_EDIT_H__
|
||||
|
||||
|
||||
typedef struct _BrushEditGeneratedWindow BrushEditGeneratedWindow;
|
||||
|
||||
|
||||
BrushEditGeneratedWindow * brush_edit_generated_new (void);
|
||||
|
||||
void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw,
|
||||
GimpBrush *brush);
|
||||
void brush_edit_generated_free (BrushEditGeneratedWindow *begw);
|
||||
|
||||
|
||||
#endif /* __BRUSH_EDIT_H__ */
|
|
@ -1,632 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "brush_edit.h"
|
||||
#include "brush_select.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpbrushgenerated.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdata.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimprc.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define MIN_CELL_SIZE 25
|
||||
#define STD_BRUSH_COLUMNS 5
|
||||
#define STD_BRUSH_ROWS 5
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
static void brush_select_change_callbacks (BrushSelect *bsp,
|
||||
gboolean closing);
|
||||
|
||||
static void brush_select_brush_changed (GimpContext *context,
|
||||
GimpBrush *brush,
|
||||
BrushSelect *bsp);
|
||||
static void brush_select_opacity_changed (GimpContext *context,
|
||||
gdouble opacity,
|
||||
BrushSelect *bsp);
|
||||
static void brush_select_paint_mode_changed (GimpContext *context,
|
||||
LayerModeEffects paint_mode,
|
||||
BrushSelect *bsp);
|
||||
static void brush_select_brush_renamed_callback (GimpBrush *brush,
|
||||
BrushSelect *bsp);
|
||||
|
||||
static void brush_select_update_active_brush_field (BrushSelect *bsp);
|
||||
|
||||
static void opacity_scale_update (GtkAdjustment *adj,
|
||||
gpointer data);
|
||||
static void paint_mode_menu_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void spacing_scale_update (GtkAdjustment *adj,
|
||||
gpointer data);
|
||||
|
||||
static void brush_select_close_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void brush_select_edit_brush (GimpData *data);
|
||||
|
||||
|
||||
/* list of active dialogs */
|
||||
GSList *brush_active_dialogs = NULL;
|
||||
|
||||
/* the main brush selection dialog */
|
||||
BrushSelect *brush_select_dialog = NULL;
|
||||
|
||||
|
||||
/* the main brush editor dialog */
|
||||
static BrushEditGeneratedWindow *brush_edit_generated_dialog = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
GtkWidget *
|
||||
brush_dialog_create (void)
|
||||
{
|
||||
if (! brush_select_dialog)
|
||||
{
|
||||
brush_select_dialog = brush_select_new (NULL, NULL, 0.0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_VISIBLE (brush_select_dialog->shell))
|
||||
gtk_widget_show (brush_select_dialog->shell);
|
||||
else
|
||||
gdk_window_raise (brush_select_dialog->shell->window);
|
||||
}
|
||||
|
||||
return brush_select_dialog->shell;
|
||||
}
|
||||
|
||||
void
|
||||
brush_dialog_free (void)
|
||||
{
|
||||
if (brush_select_dialog)
|
||||
{
|
||||
brush_select_free (brush_select_dialog);
|
||||
brush_select_dialog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* If title == NULL then it is the main brush dialog */
|
||||
BrushSelect *
|
||||
brush_select_new (gchar *title,
|
||||
/* These are the required initial vals
|
||||
* If init_name == NULL then use current brush
|
||||
*/
|
||||
gchar *init_name,
|
||||
gdouble init_opacity,
|
||||
gint init_spacing,
|
||||
gint init_mode)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
GtkWidget *main_vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *sep;
|
||||
GtkWidget *table;
|
||||
GtkWidget *slider;
|
||||
|
||||
GimpBrush *active = NULL;
|
||||
|
||||
static gboolean first_call = TRUE;
|
||||
|
||||
bsp = g_new0 (BrushSelect, 1);
|
||||
|
||||
/* The shell */
|
||||
bsp->shell = gimp_dialog_new (title ? title : _("Brush Selection"),
|
||||
"brush_selection",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/brush_selection.html",
|
||||
title ? GTK_WIN_POS_MOUSE : GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
|
||||
"_delete_event_", brush_select_close_callback,
|
||||
bsp, NULL, NULL, TRUE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (bsp->shell)->vbox)), 0)));
|
||||
|
||||
gtk_widget_hide (GTK_DIALOG (bsp->shell)->action_area);
|
||||
|
||||
if (title)
|
||||
{
|
||||
bsp->context = gimp_context_new (title, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
bsp->context = gimp_context_get_user ();
|
||||
|
||||
dialog_register (bsp->shell);
|
||||
}
|
||||
|
||||
if (no_data && first_call)
|
||||
gimp_data_factory_data_init (global_brush_factory, FALSE);
|
||||
|
||||
first_call = FALSE;
|
||||
|
||||
if (title && init_name && strlen (init_name))
|
||||
{
|
||||
active = (GimpBrush *)
|
||||
gimp_container_get_child_by_name (global_brush_factory->container,
|
||||
init_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
active = gimp_context_get_brush (gimp_context_get_user ());
|
||||
}
|
||||
|
||||
if (!active)
|
||||
active = gimp_context_get_brush (gimp_context_get_standard ());
|
||||
|
||||
if (title)
|
||||
{
|
||||
gimp_context_set_brush (bsp->context, active);
|
||||
gimp_context_set_paint_mode (bsp->context, init_mode);
|
||||
gimp_context_set_opacity (bsp->context, init_opacity);
|
||||
bsp->spacing_value = init_spacing;
|
||||
}
|
||||
|
||||
/* The main vbox */
|
||||
main_vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (bsp->shell)->vbox), main_vbox);
|
||||
|
||||
/* Create the active brush label */
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 2);
|
||||
|
||||
bsp->brush_name = gtk_label_new (_("No Brushes available"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bsp->brush_name, FALSE, FALSE, 4);
|
||||
bsp->brush_size = gtk_label_new ("(0 x 0)");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), bsp->brush_size, FALSE, FALSE, 2);
|
||||
|
||||
gtk_widget_show (bsp->brush_name);
|
||||
gtk_widget_show (bsp->brush_size);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
/* The Brush Grid */
|
||||
bsp->view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID,
|
||||
global_brush_factory,
|
||||
brush_select_edit_brush,
|
||||
bsp->context,
|
||||
MIN_CELL_SIZE,
|
||||
STD_BRUSH_COLUMNS,
|
||||
STD_BRUSH_ROWS);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), bsp->view, TRUE, TRUE, 0);
|
||||
gtk_widget_show (bsp->view);
|
||||
|
||||
/* The vbox for the paint options */
|
||||
bsp->paint_options_box = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (bsp->view), bsp->paint_options_box,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
/* Create the frame and the table for the options */
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_box_pack_start (GTK_BOX (bsp->paint_options_box), table, FALSE, FALSE, 2);
|
||||
|
||||
/* Create the opacity scale widget */
|
||||
bsp->opacity_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new
|
||||
(gimp_context_get_opacity (bsp->context) * 100.0,
|
||||
0.0, 100.0, 1.0, 1.0, 0.0));
|
||||
slider = gtk_hscale_new (bsp->opacity_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (bsp->opacity_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (opacity_scale_update),
|
||||
bsp);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Opacity:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
/* Create the paint mode option menu */
|
||||
bsp->option_menu =
|
||||
paint_mode_menu_new (paint_mode_menu_callback, (gpointer) bsp, TRUE,
|
||||
gimp_context_get_paint_mode (bsp->context));
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Mode:"), 1.0, 0.5,
|
||||
bsp->option_menu, 1, TRUE);
|
||||
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (bsp->paint_options_box);
|
||||
|
||||
/* A separator after the paint options */
|
||||
sep = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (bsp->paint_options_box), sep, FALSE, FALSE, 0);
|
||||
gtk_widget_show (sep);
|
||||
|
||||
/* Create the spacing scale widget */
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||
gtk_box_pack_end (GTK_BOX (bsp->view), table, FALSE, FALSE, 0);
|
||||
|
||||
bsp->spacing_data =
|
||||
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 1000.0, 1.0, 1.0, 0.0));
|
||||
slider = gtk_hscale_new (bsp->spacing_data);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
if (title && init_spacing >= 0)
|
||||
{
|
||||
/* Use passed spacing instead of brushes default */
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (bsp->spacing_data),
|
||||
init_spacing);
|
||||
}
|
||||
gtk_signal_connect (GTK_OBJECT (bsp->spacing_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (spacing_scale_update),
|
||||
bsp);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Spacing:"), 1.0, 1.0,
|
||||
slider, 1, FALSE);
|
||||
|
||||
gtk_widget_show (table);
|
||||
|
||||
gtk_widget_show (main_vbox);
|
||||
|
||||
/* add callbacks to keep the display area current */
|
||||
bsp->name_changed_handler_id =
|
||||
gimp_container_add_handler
|
||||
(global_brush_factory->container, "name_changed",
|
||||
GTK_SIGNAL_FUNC (brush_select_brush_renamed_callback),
|
||||
bsp);
|
||||
|
||||
/* Only for main dialog */
|
||||
if (! title)
|
||||
{
|
||||
/* if we are in per-tool paint options mode, hide the paint options */
|
||||
brush_select_show_paint_options (bsp, global_paint_options);
|
||||
}
|
||||
|
||||
gtk_widget_show (bsp->shell);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (bsp->context), "brush_changed",
|
||||
GTK_SIGNAL_FUNC (brush_select_brush_changed),
|
||||
bsp);
|
||||
gtk_signal_connect (GTK_OBJECT (bsp->context), "opacity_changed",
|
||||
GTK_SIGNAL_FUNC (brush_select_opacity_changed),
|
||||
bsp);
|
||||
gtk_signal_connect (GTK_OBJECT (bsp->context), "paint_mode_changed",
|
||||
GTK_SIGNAL_FUNC (brush_select_paint_mode_changed),
|
||||
bsp);
|
||||
|
||||
if (active)
|
||||
brush_select_update_active_brush_field (bsp);
|
||||
|
||||
/* Add to active brush dialogs list */
|
||||
brush_active_dialogs = g_slist_append (brush_active_dialogs, bsp);
|
||||
|
||||
return bsp;
|
||||
}
|
||||
|
||||
void
|
||||
brush_select_free (BrushSelect *bsp)
|
||||
{
|
||||
if (!bsp)
|
||||
return;
|
||||
|
||||
/* remove from active list */
|
||||
brush_active_dialogs = g_slist_remove (brush_active_dialogs, bsp);
|
||||
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (bsp->context), bsp);
|
||||
|
||||
if (bsp->callback_name)
|
||||
{
|
||||
g_free (bsp->callback_name);
|
||||
gtk_object_unref (GTK_OBJECT (bsp->context));
|
||||
}
|
||||
|
||||
gimp_container_remove_handler (global_brush_factory->container,
|
||||
bsp->name_changed_handler_id);
|
||||
|
||||
g_free (bsp);
|
||||
}
|
||||
|
||||
void
|
||||
brush_select_show_paint_options (BrushSelect *bsp,
|
||||
gboolean show)
|
||||
{
|
||||
if ((bsp == NULL) && ((bsp = brush_select_dialog) == NULL))
|
||||
return;
|
||||
|
||||
if (show)
|
||||
{
|
||||
if (! GTK_WIDGET_VISIBLE (bsp->paint_options_box))
|
||||
gtk_widget_show (bsp->paint_options_box);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (bsp->paint_options_box))
|
||||
gtk_widget_hide (bsp->paint_options_box);
|
||||
}
|
||||
}
|
||||
|
||||
/* call this dialog's PDB callback */
|
||||
|
||||
static void
|
||||
brush_select_change_callbacks (BrushSelect *bsp,
|
||||
gboolean closing)
|
||||
{
|
||||
gchar *name;
|
||||
ProcRecord *prec = NULL;
|
||||
GimpBrush *brush;
|
||||
gint nreturn_vals;
|
||||
|
||||
static gboolean busy = FALSE;
|
||||
|
||||
/* Any procs registered to callback? */
|
||||
Argument *return_vals;
|
||||
|
||||
if (!bsp || !bsp->callback_name || busy)
|
||||
return;
|
||||
|
||||
busy = TRUE;
|
||||
name = bsp->callback_name;
|
||||
brush = gimp_context_get_brush (bsp->context);
|
||||
|
||||
/* If its still registered run it */
|
||||
prec = procedural_db_lookup (name);
|
||||
|
||||
if (prec && brush)
|
||||
{
|
||||
return_vals =
|
||||
procedural_db_run_proc (name,
|
||||
&nreturn_vals,
|
||||
PDB_STRING, GIMP_OBJECT (brush)->name,
|
||||
PDB_FLOAT, gimp_context_get_opacity (bsp->context),
|
||||
PDB_INT32, bsp->spacing_value,
|
||||
PDB_INT32, (gint) gimp_context_get_paint_mode (bsp->context),
|
||||
PDB_INT32, brush->mask->width,
|
||||
PDB_INT32, brush->mask->height,
|
||||
PDB_INT32, (brush->mask->width *
|
||||
brush->mask->height),
|
||||
PDB_INT8ARRAY, temp_buf_data (brush->mask),
|
||||
PDB_INT32, (gint) closing,
|
||||
PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != PDB_SUCCESS)
|
||||
g_message ("failed to run brush callback function");
|
||||
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
}
|
||||
busy = FALSE;
|
||||
}
|
||||
|
||||
/* Close active dialogs that no longer have PDB registered for them */
|
||||
|
||||
void
|
||||
brush_select_dialogs_check (void)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
GSList *list;
|
||||
gchar *name;
|
||||
ProcRecord *prec = NULL;
|
||||
|
||||
list = brush_active_dialogs;
|
||||
|
||||
while (list)
|
||||
{
|
||||
bsp = (BrushSelect *) list->data;
|
||||
list = g_slist_next (list);
|
||||
|
||||
name = bsp->callback_name;
|
||||
|
||||
if (name)
|
||||
{
|
||||
prec = procedural_db_lookup (name);
|
||||
|
||||
if (!prec)
|
||||
{
|
||||
/* Can alter brush_active_dialogs list */
|
||||
brush_select_close_callback (NULL, bsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
|
||||
static void
|
||||
brush_select_brush_changed (GimpContext *context,
|
||||
GimpBrush *brush,
|
||||
BrushSelect *bsp)
|
||||
{
|
||||
if (brush)
|
||||
{
|
||||
brush_select_update_active_brush_field (bsp);
|
||||
|
||||
gtk_widget_set_sensitive (GIMP_DATA_FACTORY_VIEW (bsp->view)->edit_button,
|
||||
GIMP_IS_BRUSH_GENERATED (brush));
|
||||
|
||||
if (bsp->callback_name)
|
||||
brush_select_change_callbacks (bsp, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_opacity_changed (GimpContext *context,
|
||||
gdouble opacity,
|
||||
BrushSelect *bsp)
|
||||
{
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (bsp->opacity_data), bsp);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (bsp->opacity_data),
|
||||
opacity * 100.0);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (bsp->opacity_data), bsp);
|
||||
|
||||
if (bsp->callback_name)
|
||||
brush_select_change_callbacks (bsp, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_paint_mode_changed (GimpContext *context,
|
||||
LayerModeEffects paint_mode,
|
||||
BrushSelect *bsp)
|
||||
{
|
||||
gimp_option_menu_set_history (GTK_OPTION_MENU (bsp->option_menu),
|
||||
(gpointer) paint_mode);
|
||||
|
||||
if (bsp->callback_name)
|
||||
brush_select_change_callbacks (bsp, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_brush_renamed_callback (GimpBrush *brush,
|
||||
BrushSelect *bsp)
|
||||
{
|
||||
brush_select_update_active_brush_field (bsp);
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_update_active_brush_field (BrushSelect *bsp)
|
||||
{
|
||||
GimpBrush *brush;
|
||||
gchar buf[32];
|
||||
|
||||
brush = gimp_context_get_brush (bsp->context);
|
||||
|
||||
if (!brush)
|
||||
return;
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (bsp->brush_name), GIMP_OBJECT (brush)->name);
|
||||
|
||||
g_snprintf (buf, sizeof (buf), "(%d x %d)",
|
||||
brush->mask->width,
|
||||
brush->mask->height);
|
||||
gtk_label_set_text (GTK_LABEL (bsp->brush_size), buf);
|
||||
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (bsp->spacing_data),
|
||||
gimp_brush_get_spacing (brush));
|
||||
}
|
||||
|
||||
static void
|
||||
opacity_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
|
||||
bsp = (BrushSelect *) data;
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (bsp->context), data);
|
||||
gimp_context_set_opacity (bsp->context, adjustment->value / 100.0);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (bsp->context), data);
|
||||
}
|
||||
|
||||
static void
|
||||
paint_mode_menu_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
LayerModeEffects paint_mode;
|
||||
|
||||
bsp = (BrushSelect *) data;
|
||||
|
||||
paint_mode = (LayerModeEffects) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||
|
||||
gimp_context_set_paint_mode (bsp->context, paint_mode);
|
||||
}
|
||||
|
||||
static void
|
||||
spacing_scale_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
|
||||
bsp = (BrushSelect *) data;
|
||||
|
||||
if (bsp == brush_select_dialog)
|
||||
{
|
||||
gimp_brush_set_spacing (gimp_context_get_brush (bsp->context),
|
||||
(gint) adjustment->value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bsp->spacing_value != adjustment->value)
|
||||
{
|
||||
bsp->spacing_value = adjustment->value;
|
||||
brush_select_change_callbacks (bsp, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_close_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
BrushSelect *bsp;
|
||||
|
||||
bsp = (BrushSelect *) data;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (bsp->shell))
|
||||
gtk_widget_hide (bsp->shell);
|
||||
|
||||
/* Free memory if poping down dialog which is not the main one */
|
||||
if (bsp != brush_select_dialog)
|
||||
{
|
||||
/* Send data back */
|
||||
brush_select_change_callbacks (bsp, TRUE);
|
||||
gtk_widget_destroy (bsp->shell);
|
||||
brush_select_free (bsp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
brush_select_edit_brush (GimpData *data)
|
||||
{
|
||||
GimpBrush *brush;
|
||||
|
||||
brush = GIMP_BRUSH (data);
|
||||
|
||||
if (GIMP_IS_BRUSH_GENERATED (brush))
|
||||
{
|
||||
if (! brush_edit_generated_dialog)
|
||||
{
|
||||
brush_edit_generated_dialog = brush_edit_generated_new ();
|
||||
}
|
||||
|
||||
brush_edit_generated_set_brush (brush_edit_generated_dialog, brush);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_message (_("Sorry, this brush can't be edited."));
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BRUSH_SELECT_H__
|
||||
#define __BRUSH_SELECT_H__
|
||||
|
||||
|
||||
typedef struct _BrushSelect BrushSelect;
|
||||
|
||||
struct _BrushSelect
|
||||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
GtkWidget *view;
|
||||
GtkWidget *paint_options_box;
|
||||
|
||||
GtkWidget *brush_name;
|
||||
GtkWidget *brush_size;
|
||||
|
||||
GtkAdjustment *spacing_data;
|
||||
|
||||
GtkAdjustment *opacity_data;
|
||||
GtkWidget *option_menu;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
|
||||
/* Context to store the current brush & paint options */
|
||||
GimpContext *context;
|
||||
gint spacing_value;
|
||||
|
||||
GQuark name_changed_handler_id;
|
||||
GQuark dirty_handler_id;
|
||||
};
|
||||
|
||||
/* list of active dialogs */
|
||||
extern GSList *brush_active_dialogs;
|
||||
|
||||
/* the main brush dialog */
|
||||
extern BrushSelect *brush_select_dialog;
|
||||
|
||||
|
||||
BrushSelect * brush_select_new (gchar *title,
|
||||
/* These are the required initial vals
|
||||
* If init_name == NULL then use
|
||||
* current brush
|
||||
*/
|
||||
gchar *init_name,
|
||||
gdouble init_opacity,
|
||||
gint init_spacing,
|
||||
gint init_mode);
|
||||
void brush_select_free (BrushSelect *bsp);
|
||||
void brush_select_dialogs_check (void);
|
||||
|
||||
|
||||
/* show/hide paint options (main brush dialog if bsp == NULL) */
|
||||
void brush_select_show_paint_options (BrushSelect *bsp,
|
||||
gboolean show);
|
||||
|
||||
|
||||
/* the main brush selection */
|
||||
GtkWidget * brush_dialog_create (void);
|
||||
void brush_dialog_free (void);
|
||||
|
||||
|
||||
#endif /* __BRUSH_SELECT_H__ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,45 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CHANNELS_DIALOG_H__
|
||||
#define __CHANNELS_DIALOG_H__
|
||||
|
||||
|
||||
void channels_dialog_new_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_raise_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_lower_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_duplicate_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_delete_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_channel_to_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_edit_channel_attributes_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __CHANNELS_DIALOG_H__ */
|
570
app/color_area.c
570
app/color_area.c
|
@ -1,570 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_area.h"
|
||||
#include "color_notebook.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdnd.h"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FORE_AREA,
|
||||
BACK_AREA,
|
||||
SWAP_AREA,
|
||||
DEF_AREA,
|
||||
INVALID_AREA
|
||||
} ColorAreaTarget;
|
||||
|
||||
/* local function prototypes */
|
||||
static void color_area_drop_color (GtkWidget *widget,
|
||||
const GimpRGB *color,
|
||||
gpointer data);
|
||||
static void color_area_drag_color (GtkWidget *widget,
|
||||
GimpRGB *color,
|
||||
gpointer data);
|
||||
static void color_area_color_changed (GimpContext *context,
|
||||
GimpRGB *color,
|
||||
gpointer data);
|
||||
|
||||
/* Global variables */
|
||||
gint active_color = FOREGROUND;
|
||||
GDisplay *color_area_gdisp = NULL;
|
||||
|
||||
/* Static variables */
|
||||
static GdkGC *color_area_gc = NULL;
|
||||
static GdkGC *mask_gc = NULL;
|
||||
|
||||
static GtkWidget *color_area = NULL;
|
||||
|
||||
static GdkPixmap *color_area_pixmap = NULL;
|
||||
static GdkBitmap *color_area_mask = NULL;
|
||||
static GdkPixmap *default_pixmap = NULL;
|
||||
static GdkBitmap *default_mask = NULL;
|
||||
static GdkPixmap *swap_pixmap = NULL;
|
||||
static GdkBitmap *swap_mask = NULL;
|
||||
|
||||
static ColorNotebook *color_notebook = NULL;
|
||||
static gboolean color_notebook_active = FALSE;
|
||||
static gint edit_color;
|
||||
static GimpRGB revert_fg;
|
||||
static GimpRGB revert_bg;
|
||||
|
||||
/* dnd stuff */
|
||||
static GtkTargetEntry color_area_target_table[] =
|
||||
{
|
||||
GIMP_TARGET_COLOR
|
||||
};
|
||||
static guint n_color_area_targets = (sizeof (color_area_target_table) /
|
||||
sizeof (color_area_target_table[0]));
|
||||
|
||||
/* Local functions */
|
||||
static ColorAreaTarget
|
||||
color_area_target (gint x,
|
||||
gint y)
|
||||
{
|
||||
gint rect_w, rect_h;
|
||||
gint width, height;
|
||||
|
||||
gdk_window_get_size (color_area_pixmap, &width, &height);
|
||||
|
||||
rect_w = width * 0.65;
|
||||
rect_h = height * 0.65;
|
||||
|
||||
/* foreground active */
|
||||
if (x > 0 && x < rect_w &&
|
||||
y > 0 && y < rect_h)
|
||||
return FORE_AREA;
|
||||
else if (x > (width - rect_w) && x < width &&
|
||||
y > (height - rect_h) && y < height)
|
||||
return BACK_AREA;
|
||||
else if (x > 0 && x < (width - rect_w) &&
|
||||
y > rect_h && y < height)
|
||||
return DEF_AREA;
|
||||
else if (x > rect_w && x < width &&
|
||||
y > 0 && y < (height - rect_h))
|
||||
return SWAP_AREA;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
void
|
||||
color_area_draw_rect (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
guchar r,
|
||||
guchar g,
|
||||
guchar b)
|
||||
{
|
||||
static guchar *color_area_rgb_buf = NULL;
|
||||
static gint color_area_rgb_buf_size;
|
||||
static gint rowstride;
|
||||
gint xx, yy;
|
||||
guchar *bp;
|
||||
#ifdef DISPLAY_FILTERS
|
||||
GList *list;
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
rowstride = 3 * ((width + 3) & -4);
|
||||
|
||||
if (color_area_rgb_buf == NULL ||
|
||||
color_area_rgb_buf_size < height * rowstride)
|
||||
{
|
||||
if (color_area_rgb_buf)
|
||||
g_free (color_area_rgb_buf);
|
||||
color_area_rgb_buf = g_malloc (color_area_rgb_buf_size = rowstride * height);
|
||||
}
|
||||
|
||||
bp = color_area_rgb_buf;
|
||||
for (xx = 0; xx < width; xx++)
|
||||
{
|
||||
*bp++ = r;
|
||||
*bp++ = g;
|
||||
*bp++ = b;
|
||||
}
|
||||
|
||||
bp = color_area_rgb_buf;
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
for (list = color_area_gdisp->cd_list; list; list = g_list_next (list))
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
|
||||
node->cd_convert (node->cd_ID, bp, width, 1, 3, rowstride);
|
||||
}
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
for (yy = 1; yy < height; yy++)
|
||||
{
|
||||
bp += rowstride;
|
||||
memcpy (bp, color_area_rgb_buf, rowstride);
|
||||
}
|
||||
|
||||
gdk_draw_rgb_image (drawable, gc, x, y, width, height,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
color_area_rgb_buf,
|
||||
rowstride);
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_draw (void)
|
||||
{
|
||||
gint rect_w, rect_h;
|
||||
gint width, height;
|
||||
gint def_width, def_height;
|
||||
gint swap_width, swap_height;
|
||||
GimpRGB color;
|
||||
guchar r, g, b;
|
||||
GdkColor mask_pattern;
|
||||
|
||||
/* Check we haven't gotten initial expose yet,
|
||||
* no point in drawing anything
|
||||
*/
|
||||
if (!color_area_pixmap || !color_area_gc)
|
||||
return;
|
||||
|
||||
gdk_window_get_size (color_area_pixmap, &width, &height);
|
||||
|
||||
rect_w = width * 0.65;
|
||||
rect_h = height * 0.65;
|
||||
|
||||
/* initialize the mask to transparent */
|
||||
mask_pattern.pixel = 0;
|
||||
gdk_gc_set_foreground (mask_gc, &mask_pattern);
|
||||
gdk_draw_rectangle (color_area_mask, mask_gc, TRUE, 0, 0, -1, -1);
|
||||
|
||||
/* set the mask's gc to opaque */
|
||||
mask_pattern.pixel = 1;
|
||||
gdk_gc_set_foreground (mask_gc, &mask_pattern);
|
||||
|
||||
/* draw the background area */
|
||||
gimp_context_get_background (gimp_context_get_user (), &color);
|
||||
gimp_rgb_get_uchar (&color, &r, &g, &b);
|
||||
color_area_draw_rect (color_area_pixmap, color_area_gc,
|
||||
(width - rect_w), (height - rect_h), rect_w, rect_h,
|
||||
r, g, b);
|
||||
gdk_draw_rectangle (color_area_mask, mask_gc, TRUE,
|
||||
(width - rect_w), (height - rect_h), rect_w, rect_h);
|
||||
|
||||
if (active_color == FOREGROUND)
|
||||
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
||||
(width - rect_w), (height - rect_h), rect_w, rect_h);
|
||||
else
|
||||
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_IN,
|
||||
(width - rect_w), (height - rect_h), rect_w, rect_h);
|
||||
|
||||
/* draw the foreground area */
|
||||
gimp_context_get_foreground (gimp_context_get_user (), &color);
|
||||
gimp_rgb_get_uchar (&color, &r, &g, &b);
|
||||
color_area_draw_rect (color_area_pixmap, color_area_gc,
|
||||
0, 0, rect_w, rect_h,
|
||||
r, g, b);
|
||||
gdk_draw_rectangle (color_area_mask, mask_gc, TRUE,
|
||||
0, 0, rect_w, rect_h);
|
||||
|
||||
if (active_color == FOREGROUND)
|
||||
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_IN,
|
||||
0, 0, rect_w, rect_h);
|
||||
else
|
||||
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
||||
0, 0, rect_w, rect_h);
|
||||
|
||||
/* draw the default pixmap */
|
||||
gdk_window_get_size (default_pixmap, &def_width, &def_height);
|
||||
gdk_draw_pixmap (color_area_pixmap, color_area_gc, default_pixmap,
|
||||
0, 0, 0, height - def_height, def_width, def_height);
|
||||
gdk_draw_pixmap (color_area_mask, mask_gc, default_mask,
|
||||
0, 0, 0, height - def_height, def_width, def_height);
|
||||
|
||||
/* draw the swap pixmap */
|
||||
gdk_window_get_size (swap_pixmap, &swap_width, &swap_height);
|
||||
gdk_draw_pixmap (color_area_pixmap, color_area_gc, swap_pixmap,
|
||||
0, 0, width - swap_width, 0, swap_width, swap_height);
|
||||
gdk_draw_pixmap (color_area_mask, mask_gc, swap_mask,
|
||||
0, 0, width - swap_width, 0, swap_width, swap_height);
|
||||
|
||||
/* draw the widget */
|
||||
gdk_gc_set_clip_mask (color_area_gc, color_area_mask);
|
||||
gdk_gc_set_clip_origin (color_area_gc, 0, 0);
|
||||
gdk_draw_pixmap (color_area->window, color_area_gc, color_area_pixmap,
|
||||
0, 0, 0, 0, width, height);
|
||||
|
||||
/* reset the clip mask */
|
||||
gdk_gc_set_clip_mask (color_area_gc, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_select_callback (ColorNotebook *color_notebook,
|
||||
const GimpRGB *color,
|
||||
ColorNotebookState state,
|
||||
gpointer client_data)
|
||||
{
|
||||
if (color_notebook)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case COLOR_NOTEBOOK_OK:
|
||||
color_notebook_hide (color_notebook);
|
||||
color_notebook_active = FALSE;
|
||||
/* Fallthrough */
|
||||
case COLOR_NOTEBOOK_UPDATE:
|
||||
if (edit_color == FOREGROUND)
|
||||
gimp_context_set_foreground (gimp_context_get_user (), color);
|
||||
else
|
||||
gimp_context_set_background (gimp_context_get_user (), color);
|
||||
break;
|
||||
case COLOR_NOTEBOOK_CANCEL:
|
||||
color_notebook_hide (color_notebook);
|
||||
color_notebook_active = FALSE;
|
||||
gimp_context_set_foreground (gimp_context_get_user (), &revert_fg);
|
||||
gimp_context_set_background (gimp_context_get_user (), &revert_bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_edit (void)
|
||||
{
|
||||
GimpContext *user_context;
|
||||
GimpRGB color;
|
||||
|
||||
user_context = gimp_context_get_user ();
|
||||
|
||||
if (! color_notebook_active)
|
||||
{
|
||||
gimp_context_get_foreground (user_context, &revert_fg);
|
||||
gimp_context_get_background (user_context, &revert_bg);
|
||||
}
|
||||
|
||||
if (active_color == FOREGROUND)
|
||||
gimp_context_get_foreground (user_context, &color);
|
||||
else
|
||||
gimp_context_get_background (user_context, &color);
|
||||
|
||||
edit_color = active_color;
|
||||
|
||||
if (! color_notebook)
|
||||
{
|
||||
color_notebook = color_notebook_new (_("Color Selection"),
|
||||
(const GimpRGB *) &color,
|
||||
color_area_select_callback,
|
||||
NULL, TRUE, FALSE);
|
||||
color_notebook_active = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! color_notebook_active)
|
||||
{
|
||||
color_notebook_show (color_notebook);
|
||||
color_notebook_active = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
color_notebook_show (color_notebook);
|
||||
}
|
||||
|
||||
color_notebook_set_color (color_notebook, &color);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
color_area_events (GtkWidget *widget,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GdkEventButton *bevent;
|
||||
ColorAreaTarget target;
|
||||
|
||||
static ColorAreaTarget press_target = INVALID_AREA;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_CONFIGURE:
|
||||
if (color_area_pixmap)
|
||||
{
|
||||
gdk_pixmap_unref (color_area_pixmap);
|
||||
gdk_bitmap_unref (color_area_mask);
|
||||
}
|
||||
|
||||
color_area_pixmap = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height, -1);
|
||||
color_area_mask = gdk_pixmap_new (widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height, 1);
|
||||
break;
|
||||
|
||||
case GDK_EXPOSE:
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
if (!color_area_gc)
|
||||
{
|
||||
color_area_gc = gdk_gc_new (widget->window);
|
||||
mask_gc = gdk_gc_new (color_area_mask);
|
||||
}
|
||||
|
||||
color_area_draw ();
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
bevent = (GdkEventButton *) event;
|
||||
|
||||
if (bevent->button == 1)
|
||||
{
|
||||
target = color_area_target (bevent->x, bevent->y);
|
||||
press_target = INVALID_AREA;
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case FORE_AREA:
|
||||
case BACK_AREA:
|
||||
if (target != active_color)
|
||||
{
|
||||
active_color = target;
|
||||
color_area_draw ();
|
||||
}
|
||||
else
|
||||
{
|
||||
press_target = target;
|
||||
}
|
||||
break;
|
||||
case SWAP_AREA:
|
||||
gimp_context_swap_colors (gimp_context_get_user ());
|
||||
break;
|
||||
case DEF_AREA:
|
||||
gimp_context_set_default_colors (gimp_context_get_user ());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_RELEASE:
|
||||
bevent = (GdkEventButton *) event;
|
||||
|
||||
if (bevent->button == 1)
|
||||
{
|
||||
target = color_area_target (bevent->x, bevent->y);
|
||||
|
||||
if (target == press_target)
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
case FORE_AREA:
|
||||
case BACK_AREA:
|
||||
color_area_edit ();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
press_target = INVALID_AREA;
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
press_target = INVALID_AREA;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_realize (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
||||
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
color_area_create (gint width,
|
||||
gint height,
|
||||
GdkPixmap *default_pmap,
|
||||
GdkBitmap *default_msk,
|
||||
GdkPixmap *swap_pmap,
|
||||
GdkBitmap *swap_msk)
|
||||
{
|
||||
color_area = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (color_area), width, height);
|
||||
gtk_widget_set_events (color_area,
|
||||
GDK_EXPOSURE_MASK |
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_ENTER_NOTIFY_MASK |
|
||||
GDK_LEAVE_NOTIFY_MASK);
|
||||
gtk_signal_connect (GTK_OBJECT (color_area), "event",
|
||||
GTK_SIGNAL_FUNC (color_area_events),
|
||||
NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (color_area), "realize",
|
||||
GTK_SIGNAL_FUNC (color_area_realize),
|
||||
NULL);
|
||||
|
||||
default_pixmap = default_pmap;
|
||||
default_mask = default_msk;
|
||||
|
||||
swap_pixmap = swap_pmap;
|
||||
swap_mask = swap_msk;
|
||||
|
||||
/* dnd stuff */
|
||||
gtk_drag_source_set (color_area,
|
||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||
color_area_target_table, n_color_area_targets,
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
gimp_dnd_color_source_set (color_area, color_area_drag_color, NULL);
|
||||
|
||||
gtk_drag_dest_set (color_area,
|
||||
GTK_DEST_DEFAULT_HIGHLIGHT |
|
||||
GTK_DEST_DEFAULT_MOTION |
|
||||
GTK_DEST_DEFAULT_DROP,
|
||||
color_area_target_table, n_color_area_targets,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_color_dest_set (color_area, color_area_drop_color, NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()),
|
||||
"foreground_changed",
|
||||
GTK_SIGNAL_FUNC (color_area_color_changed),
|
||||
color_area);
|
||||
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()),
|
||||
"background_changed",
|
||||
GTK_SIGNAL_FUNC (color_area_color_changed),
|
||||
color_area);
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
/* display filter dummy gdisplay */
|
||||
color_area_gdisp = g_new (GDisplay, 1);
|
||||
color_area_gdisp->cd_list = NULL;
|
||||
color_area_gdisp->cd_ui = NULL;
|
||||
color_area_gdisp->gimage = g_new (GimpImage, 1);
|
||||
color_area_gdisp->gimage->base_type = RGB;
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
return color_area;
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_drag_color (GtkWidget *widget,
|
||||
GimpRGB *color,
|
||||
gpointer data)
|
||||
{
|
||||
if (active_color == FOREGROUND)
|
||||
gimp_context_get_foreground (gimp_context_get_user (), color);
|
||||
else
|
||||
gimp_context_get_background (gimp_context_get_user (), color);
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_drop_color (GtkWidget *widget,
|
||||
const GimpRGB *color,
|
||||
gpointer data)
|
||||
{
|
||||
if (color_notebook_active &&
|
||||
active_color == edit_color)
|
||||
{
|
||||
color_notebook_set_color (color_notebook, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (active_color == FOREGROUND)
|
||||
gimp_context_set_foreground (gimp_context_get_user (), color);
|
||||
else
|
||||
gimp_context_set_background (gimp_context_get_user (), color);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
color_area_color_changed (GimpContext *context,
|
||||
GimpRGB *color,
|
||||
gpointer data)
|
||||
{
|
||||
color_area_draw ();
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_AREA_H__
|
||||
#define __COLOR_AREA_H__
|
||||
|
||||
|
||||
#define FOREGROUND 0
|
||||
#define BACKGROUND 1
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
extern gint active_color; /* foreground (= 0) or background (= 1) */
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
extern GDisplay *color_area_gdisp; /* hack for color displays */
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
GtkWidget * color_area_create (gint width,
|
||||
gint height,
|
||||
GdkPixmap *default_pixmap,
|
||||
GdkBitmap *default_mask,
|
||||
GdkPixmap *swap_pixmap,
|
||||
GdkBitmap *swap_mask);
|
||||
|
||||
/* Exported for use by color_select */
|
||||
void color_area_draw_rect (GdkDrawable *drawable,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
guchar r,
|
||||
guchar g,
|
||||
guchar b);
|
||||
|
||||
|
||||
#endif /* __COLOR_AREA_H__ */
|
1340
app/color_notebook.c
1340
app/color_notebook.c
File diff suppressed because it is too large
Load diff
|
@ -1,63 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_NOTEBOOK_H__
|
||||
#define __COLOR_NOTEBOOK_H__
|
||||
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COLOR_NOTEBOOK_OK,
|
||||
COLOR_NOTEBOOK_CANCEL,
|
||||
COLOR_NOTEBOOK_UPDATE
|
||||
} ColorNotebookState;
|
||||
|
||||
|
||||
typedef void (* ColorNotebookCallback) (ColorNotebook *cnb,
|
||||
const GimpRGB *color,
|
||||
ColorNotebookState state,
|
||||
gpointer data);
|
||||
|
||||
|
||||
ColorNotebook * color_notebook_new (const gchar *title,
|
||||
const GimpRGB *color,
|
||||
ColorNotebookCallback callback,
|
||||
gpointer data,
|
||||
gboolean wants_update,
|
||||
gboolean show_aplha);
|
||||
|
||||
void color_notebook_show (ColorNotebook *cnb);
|
||||
void color_notebook_hide (ColorNotebook *cnb);
|
||||
void color_notebook_free (ColorNotebook *cnb);
|
||||
|
||||
void color_notebook_set_color (ColorNotebook *cnb,
|
||||
const GimpRGB *color);
|
||||
void color_notebook_get_color (ColorNotebook *cnb,
|
||||
GimpRGB *color);
|
||||
|
||||
|
||||
/* color history functions */
|
||||
|
||||
void color_history_add_color_from_rc (GimpRGB *color);
|
||||
void color_history_write (FILE *fp);
|
||||
|
||||
|
||||
#endif /* __COLOR_NOTEBOOK_H__ */
|
1494
app/color_select.c
1494
app/color_select.c
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_SELECT_H__
|
||||
#define __COLOR_SELECT_H__
|
||||
|
||||
|
||||
void color_select_init (void);
|
||||
|
||||
|
||||
#endif /* __COLOR_SELECT_H__ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,79 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLORMAP_DIALOG_H__
|
||||
#define __COLORMAP_DIALOG_H__
|
||||
|
||||
|
||||
#include <gtk/gtkdialog.h>
|
||||
|
||||
|
||||
#define GIMP_TYPE_COLORMAP_DIALOG (gimp_colormap_dialog_get_type ())
|
||||
#define GIMP_COLORMAP_DIALOG(obj) (GTK_CHECK_CAST((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialog))
|
||||
#define GIMP_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
|
||||
#define GIMP_IS_COLORMAP_DIALOG(obj) (GTK_CHECK_TYPE((obj), GIMP_TYPE_COLORMAP_DIALOG))
|
||||
#define GIMP_IS_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GIMP_TYPE_COLORMAP_DIALOG))
|
||||
|
||||
|
||||
typedef struct _GimpColormapDialog GimpColormapDialog;
|
||||
typedef struct _GimpColormapDialogClass GimpColormapDialogClass;
|
||||
|
||||
struct _GimpColormapDialog
|
||||
{
|
||||
GtkDialog parent;
|
||||
|
||||
GimpImage *image;
|
||||
gint col_index;
|
||||
gint dnd_col_index;
|
||||
GtkWidget *vbox;
|
||||
GtkPreview *palette;
|
||||
GtkWidget *image_menu;
|
||||
GtkWidget *popup_menu;
|
||||
GtkOptionMenu *option_menu;
|
||||
GimpContainer *context;
|
||||
guint event_handler;
|
||||
gint xn;
|
||||
gint yn;
|
||||
gint cellsize;
|
||||
GtkWidget *index_spinbutton;
|
||||
GtkAdjustment *index_adjustment;
|
||||
GtkEntry *color_entry;
|
||||
GQuark rename_handler_id;
|
||||
GQuark cmap_changed_handler_id;
|
||||
GtkWidget *add_item;
|
||||
ColorNotebook *color_notebook;
|
||||
};
|
||||
|
||||
struct _GimpColormapDialogClass
|
||||
{
|
||||
GtkDialogClass parent_class;
|
||||
|
||||
void (* selected) (GimpColormapDialog *gcd);
|
||||
};
|
||||
|
||||
|
||||
GtkType gimp_colormap_dialog_get_type (void);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpContainer *context);
|
||||
|
||||
void gimp_colormap_dialog_selected (GimpColormapDialog *colormap_dialog);
|
||||
|
||||
GimpImage * gimp_colormap_dialog_image (const GimpColormapDialog *colormap_dialog);
|
||||
gint gimp_colormap_dialog_col_index (const GimpColormapDialog *colormap_dialog);
|
||||
|
||||
|
||||
#endif /* __COLORMAP_DIALOG_H__ */
|
1528
app/commands.c
1528
app/commands.c
File diff suppressed because it is too large
Load diff
135
app/commands.h
135
app/commands.h
|
@ -1,135 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COMMANDS_H__
|
||||
#define __COMMANDS_H__
|
||||
|
||||
|
||||
void file_new_cmd_callback (GtkWidget *, gpointer, guint);
|
||||
void file_open_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_save_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_save_as_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_save_a_copy_as_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_revert_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_pref_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_close_cmd_callback (GtkWidget *, gpointer);
|
||||
void file_quit_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void edit_undo_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_redo_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_cut_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_copy_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_paste_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_paste_as_new_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_named_paste_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_clear_cmd_callback (GtkWidget *, gpointer);
|
||||
void edit_fill_cmd_callback (GtkWidget *widget,
|
||||
gpointer callback_data,
|
||||
guint callback_action);
|
||||
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void select_invert_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_all_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_none_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_float_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_feather_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_shrink_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_border_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_grow_cmd_callback (GtkWidget *, gpointer);
|
||||
void select_save_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_16_1_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_8_1_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_4_1_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_2_1_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_1_1_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_1_2_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_1_4_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_1_8_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_zoom_1_16_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_dot_for_dot_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_info_window_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_nav_window_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_new_view_cmd_callback (GtkWidget *, gpointer);
|
||||
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_invert_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_equalize_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_offset_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_resize_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_scale_cmd_callback (GtkWidget *, gpointer);
|
||||
void image_duplicate_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void layers_previous_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_next_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_raise_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_lower_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_merge_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
|
||||
void layers_resize_to_image_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
void tools_toolbox_raise_cmd_callback (GtkWidget *, gpointer);
|
||||
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
|
||||
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
|
||||
void tools_swap_contexts_cmd_callback (GtkWidget *, gpointer);
|
||||
void tools_select_cmd_callback (GtkWidget *widget,
|
||||
gpointer callback_data,
|
||||
guint callback_action);
|
||||
|
||||
void filters_repeat_cmd_callback (GtkWidget *widget,
|
||||
gpointer callback_data,
|
||||
guint callback_action);
|
||||
|
||||
void dialogs_preferences_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
void dialogs_display_filters_cmd_callback (GtkWidget *, gpointer);
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
void help_help_cmd_callback (GtkWidget *, gpointer);
|
||||
void help_context_help_cmd_callback (GtkWidget *, gpointer);
|
||||
void help_tips_cmd_callback (GtkWidget *, gpointer);
|
||||
void help_about_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
|
||||
#endif /* __COMMANDS_H__ */
|
|
@ -27,8 +27,9 @@
|
|||
#include "tools/paint_options.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "gui/brush-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "brush_select.h"
|
||||
#include "cursorutil.h"
|
||||
#include "context_manager.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -105,23 +105,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "cursorutil.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "palette_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tools/brightness_contrast.h"
|
||||
#include "tools/color_balance.h"
|
||||
#include "tools/curves.h"
|
||||
|
@ -130,8 +113,25 @@
|
|||
#include "tools/posterize.h"
|
||||
#include "tools/threshold.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* bleh! */
|
||||
|
|
|
@ -29,10 +29,13 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontext.h"
|
||||
|
@ -40,8 +43,6 @@
|
|||
#include "gimplayer.h"
|
||||
#include "gimpmarshal.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "info_dialog.h"
|
||||
#include "path_transform.h"
|
||||
#include "pixel_region.h"
|
||||
#include "pixel_surround.h"
|
||||
|
@ -64,6 +65,7 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
TRANSFORM,
|
||||
|
|
|
@ -29,10 +29,13 @@
|
|||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontext.h"
|
||||
|
@ -40,8 +43,6 @@
|
|||
#include "gimplayer.h"
|
||||
#include "gimpmarshal.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "info_dialog.h"
|
||||
#include "path_transform.h"
|
||||
#include "pixel_region.h"
|
||||
#include "pixel_surround.h"
|
||||
|
@ -64,6 +65,7 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
TRANSFORM,
|
||||
|
|
|
@ -105,23 +105,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "cursorutil.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "palette_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tools/brightness_contrast.h"
|
||||
#include "tools/color_balance.h"
|
||||
#include "tools/curves.h"
|
||||
|
@ -130,8 +113,25 @@
|
|||
#include "tools/posterize.h"
|
||||
#include "tools/threshold.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* bleh! */
|
||||
|
|
|
@ -25,21 +25,22 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "gui/info-dialog.h"
|
||||
#include "gui/palette-editor.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "info_dialog.h"
|
||||
#include "palette.h"
|
||||
|
||||
#include "gimpdrawtool.h"
|
||||
#include "gimpcolorpickertool.h"
|
||||
#include "tool_manager.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps2.h"
|
||||
|
|
|
@ -30,12 +30,18 @@
|
|||
#include "tools/gimptool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "cursorutil.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "gui/menus.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
|
@ -46,11 +52,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "menus.h"
|
||||
#include "nav_window.h"
|
||||
#include "plug_in.h"
|
||||
#include "qmask.h"
|
||||
#include "scale.h"
|
||||
|
@ -58,17 +59,17 @@
|
|||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define MAX_TITLE_BUF 256
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
|
@ -33,16 +35,13 @@
|
|||
|
||||
#include "tools/gimptoolinfo.h"
|
||||
|
||||
#include "about-dialog.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "authors.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimphelp.h"
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber2.xpm"
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_area.h"
|
||||
#include "color_notebook.h"
|
||||
#include "colormaps.h"
|
||||
#include "color-area.h"
|
||||
#include "color-notebook.h"
|
||||
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
#include "colormaps.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -36,18 +36,21 @@
|
|||
#include "widgets/gimpdockbook.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "brush_select.h"
|
||||
#include "brush-select.h"
|
||||
#include "devices.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "docindex.h"
|
||||
#include "errorconsole.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gradient_select.h"
|
||||
#include "palette.h"
|
||||
#include "pattern_select.h"
|
||||
#include "gradient-editor.h"
|
||||
#include "gradient-select.h"
|
||||
#include "lc_dialog.h"
|
||||
|
||||
#include "palette-editor.h"
|
||||
#include "pattern-select.h"
|
||||
#include "toolbox.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gradient_editor.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "image_new.h"
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-new-dialog.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "image_new.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "dialog_handler.h"
|
||||
#include "info-dialog.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "info_dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -30,14 +30,15 @@
|
|||
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "info-dialog.h"
|
||||
#include "info-window.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gradient-select.h"
|
||||
#include "palette-editor.h"
|
||||
#include "palette-import-dialog.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
@ -36,9 +40,6 @@
|
|||
#include "gimpimage.h"
|
||||
#include "gimppalette.h"
|
||||
#include "gimppalette-import.h"
|
||||
#include "gradient_select.h"
|
||||
#include "palette.h"
|
||||
#include "palette_import.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -24,27 +24,27 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "layer-select.h"
|
||||
#include "session.h"
|
||||
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "resolution_calibrate.h"
|
||||
#include "session.h"
|
||||
#include "tile_cache.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -35,20 +35,21 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "gui/layer-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "info_window.h"
|
||||
#include "layer_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "scale.h"
|
||||
#include "scroll.h"
|
||||
|
|
|
@ -35,20 +35,21 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "gui/layer-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "info_window.h"
|
||||
#include "layer_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "scale.h"
|
||||
#include "scroll.h"
|
||||
|
|
|
@ -30,12 +30,18 @@
|
|||
#include "tools/gimptool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "cursorutil.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "gui/menus.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
|
@ -46,11 +52,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "menus.h"
|
||||
#include "nav_window.h"
|
||||
#include "plug_in.h"
|
||||
#include "qmask.h"
|
||||
#include "scale.h"
|
||||
|
@ -58,17 +59,17 @@
|
|||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define MAX_TITLE_BUF 256
|
||||
|
||||
|
|
|
@ -35,20 +35,21 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "gui/layer-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "info_window.h"
|
||||
#include "layer_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "scale.h"
|
||||
#include "scroll.h"
|
||||
|
|
|
@ -27,13 +27,14 @@
|
|||
#include "disp_callbacks.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "interface.h"
|
||||
#include "gui/menus.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "interface.h"
|
||||
#include "menus.h"
|
||||
#include "nav_window.h"
|
||||
#include "qmask.h"
|
||||
|
||||
#include "pixmaps/qmasksel.xpm"
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "layer-select.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimprc.h"
|
||||
#include "layer_select.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
|
|
@ -27,13 +27,14 @@
|
|||
#include "disp_callbacks.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "interface.h"
|
||||
#include "gui/menus.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "interface.h"
|
||||
#include "menus.h"
|
||||
#include "nav_window.h"
|
||||
#include "qmask.h"
|
||||
|
||||
#include "pixmaps/qmasksel.xpm"
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "gui/info-dialog.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "gdisplay.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
#include "scroll.h"
|
||||
#include "scale.h"
|
||||
#include "temp_buf.h"
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "gui/info-dialog.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "gdisplay.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
#include "scroll.h"
|
||||
#include "scale.h"
|
||||
#include "temp_buf.h"
|
||||
|
|
|
@ -53,10 +53,11 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "commands.h"
|
||||
#include "gui/commands.h"
|
||||
#include "dialog_handler.h"
|
||||
|
||||
#include "appenv.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -65,16 +65,17 @@
|
|||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "docindex.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-open.h"
|
||||
#include "file-utils.h"
|
||||
#include "menus.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -65,16 +65,17 @@
|
|||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "docindex.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-save.h"
|
||||
#include "file-utils.h"
|
||||
#include "menus.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -44,11 +44,12 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "file-utils.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "menus.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "file-utils.h"
|
||||
#include "gimpimage.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
|
|
@ -65,16 +65,17 @@
|
|||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "docindex.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-open.h"
|
||||
#include "file-utils.h"
|
||||
#include "menus.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -65,16 +65,17 @@
|
|||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "docindex.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-save.h"
|
||||
#include "file-utils.h"
|
||||
#include "menus.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
|
|
@ -44,11 +44,12 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "file-utils.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "menus.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "file-utils.h"
|
||||
#include "gimpimage.h"
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
|
|
@ -1,677 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-1999 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "image_new.h"
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
|
||||
GtkWidget *confirm_dlg;
|
||||
|
||||
GtkWidget *size_frame;
|
||||
GtkWidget *size_se;
|
||||
GtkWidget *resolution_se;
|
||||
GtkWidget *couple_resolutions;
|
||||
|
||||
/* this should be a list */
|
||||
GtkWidget *type_w[2];
|
||||
GtkWidget *fill_type_w[4];
|
||||
|
||||
GimpImageNewValues *values;
|
||||
gdouble size;
|
||||
} NewImageInfo;
|
||||
|
||||
/* new image local functions */
|
||||
static void file_new_confirm_dialog (NewImageInfo *);
|
||||
|
||||
static void file_new_ok_callback (GtkWidget *, gpointer);
|
||||
static void file_new_reset_callback (GtkWidget *, gpointer);
|
||||
static void file_new_cancel_callback (GtkWidget *, gpointer);
|
||||
static void file_new_resolution_callback (GtkWidget *, gpointer);
|
||||
static void file_new_image_size_callback (GtkWidget *, gpointer);
|
||||
|
||||
static void
|
||||
file_new_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
GimpImageNewValues *values;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
values = info->values;
|
||||
|
||||
/* get the image size in pixels */
|
||||
values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
/* get the resolution in dpi */
|
||||
values->xresolution =
|
||||
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->resolution_se), 0);
|
||||
values->yresolution =
|
||||
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->resolution_se), 1);
|
||||
|
||||
/* get the units */
|
||||
values->unit =
|
||||
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (info->size_se));
|
||||
values->res_unit =
|
||||
gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (info->resolution_se));
|
||||
|
||||
if (info->size > max_new_image_size)
|
||||
{
|
||||
file_new_confirm_dialog (info);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy (info->dlg);
|
||||
image_new_create_image (values);
|
||||
image_new_values_free (values);
|
||||
g_free (info);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
file_new_reset_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (info->resolution_se), info);
|
||||
|
||||
gimp_chain_button_set_active
|
||||
(GIMP_CHAIN_BUTTON (info->couple_resolutions),
|
||||
ABS (default_xresolution - default_yresolution) < GIMP_MIN_RESOLUTION);
|
||||
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
0, default_xresolution);
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
1, default_yresolution);
|
||||
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
default_resolution_units);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (info->resolution_se), info);
|
||||
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se),
|
||||
0, default_xresolution, TRUE);
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se),
|
||||
1, default_yresolution, TRUE);
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se),
|
||||
0, default_width);
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se),
|
||||
1, default_height);
|
||||
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->size_se),
|
||||
default_units);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[default_type]),
|
||||
TRUE);
|
||||
gtk_toggle_button_set_active
|
||||
(GTK_TOGGLE_BUTTON (info->fill_type_w[BACKGROUND_FILL]), TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
file_new_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
gtk_widget_destroy (info->dlg);
|
||||
image_new_values_free(info->values);
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
/* local callback of file_new_confirm_dialog() */
|
||||
static void
|
||||
file_new_confirm_dialog_callback (GtkWidget *widget,
|
||||
gboolean create,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
info->confirm_dlg = NULL;
|
||||
|
||||
if (create)
|
||||
{
|
||||
gtk_widget_destroy (info->dlg);
|
||||
image_new_create_image (info->values);
|
||||
image_new_values_free (info->values);
|
||||
g_free (info);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_sensitive (info->dlg, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
file_new_confirm_dialog (NewImageInfo *info)
|
||||
{
|
||||
gchar *size;
|
||||
gchar *max_size;
|
||||
gchar *text;
|
||||
|
||||
gtk_widget_set_sensitive (info->dlg, FALSE);
|
||||
|
||||
size = image_new_get_size_string (info->size);
|
||||
max_size = image_new_get_size_string (max_new_image_size);
|
||||
|
||||
/* xgettext:no-c-format */
|
||||
|
||||
text = g_strdup_printf (_("You are trying to create an image which\n"
|
||||
"has an initial size of %s.\n\n"
|
||||
"Choose OK to create this image anyway.\n"
|
||||
"Choose Cancel if you didn't mean to\n"
|
||||
"create such a large image.\n\n"
|
||||
"To prevent this dialog from appearing,\n"
|
||||
"increase the \"Maximum Image Size\"\n"
|
||||
"setting (currently %s) in the\n"
|
||||
"preferences dialog."),
|
||||
size, max_size);
|
||||
|
||||
info->confirm_dlg =
|
||||
gimp_query_boolean_box (_("Confirm Image Size"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/file_new.html#confirm_size",
|
||||
FALSE,
|
||||
text,
|
||||
_("OK"), _("Cancel"),
|
||||
NULL, NULL,
|
||||
file_new_confirm_dialog_callback,
|
||||
info);
|
||||
|
||||
g_free (text);
|
||||
g_free (max_size);
|
||||
g_free (size);
|
||||
|
||||
gtk_widget_show (info->confirm_dlg);
|
||||
}
|
||||
|
||||
static void
|
||||
file_new_resolution_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
|
||||
static gdouble xres = 0.0;
|
||||
static gdouble yres = 0.0;
|
||||
gdouble new_xres;
|
||||
gdouble new_yres;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
new_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
|
||||
new_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
|
||||
|
||||
if (gimp_chain_button_get_active
|
||||
(GIMP_CHAIN_BUTTON (info->couple_resolutions)))
|
||||
{
|
||||
gtk_signal_handler_block_by_data
|
||||
(GTK_OBJECT (info->resolution_se), info);
|
||||
|
||||
if (new_xres != xres)
|
||||
{
|
||||
yres = new_yres = xres = new_xres;
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, yres);
|
||||
}
|
||||
|
||||
if (new_yres != yres)
|
||||
{
|
||||
xres = new_xres = yres = new_yres;
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, xres);
|
||||
}
|
||||
|
||||
gtk_signal_handler_unblock_by_data
|
||||
(GTK_OBJECT (info->resolution_se), info);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (new_xres != xres)
|
||||
xres = new_xres;
|
||||
if (new_yres != yres)
|
||||
yres = new_yres;
|
||||
}
|
||||
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 0,
|
||||
xres, FALSE);
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 1,
|
||||
yres, FALSE);
|
||||
|
||||
file_new_image_size_callback (widget, data);
|
||||
}
|
||||
|
||||
static void
|
||||
file_new_image_size_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
gchar *text;
|
||||
gchar *label;
|
||||
|
||||
info = (NewImageInfo*) data;
|
||||
|
||||
info->values->width =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 0));
|
||||
info->values->height =
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (info->size_se), 1));
|
||||
|
||||
info->size = image_new_calculate_size (info->values);
|
||||
|
||||
label = g_strdup_printf (_("Image Size: %s"),
|
||||
text = image_new_get_size_string (info->size));
|
||||
gtk_frame_set_label (GTK_FRAME (info->size_frame), label);
|
||||
|
||||
g_free (label);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
void
|
||||
file_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer callback_data,
|
||||
guint callback_action)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
GimpImage *image = NULL;
|
||||
|
||||
/* Before we try to determine the responsible gdisplay,
|
||||
* make sure this wasn't called from the toolbox
|
||||
*/
|
||||
if (callback_action)
|
||||
{
|
||||
gdisp = gdisplay_active ();
|
||||
|
||||
if (gdisp)
|
||||
image = gdisp->gimage;
|
||||
}
|
||||
|
||||
image_new_create_window (NULL, image);
|
||||
}
|
||||
|
||||
void
|
||||
ui_new_image_window_create (const GimpImageNewValues *values_orig)
|
||||
{
|
||||
NewImageInfo *info;
|
||||
GimpImageNewValues *values;
|
||||
|
||||
GtkWidget *top_vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *abox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkWidget *separator;
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
GtkObject *adjustment;
|
||||
GtkWidget *spinbutton;
|
||||
GtkWidget *spinbutton2;
|
||||
GtkWidget *radio_box;
|
||||
GSList *group;
|
||||
GList *list;
|
||||
|
||||
info = g_new (NewImageInfo, 1);
|
||||
info->values = values = image_new_values_new (values_orig);
|
||||
|
||||
info->confirm_dlg = NULL;
|
||||
info->size = 0.0;
|
||||
|
||||
info->dlg = gimp_dialog_new (_("New Image"), "new_image",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/file_new.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, FALSE, TRUE,
|
||||
|
||||
_("OK"), file_new_ok_callback,
|
||||
info, NULL, NULL, TRUE, FALSE,
|
||||
_("Reset"), file_new_reset_callback,
|
||||
info, NULL, NULL, FALSE, FALSE,
|
||||
_("Cancel"), file_new_cancel_callback,
|
||||
info, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
/* vbox holding the rest of the dialog */
|
||||
top_vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (top_vbox), 4);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->dlg)->vbox),
|
||||
top_vbox, TRUE, TRUE, 0);
|
||||
gtk_widget_show (top_vbox);
|
||||
|
||||
/* Image size frame */
|
||||
info->size_frame = gtk_frame_new (NULL);
|
||||
gtk_box_pack_start (GTK_BOX (top_vbox), info->size_frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (info->size_frame);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (info->size_frame), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
table = gtk_table_new (7, 2, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 4);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 4);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 4, 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/* the pixel size labels */
|
||||
label = gtk_label_new (_("Width:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
label = gtk_label_new (_("Height:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
/* a separator after the pixel section */
|
||||
separator = gtk_hseparator_new ();
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), separator, 0, 2, 2, 3);
|
||||
gtk_widget_show (separator);
|
||||
|
||||
/* the unit size labels */
|
||||
label = gtk_label_new (_("Width:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
label = gtk_label_new (_("Height:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
/* create the sizeentry which keeps it all together */
|
||||
abox = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), abox, 1, 2, 3, 5);
|
||||
info->size_se =
|
||||
gimp_size_entry_new (0, values->unit, "%a", FALSE, FALSE, TRUE, 75,
|
||||
GIMP_SIZE_ENTRY_UPDATE_SIZE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (info->size_se), 1, 2);
|
||||
gtk_container_add (GTK_CONTAINER (abox), info->size_se);
|
||||
gtk_widget_show (info->size_se);
|
||||
gtk_widget_show (abox);
|
||||
|
||||
/* height in units */
|
||||
adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 1);
|
||||
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 2);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
||||
gtk_widget_set_usize (spinbutton, 75, 0);
|
||||
/* add the "height in units" spinbutton to the sizeentry */
|
||||
gtk_table_attach_defaults (GTK_TABLE (info->size_se), spinbutton,
|
||||
0, 1, 2, 3);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
/* height in pixels */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 1);
|
||||
spinbutton2 = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 0);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton2),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton2), TRUE);
|
||||
gtk_widget_set_usize (spinbutton2, 75, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinbutton2, FALSE, FALSE, 0);
|
||||
gtk_widget_show (spinbutton2);
|
||||
|
||||
label = gtk_label_new (_("Pixels"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
/* add the "height in pixels" spinbutton to the main table */
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 1, 2);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
/* register the height spinbuttons with the sizeentry */
|
||||
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (info->size_se),
|
||||
GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SPIN_BUTTON (spinbutton2));
|
||||
|
||||
/* width in units */
|
||||
adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 1);
|
||||
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 2);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
||||
gtk_widget_set_usize (spinbutton, 75, 0);
|
||||
/* add the "width in units" spinbutton to the sizeentry */
|
||||
gtk_table_attach_defaults (GTK_TABLE (info->size_se), spinbutton,
|
||||
0, 1, 1, 2);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
/* width in pixels */
|
||||
abox = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), abox, 1, 2, 0, 1);
|
||||
adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 1);
|
||||
spinbutton2 = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 0);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton2),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton2), TRUE);
|
||||
gtk_widget_set_usize (spinbutton2, 75, 0);
|
||||
/* add the "width in pixels" spinbutton to the main table */
|
||||
gtk_container_add (GTK_CONTAINER (abox), spinbutton2);
|
||||
gtk_widget_show (spinbutton2);
|
||||
gtk_widget_show (abox);
|
||||
|
||||
/* register the width spinbuttons with the sizeentry */
|
||||
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (info->size_se),
|
||||
GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SPIN_BUTTON (spinbutton2));
|
||||
|
||||
/* initialize the sizeentry */
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 0,
|
||||
values->xresolution, FALSE);
|
||||
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 1,
|
||||
values->yresolution, FALSE);
|
||||
|
||||
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (info->size_se), 0,
|
||||
GIMP_MIN_IMAGE_SIZE,
|
||||
GIMP_MAX_IMAGE_SIZE);
|
||||
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (info->size_se), 1,
|
||||
GIMP_MIN_IMAGE_SIZE,
|
||||
GIMP_MAX_IMAGE_SIZE);
|
||||
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 0, values->width);
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 1, values->height);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (info->size_se), "refval_changed",
|
||||
GTK_SIGNAL_FUNC (file_new_image_size_callback),
|
||||
info);
|
||||
gtk_signal_connect (GTK_OBJECT (info->size_se), "value_changed",
|
||||
GTK_SIGNAL_FUNC (file_new_image_size_callback),
|
||||
info);
|
||||
|
||||
/* initialize the size label */
|
||||
file_new_image_size_callback (info->size_se, info);
|
||||
|
||||
/* the resolution labels */
|
||||
label = gtk_label_new (_("Resolution X:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
label = gtk_label_new (_("Y:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
/* the resolution sizeentry */
|
||||
adjustment = gtk_adjustment_new (1, 1, 1, 1, 10, 1);
|
||||
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 2);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
||||
gtk_widget_set_usize (spinbutton, 75, 0);
|
||||
|
||||
info->resolution_se =
|
||||
gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"),
|
||||
FALSE, FALSE, FALSE, 75,
|
||||
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (info->resolution_se), 1, 2);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (info->resolution_se), 2, 2);
|
||||
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
GTK_SPIN_BUTTON (spinbutton), NULL);
|
||||
gtk_table_attach_defaults (GTK_TABLE (info->resolution_se), spinbutton,
|
||||
1, 2, 0, 1);
|
||||
gtk_widget_show (spinbutton);
|
||||
gtk_table_attach (GTK_TABLE (table), info->resolution_se, 1, 2, 5, 7,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (info->resolution_se);
|
||||
|
||||
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
0, GIMP_MIN_RESOLUTION,
|
||||
GIMP_MAX_RESOLUTION);
|
||||
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
1, GIMP_MIN_RESOLUTION,
|
||||
GIMP_MAX_RESOLUTION);
|
||||
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
0, values->xresolution);
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se),
|
||||
1, values->yresolution);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (info->resolution_se), "value_changed",
|
||||
GTK_SIGNAL_FUNC (file_new_resolution_callback),
|
||||
info);
|
||||
|
||||
/* the resolution chainbutton */
|
||||
info->couple_resolutions = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
|
||||
gimp_chain_button_set_active
|
||||
(GIMP_CHAIN_BUTTON (info->couple_resolutions),
|
||||
ABS (values->xresolution - values->yresolution) < GIMP_MIN_RESOLUTION);
|
||||
gtk_table_attach_defaults (GTK_TABLE (info->resolution_se),
|
||||
info->couple_resolutions, 2, 3, 0, 2);
|
||||
gtk_widget_show (info->couple_resolutions);
|
||||
|
||||
/* hbox containing the Image type and fill type frames */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (top_vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
/* frame for Image Type */
|
||||
frame = gtk_frame_new (_("Image Type"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
/* radio buttons and box */
|
||||
radio_box = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (radio_box), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), radio_box);
|
||||
gtk_widget_show (radio_box);
|
||||
|
||||
group = NULL;
|
||||
list = g_list_first (image_new_get_image_base_type_names ());
|
||||
while (list)
|
||||
{
|
||||
GimpImageBaseTypeName *name_info;
|
||||
|
||||
name_info = (GimpImageBaseTypeName*) list->data;
|
||||
|
||||
button = gtk_radio_button_new_with_label (group, name_info->name);
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) name_info->type);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (gimp_radio_button_update),
|
||||
&values->type);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (file_new_image_size_callback),
|
||||
info);
|
||||
if (values->type == name_info->type)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
||||
gtk_widget_show (button);
|
||||
|
||||
info->type_w[name_info->type] = button;
|
||||
|
||||
list = g_list_next (list);
|
||||
}
|
||||
|
||||
/* frame for Fill Type */
|
||||
frame = gtk_frame_new (_("Fill Type"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
radio_box = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (radio_box), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), radio_box);
|
||||
gtk_widget_show (radio_box);
|
||||
|
||||
group = NULL;
|
||||
list = g_list_first (image_new_get_fill_type_names ());
|
||||
while (list)
|
||||
{
|
||||
GimpFillTypeName *name_info;
|
||||
|
||||
name_info = (GimpFillTypeName*) list->data;
|
||||
|
||||
button =
|
||||
gtk_radio_button_new_with_label (group, name_info->name);
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) name_info->type);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (gimp_radio_button_update),
|
||||
&values->fill_type);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (file_new_image_size_callback),
|
||||
info);
|
||||
if (values->fill_type == name_info->type)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
||||
gtk_widget_show (button);
|
||||
|
||||
info->fill_type_w[name_info->type] = button;
|
||||
|
||||
list = g_list_next (list);
|
||||
}
|
||||
|
||||
gimp_size_entry_grab_focus (GIMP_SIZE_ENTRY (info->size_se));
|
||||
|
||||
gtk_widget_show (info->dlg);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-1999 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __FILE_NEW_DIALOG_H__
|
||||
#define __FILE_NEW_DIALOG_H__
|
||||
|
||||
|
||||
void file_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer callback_data,
|
||||
guint callback_action);
|
||||
|
||||
void ui_new_image_window_create (const GimpImageNewValues *values);
|
||||
|
||||
|
||||
#endif /* __FILE_NEW_DIALOG_H_H__ */
|
|
@ -30,12 +30,18 @@
|
|||
#include "tools/gimptool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "cursorutil.h"
|
||||
#include "disp_callbacks.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gui/info-window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "gui/menus.h"
|
||||
#include "nav_window.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
|
@ -46,11 +52,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "info_window.h"
|
||||
#include "interface.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "menus.h"
|
||||
#include "nav_window.h"
|
||||
#include "plug_in.h"
|
||||
#include "qmask.h"
|
||||
#include "scale.h"
|
||||
|
@ -58,17 +59,17 @@
|
|||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber.xpm"
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define OVERHEAD 25 /* in units of pixel area */
|
||||
#define EPSILON 5
|
||||
|
||||
#define MAX_TITLE_BUF 256
|
||||
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
#include "tools/gimptool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gdisplay.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "gui/palette-import-dialog.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplayermask.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "palette_import.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
||||
|
|
|
@ -105,23 +105,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "cursorutil.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "palette_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tools/brightness_contrast.h"
|
||||
#include "tools/color_balance.h"
|
||||
#include "tools/curves.h"
|
||||
|
@ -130,8 +113,25 @@
|
|||
#include "tools/posterize.h"
|
||||
#include "tools/threshold.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gui/palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimppalette.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* bleh! */
|
||||
|
|
|
@ -42,9 +42,11 @@
|
|||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
|
||||
#include "gui/color-notebook.h"
|
||||
#include "gui/menus.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "color_notebook.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
#include "errors.h"
|
||||
|
@ -52,7 +54,6 @@
|
|||
#include "gimphelp.h"
|
||||
#include "gimpparasite.h"
|
||||
#include "gimprc.h"
|
||||
#include "menus.h"
|
||||
#include "plug_in.h"
|
||||
#include "gimage.h"
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,36 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GRADIENT_EDITOR_H__
|
||||
#define __GRADIENT_EDITOR_H__
|
||||
|
||||
|
||||
typedef struct _GradientEditor GradientEditor;
|
||||
|
||||
|
||||
GradientEditor * gradient_editor_new (void);
|
||||
|
||||
void gradient_editor_set_gradient (GradientEditor *gradient_editor,
|
||||
GimpGradient *gradient);
|
||||
void gradient_editor_free (GradientEditor *gradient_editor);
|
||||
|
||||
|
||||
#endif /* __GRADIENT_EDITOR_H__ */
|
|
@ -1,355 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
* Copyright (C) 1998 Andy Thomas.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpgradient.h"
|
||||
#include "gradient_editor.h"
|
||||
#include "gradient_select.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
static void gradient_select_change_callbacks (GradientSelect *gsp,
|
||||
gboolean closing);
|
||||
static void gradient_select_gradient_changed (GimpContext *context,
|
||||
GimpGradient *gradient,
|
||||
GradientSelect *gsp);
|
||||
static void gradient_select_close_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gradient_select_edit_gradient (GimpData *data);
|
||||
|
||||
|
||||
/* list of active dialogs */
|
||||
GSList *gradient_active_dialogs = NULL;
|
||||
|
||||
/* the main gradient selection dialog */
|
||||
GradientSelect *gradient_select_dialog = NULL;
|
||||
|
||||
|
||||
/* the main gradient editor dialog */
|
||||
static GradientEditor *gradient_editor_dialog = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
GtkWidget *
|
||||
gradient_dialog_create (void)
|
||||
{
|
||||
if (! gradient_select_dialog)
|
||||
{
|
||||
gradient_select_dialog = gradient_select_new (NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_VISIBLE (gradient_select_dialog->shell))
|
||||
gtk_widget_show (gradient_select_dialog->shell);
|
||||
else
|
||||
gdk_window_raise (gradient_select_dialog->shell->window);
|
||||
}
|
||||
|
||||
return gradient_select_dialog->shell;
|
||||
}
|
||||
|
||||
void
|
||||
gradient_dialog_free (void)
|
||||
{
|
||||
if (gradient_select_dialog)
|
||||
{
|
||||
gradient_select_free (gradient_select_dialog);
|
||||
gradient_select_dialog = NULL;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* If title == NULL then it is the main gradient select dialog */
|
||||
GradientSelect *
|
||||
gradient_select_new (gchar *title,
|
||||
gchar *initial_gradient)
|
||||
{
|
||||
GradientSelect *gsp;
|
||||
GtkWidget *vbox;
|
||||
GimpGradient *active = NULL;
|
||||
|
||||
static gboolean first_call = TRUE;
|
||||
|
||||
gsp = g_new0 (GradientSelect, 1);
|
||||
|
||||
/* The shell */
|
||||
gsp->shell = gimp_dialog_new (title ? title : _("Gradient Selection"),
|
||||
"gradient_selection",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/gradient_selection.html",
|
||||
title ? GTK_WIN_POS_MOUSE : GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
|
||||
"_delete_event_", gradient_select_close_callback,
|
||||
gsp, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (gsp->shell)->vbox)), 0)));
|
||||
|
||||
gtk_widget_hide (GTK_DIALOG (gsp->shell)->action_area);
|
||||
|
||||
if (title)
|
||||
{
|
||||
gsp->context = gimp_context_new (title, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gsp->context = gimp_context_get_user ();
|
||||
|
||||
dialog_register (gsp->shell);
|
||||
}
|
||||
|
||||
if (no_data && first_call)
|
||||
gimp_data_factory_data_init (global_gradient_factory, FALSE);
|
||||
|
||||
first_call = FALSE;
|
||||
|
||||
if (title && initial_gradient && strlen (initial_gradient))
|
||||
{
|
||||
active = (GimpGradient *)
|
||||
gimp_container_get_child_by_name (global_gradient_factory->container,
|
||||
initial_gradient);
|
||||
}
|
||||
else
|
||||
{
|
||||
active = gimp_context_get_gradient (gimp_context_get_user ());
|
||||
}
|
||||
|
||||
if (!active)
|
||||
active = gimp_context_get_gradient (gimp_context_get_standard ());
|
||||
|
||||
if (title)
|
||||
gimp_context_set_gradient (gsp->context, active);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (gsp->shell)->vbox), vbox);
|
||||
|
||||
/* The Gradient List */
|
||||
gsp->view = gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST,
|
||||
global_gradient_factory,
|
||||
gradient_select_edit_gradient,
|
||||
gsp->context,
|
||||
16,
|
||||
10, 10);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), gsp->view, TRUE, TRUE, 0);
|
||||
gtk_widget_show (gsp->view);
|
||||
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_widget_show (gsp->shell);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (gsp->context), "gradient_changed",
|
||||
GTK_SIGNAL_FUNC (gradient_select_gradient_changed),
|
||||
(gpointer) gsp);
|
||||
|
||||
/* Add to active gradient dialogs list */
|
||||
gradient_active_dialogs = g_slist_append (gradient_active_dialogs, gsp);
|
||||
|
||||
return gsp;
|
||||
}
|
||||
|
||||
void
|
||||
gradient_select_free (GradientSelect *gsp)
|
||||
{
|
||||
if (!gsp)
|
||||
return;
|
||||
|
||||
/* remove from active list */
|
||||
gradient_active_dialogs = g_slist_remove (gradient_active_dialogs, gsp);
|
||||
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (gsp->context), gsp);
|
||||
|
||||
if (gsp->callback_name)
|
||||
{
|
||||
g_free (gsp->callback_name);
|
||||
gtk_object_unref (GTK_OBJECT (gsp->context));
|
||||
}
|
||||
|
||||
g_free (gsp);
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_select_change_callbacks (GradientSelect *gsp,
|
||||
gboolean closing)
|
||||
{
|
||||
gchar *name;
|
||||
ProcRecord *prec = NULL;
|
||||
GimpGradient *gradient;
|
||||
gint nreturn_vals;
|
||||
static gboolean busy = FALSE;
|
||||
|
||||
/* Any procs registered to callback? */
|
||||
Argument *return_vals;
|
||||
|
||||
if (!gsp || !gsp->callback_name || busy != 0)
|
||||
return;
|
||||
|
||||
busy = TRUE;
|
||||
|
||||
name = gsp->callback_name;
|
||||
gradient = gimp_context_get_gradient (gsp->context);
|
||||
|
||||
/* If its still registered run it */
|
||||
prec = procedural_db_lookup (name);
|
||||
|
||||
if (prec && gradient)
|
||||
{
|
||||
gdouble *values, *pv;
|
||||
double pos, delta;
|
||||
GimpRGB color;
|
||||
gint i;
|
||||
|
||||
i = gsp->sample_size;
|
||||
pos = 0.0;
|
||||
delta = 1.0 / (i - 1);
|
||||
|
||||
values = g_new (gdouble, 4 * i);
|
||||
pv = values;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
gimp_gradient_get_color_at (gradient, pos, &color);
|
||||
|
||||
*pv++ = color.r;
|
||||
*pv++ = color.g;
|
||||
*pv++ = color.b;
|
||||
*pv++ = color.a;
|
||||
|
||||
pos += delta;
|
||||
}
|
||||
|
||||
return_vals =
|
||||
procedural_db_run_proc (name,
|
||||
&nreturn_vals,
|
||||
PDB_STRING, GIMP_OBJECT (gradient)->name,
|
||||
PDB_INT32, gsp->sample_size * 4,
|
||||
PDB_FLOATARRAY, values,
|
||||
PDB_INT32, (gint) closing,
|
||||
PDB_END);
|
||||
|
||||
if (!return_vals || return_vals[0].value.pdb_int != PDB_SUCCESS)
|
||||
g_message ("failed to run gradient callback function");
|
||||
else
|
||||
procedural_db_destroy_args (return_vals, nreturn_vals);
|
||||
}
|
||||
|
||||
busy = FALSE;
|
||||
}
|
||||
|
||||
/* Close active dialogs that no longer have PDB registered for them */
|
||||
|
||||
void
|
||||
gradient_select_dialogs_check (void)
|
||||
{
|
||||
GradientSelect *gsp;
|
||||
GSList *list;
|
||||
gchar *name;
|
||||
ProcRecord *prec = NULL;
|
||||
|
||||
list = gradient_active_dialogs;
|
||||
|
||||
while (list)
|
||||
{
|
||||
gsp = (GradientSelect *) list->data;
|
||||
list = g_slist_next (list);
|
||||
|
||||
name = gsp->callback_name;
|
||||
|
||||
if (name)
|
||||
{
|
||||
prec = procedural_db_lookup (name);
|
||||
|
||||
if (!prec)
|
||||
{
|
||||
/* Can alter gradient_active_dialogs list */
|
||||
gradient_select_close_callback (NULL, gsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_select_gradient_changed (GimpContext *context,
|
||||
GimpGradient *gradient,
|
||||
GradientSelect *gsp)
|
||||
{
|
||||
if (gradient)
|
||||
{
|
||||
if (gsp->callback_name)
|
||||
gradient_select_change_callbacks (gsp, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_select_close_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GradientSelect *gsp;
|
||||
|
||||
gsp = (GradientSelect *) data;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (gsp->shell))
|
||||
gtk_widget_hide (gsp->shell);
|
||||
|
||||
/* Free memory if poping down dialog which is not the main one */
|
||||
if (gsp != gradient_select_dialog)
|
||||
{
|
||||
gradient_select_change_callbacks (gsp, TRUE);
|
||||
gtk_widget_destroy (gsp->shell);
|
||||
gradient_select_free (gsp);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_select_edit_gradient (GimpData *data)
|
||||
{
|
||||
GimpGradient *gradient;
|
||||
|
||||
gradient = GIMP_GRADIENT (data);
|
||||
|
||||
if (! gradient_editor_dialog)
|
||||
{
|
||||
gradient_editor_dialog = gradient_editor_new ();
|
||||
}
|
||||
|
||||
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GRADIENT_SELECT_H__
|
||||
#define __GRADIENT_SELECT_H__
|
||||
|
||||
|
||||
#define GRADIENT_SAMPLE_SIZE 40
|
||||
|
||||
|
||||
typedef struct _GradientSelect GradientSelect;
|
||||
|
||||
struct _GradientSelect
|
||||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
GtkWidget *view;
|
||||
|
||||
GimpContext *context;
|
||||
gchar *callback_name;
|
||||
gint sample_size;
|
||||
};
|
||||
|
||||
|
||||
/* list of active dialogs */
|
||||
extern GSList *gradient_active_dialogs;
|
||||
|
||||
/* the main gradient selection dialog */
|
||||
extern GradientSelect *gradient_select_dialog;
|
||||
|
||||
|
||||
GradientSelect * gradient_select_new (gchar *title,
|
||||
gchar *initial_gradient);
|
||||
|
||||
void gradient_select_free (GradientSelect *gsp);
|
||||
|
||||
void gradient_select_update_all (GimpGradient *gradient);
|
||||
|
||||
void gradient_select_dialogs_check (void);
|
||||
|
||||
|
||||
/* the main gradient selection */
|
||||
GtkWidget * gradient_dialog_create (void);
|
||||
void gradient_dialog_free (void);
|
||||
|
||||
|
||||
#endif /* __GRADIENT_SELECT_H__ */
|
|
@ -12,62 +12,64 @@ libappgui_la_SOURCES = \
|
|||
gui.c \
|
||||
gui.h \
|
||||
splash.c \
|
||||
splash.h
|
||||
|
||||
## about-dialog.c \
|
||||
## about-dialog.h \
|
||||
## brush-editor.c \
|
||||
## brush-editor.h \
|
||||
## brush-select.c \
|
||||
## brush-select.h \
|
||||
## channels-dialog.c \
|
||||
## channels-dialog.h \
|
||||
## color-area.c \
|
||||
## color-area.h \
|
||||
## color-notebook.c \
|
||||
## color-notebook.h \
|
||||
## color-select.c \
|
||||
## color-select.h \
|
||||
## colormap-dialog.c \
|
||||
## colormap-dialog.h \
|
||||
## commands.c \
|
||||
## commands.h \
|
||||
## file-new-dialog.c \
|
||||
## file-new-dialog.h \
|
||||
## gradient-editor.c \
|
||||
## gradient-editor.h \
|
||||
## gradient-select.h \
|
||||
## gradient-select.c \
|
||||
## indicator-area.c \
|
||||
## indicator-area.h \
|
||||
## info-dialog.c \
|
||||
## info-dialog.h \
|
||||
## info-window.c \
|
||||
## info-window.h \
|
||||
## layer-select.c \
|
||||
## layer-select.h \
|
||||
## layers-dialog.c \
|
||||
## layers-dialog.h \
|
||||
## menus.c \
|
||||
## menus.h \
|
||||
## palette-editor.c \
|
||||
## palette-editor.h \
|
||||
## palette-import-dialog.c \
|
||||
## palette-import-dialog.h \
|
||||
## palette-select.c \
|
||||
## palette-select.h \
|
||||
## paths-dialog.c \
|
||||
## paths-dialog.h \
|
||||
## preferences-dialog.c \
|
||||
## preferences-dialog.h \
|
||||
## session.c \
|
||||
## session.h \
|
||||
## test-commands.c \
|
||||
## test-commands.h \
|
||||
## tips-dialog.c \
|
||||
## tips-dialog.h \
|
||||
## toolbox.c \
|
||||
## toolbox.h
|
||||
splash.h \
|
||||
\
|
||||
about-dialog.c \
|
||||
about-dialog.h \
|
||||
brush-editor.c \
|
||||
brush-editor.h \
|
||||
brush-select.c \
|
||||
brush-select.h \
|
||||
channels-dialog.c \
|
||||
channels-dialog.h \
|
||||
color-area.c \
|
||||
color-area.h \
|
||||
color-notebook.c \
|
||||
color-notebook.h \
|
||||
color-select.c \
|
||||
color-select.h \
|
||||
colormap-dialog.c \
|
||||
colormap-dialog.h \
|
||||
commands.c \
|
||||
commands.h \
|
||||
file-new-dialog.c \
|
||||
file-new-dialog.h \
|
||||
gradient-editor.c \
|
||||
gradient-editor.h \
|
||||
gradient-select.h \
|
||||
gradient-select.c \
|
||||
indicator-area.c \
|
||||
indicator-area.h \
|
||||
info-dialog.c \
|
||||
info-dialog.h \
|
||||
info-window.c \
|
||||
info-window.h \
|
||||
layer-select.c \
|
||||
layer-select.h \
|
||||
layers-dialog.c \
|
||||
layers-dialog.h \
|
||||
menus.c \
|
||||
menus.h \
|
||||
palette-editor.c \
|
||||
palette-editor.h \
|
||||
palette-import-dialog.c \
|
||||
palette-import-dialog.h \
|
||||
palette-select.c \
|
||||
palette-select.h \
|
||||
paths-dialog.c \
|
||||
paths-dialog.h \
|
||||
pattern-select.c \
|
||||
pattern-select.h \
|
||||
preferences-dialog.c \
|
||||
preferences-dialog.h \
|
||||
session.c \
|
||||
session.h \
|
||||
test-commands.c \
|
||||
test-commands.h \
|
||||
tips-dialog.c \
|
||||
tips-dialog.h \
|
||||
toolbox.c \
|
||||
toolbox.h
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Gimp-GUI\"
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
|
@ -33,16 +35,13 @@
|
|||
|
||||
#include "tools/gimptoolinfo.h"
|
||||
|
||||
#include "about-dialog.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "authors.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimphelp.h"
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber2.xpm"
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "brush-editor.h"
|
||||
|
||||
#include "gimpbrushgenerated.h"
|
||||
#include "brush_edit.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -26,12 +26,17 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "brush-editor.h"
|
||||
#include "brush-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "brush_edit.h"
|
||||
#include "brush_select.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpbrushgenerated.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
@ -41,10 +46,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -31,21 +31,22 @@
|
|||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "channels_dialog.h"
|
||||
#include "drawable.h"
|
||||
#include "channels-dialog.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "lc_dialogP.h"
|
||||
#include "menus.h"
|
||||
#include "ops_buttons.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
||||
|
|
|
@ -30,12 +30,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_area.h"
|
||||
#include "color_notebook.h"
|
||||
#include "color-area.h"
|
||||
#include "color-notebook.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdnd.h"
|
||||
|
||||
#include "gimpcontext.h"
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
#include "gdisplay_color.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_area.h"
|
||||
#include "color_notebook.h"
|
||||
#include "colormaps.h"
|
||||
#include "color-area.h"
|
||||
#include "color-notebook.h"
|
||||
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
#include "colormaps.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_select.h"
|
||||
#include "colormaps.h"
|
||||
#include "color-select.h"
|
||||
#include "color-area.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimprc.h"
|
||||
#include "color_area.h"
|
||||
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
#include "colormaps.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -31,15 +31,16 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_notebook.h"
|
||||
#include "color-notebook.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "image_render.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "colormaps.h"
|
||||
#include "color_area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "color-area.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "colormaps.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -33,10 +33,17 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "about_dialog.h"
|
||||
#include "about-dialog.h"
|
||||
#include "color-area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "errorconsole.h"
|
||||
#include "info-dialog.h"
|
||||
#include "info-window.h"
|
||||
#include "layer-select.h"
|
||||
#include "preferences-dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
|
@ -44,7 +51,6 @@
|
|||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
#include "equalize.h"
|
||||
#include "errorconsole.h"
|
||||
#include "file-open.h"
|
||||
#include "file-save.h"
|
||||
#include "floating_sel.h"
|
||||
|
@ -60,20 +66,15 @@
|
|||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "image_render.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "nav_window.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "module_db.h"
|
||||
#include "plug_in.h"
|
||||
#include "preferences_dialog.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "selection.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "toolbox.h"
|
||||
#include "undo.h"
|
||||
#include "undo_history.h"
|
||||
|
|
|
@ -36,18 +36,21 @@
|
|||
#include "widgets/gimpdockbook.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "brush_select.h"
|
||||
#include "brush-select.h"
|
||||
#include "devices.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "docindex.h"
|
||||
#include "errorconsole.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gradient_select.h"
|
||||
#include "palette.h"
|
||||
#include "pattern_select.h"
|
||||
#include "gradient-editor.h"
|
||||
#include "gradient-select.h"
|
||||
#include "lc_dialog.h"
|
||||
|
||||
#include "palette-editor.h"
|
||||
#include "pattern-select.h"
|
||||
#include "toolbox.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gradient_editor.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "image_new.h"
|
||||
#include "file_new_dialog.h"
|
||||
#include "gimprc.h"
|
||||
#include "file-new-dialog.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "image_new.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -60,12 +60,16 @@
|
|||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
|
||||
#include "color_notebook.h"
|
||||
#include "color-notebook.h"
|
||||
#include "gradient-editor.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "datafiles.h"
|
||||
|
@ -77,10 +81,6 @@
|
|||
#include "gimpgradient.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "gradient_editor.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,19 +27,20 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "dialog_handler.h"
|
||||
#include "gradient-editor.h"
|
||||
#include "gradient-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpgradient.h"
|
||||
#include "gradient_editor.h"
|
||||
#include "gradient_select.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -33,10 +33,17 @@
|
|||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "about_dialog.h"
|
||||
#include "about-dialog.h"
|
||||
#include "color-area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "errorconsole.h"
|
||||
#include "info-dialog.h"
|
||||
#include "info-window.h"
|
||||
#include "layer-select.h"
|
||||
#include "preferences-dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
|
@ -44,7 +51,6 @@
|
|||
#include "devices.h"
|
||||
#include "channel_ops.h"
|
||||
#include "equalize.h"
|
||||
#include "errorconsole.h"
|
||||
#include "file-open.h"
|
||||
#include "file-save.h"
|
||||
#include "floating_sel.h"
|
||||
|
@ -60,20 +66,15 @@
|
|||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "image_render.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "nav_window.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "module_db.h"
|
||||
#include "plug_in.h"
|
||||
#include "preferences_dialog.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "selection.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "toolbox.h"
|
||||
#include "undo.h"
|
||||
#include "undo_history.h"
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "gui/dialogs.h"
|
||||
#include "dialogs.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "indicator-area.h"
|
||||
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpgradient.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "indicator_area.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "dialog_handler.h"
|
||||
#include "info-dialog.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "info_dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -30,14 +30,15 @@
|
|||
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "info-dialog.h"
|
||||
#include "info-window.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "layer-select.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimprc.h"
|
||||
#include "layer_select.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
|
|
@ -25,38 +25,38 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "layers-dialog.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplayermask.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "image_render.h"
|
||||
#include "layers_dialog.h"
|
||||
#include "layers_dialogP.h"
|
||||
#include "lc_dialogP.h"
|
||||
#include "menus.h"
|
||||
#include "ops_buttons.h"
|
||||
#include "resize.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/eye.xbm"
|
||||
|
|
|
@ -29,26 +29,24 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gui/dialogs-commands.h"
|
||||
|
||||
#include "tools/gimptoolinfo.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "channels_dialog.h"
|
||||
#include "channels-dialog.h"
|
||||
#include "commands.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "dialogs-commands.h"
|
||||
#include "gdisplay.h"
|
||||
#include "layers-dialog.h"
|
||||
#include "menus.h"
|
||||
#include "paths-dialog.h"
|
||||
#include "test-commands.h"
|
||||
|
||||
#include "file-open.h"
|
||||
#include "file-save.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimphelp.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "layers_dialog.h"
|
||||
#include "menus.h"
|
||||
#include "paths_dialog.h"
|
||||
|
||||
/* test dialogs */
|
||||
#include "test_commands.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -29,8 +30,12 @@
|
|||
#include "widgets/gimpdatafactoryview.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "color_area.h"
|
||||
#include "color_notebook.h"
|
||||
#include "color-area.h"
|
||||
#include "color-notebook.h"
|
||||
#include "palette-editor.h"
|
||||
#include "palette-import-dialog.h"
|
||||
#include "palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimage.h"
|
||||
|
@ -40,11 +45,6 @@
|
|||
#include "gimpdnd.h"
|
||||
#include "gimppalette.h"
|
||||
#include "gimprc.h"
|
||||
#include "palette.h"
|
||||
#include "palette_import.h"
|
||||
#include "palette_select.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gradient-select.h"
|
||||
#include "palette-editor.h"
|
||||
#include "palette-import-dialog.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
@ -36,9 +40,6 @@
|
|||
#include "gimpimage.h"
|
||||
#include "gimppalette.h"
|
||||
#include "gimppalette-import.h"
|
||||
#include "gradient_select.h"
|
||||
#include "palette.h"
|
||||
#include "palette_import.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -29,16 +29,17 @@
|
|||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "palette-editor.h"
|
||||
#include "palette-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimppalette.h"
|
||||
#include "palette_select.h"
|
||||
#include "palette.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -32,27 +32,28 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "tools/gimpbezierselecttool.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "menus.h"
|
||||
#include "ops_buttons.h"
|
||||
#include "paths-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialogP.h"
|
||||
#include "menus.h"
|
||||
#include "ops_buttons.h"
|
||||
#include "path.h"
|
||||
#include "pathP.h"
|
||||
#include "path_transform.h"
|
||||
#include "paths_dialog.h"
|
||||
#include "paths_dialogP.h"
|
||||
#include "plug_in.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tools/gimpbezierselecttool.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/new.xpm"
|
||||
|
|
|
@ -26,20 +26,21 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "widgets/gimpdatafactoryview.h"
|
||||
|
||||
#include "dialog_handler.h"
|
||||
#include "pattern-select.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdatafactory.h"
|
||||
#include "gimppattern.h"
|
||||
#include "pattern_select.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -79,29 +79,30 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "gui/brush-select.h"
|
||||
#include "gui/gradient-select.h"
|
||||
#include "gui/menus.h"
|
||||
#include "gui/pattern-select.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "brush_select.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "general.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "gradient_select.h"
|
||||
#include "menus.h"
|
||||
#include "pattern_select.h"
|
||||
#include "plug_in.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -79,29 +79,30 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "gui/brush-select.h"
|
||||
#include "gui/gradient-select.h"
|
||||
#include "gui/menus.h"
|
||||
#include "gui/pattern-select.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "brush_select.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "general.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "gradient_select.h"
|
||||
#include "menus.h"
|
||||
#include "pattern_select.h"
|
||||
#include "plug_in.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
#include "libgimp/gimpwire.h"
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -24,27 +24,27 @@
|
|||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "layer-select.h"
|
||||
#include "session.h"
|
||||
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "layer_select.h"
|
||||
#include "resolution_calibrate.h"
|
||||
#include "session.h"
|
||||
#include "tile_cache.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
|
|
|
@ -53,11 +53,12 @@
|
|||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
|
||||
#include "color-notebook.h"
|
||||
#include "session.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "color_notebook.h"
|
||||
#include "gimprc.h"
|
||||
#include "session.h"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gui/dialogs.h"
|
||||
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
|
@ -39,8 +37,10 @@
|
|||
#include "widgets/gimpdrawablelistview.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "dialogs.h"
|
||||
#include "gradient-editor.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "gradient_editor.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tips-dialog.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -34,21 +34,21 @@
|
|||
#include "widgets/gimppreview.h"
|
||||
#include "widgets/gtkhwrapbox.h"
|
||||
|
||||
#include "gui/dialogs-commands.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "color_area.h"
|
||||
#include "color-area.h"
|
||||
#include "devices.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "dialogs-commands.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "indicator-area.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimplist.h"
|
||||
#include "gimprc.h"
|
||||
#include "indicator_area.h"
|
||||
#include "menus.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
|
|
|
@ -24,12 +24,15 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gui/file-new-dialog.h"
|
||||
#include "gdisplay.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "file_new_dialog.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplayer.h"
|
||||
|
@ -37,8 +40,6 @@
|
|||
#include "image_new.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber2.xpm"
|
||||
|
|
|
@ -1,230 +0,0 @@
|
|||
/* 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
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
|
||||
#include "gui/dialogs.h"
|
||||
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpgradient.h"
|
||||
#include "gimppattern.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "indicator_area.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define CELL_SIZE 23 /* The size of the previews */
|
||||
#define GRAD_CELL_WIDTH 48 /* The width of the gradient preview */
|
||||
#define GRAD_CELL_HEIGHT 12 /* The height of the gradient preview */
|
||||
#define CELL_PADDING 2 /* How much between brush and pattern cells */
|
||||
|
||||
|
||||
/* Static variables */
|
||||
static GtkWidget *brush_preview;
|
||||
static GtkWidget *pattern_preview;
|
||||
static GtkWidget *gradient_preview;
|
||||
|
||||
|
||||
static void
|
||||
brush_preview_clicked (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
"gimp:brush-select-dialog");
|
||||
}
|
||||
|
||||
static void
|
||||
brush_preview_drop_brush (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
|
||||
context = GIMP_CONTEXT (data);
|
||||
|
||||
gimp_context_set_brush (context, GIMP_BRUSH (viewable));
|
||||
}
|
||||
|
||||
static void
|
||||
pattern_preview_clicked (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
"gimp:pattern-select-dialog");
|
||||
}
|
||||
|
||||
static void
|
||||
pattern_preview_drop_pattern (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
|
||||
context = GIMP_CONTEXT (data);
|
||||
|
||||
gimp_context_set_pattern (context, GIMP_PATTERN (viewable));
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_preview_clicked (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
"gimp:gradient-select-dialog");
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_preview_drop_gradient (GtkWidget *widget,
|
||||
GimpViewable *viewable,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
|
||||
context = GIMP_CONTEXT (data);
|
||||
|
||||
gimp_context_set_gradient (context, GIMP_GRADIENT (viewable));
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
indicator_area_create (GimpContext *context)
|
||||
{
|
||||
GtkWidget *indicator_table;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
indicator_table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (indicator_table), 0, CELL_PADDING);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (indicator_table), 0, CELL_PADDING);
|
||||
|
||||
/* brush preview */
|
||||
|
||||
brush_preview =
|
||||
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (context)),
|
||||
CELL_SIZE, CELL_SIZE, 0,
|
||||
FALSE, TRUE, TRUE);
|
||||
gtk_signal_connect_object_while_alive
|
||||
(GTK_OBJECT (context),
|
||||
"brush_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
||||
GTK_OBJECT (brush_preview));
|
||||
|
||||
gimp_help_set_help_data (brush_preview,
|
||||
_("The active brush.\n"
|
||||
"Click to open the Brushes Dialog."), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (brush_preview), "clicked",
|
||||
GTK_SIGNAL_FUNC (brush_preview_clicked),
|
||||
NULL);
|
||||
gimp_gtk_drag_dest_set_by_type (brush_preview,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
GIMP_TYPE_BRUSH,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_viewable_dest_set (brush_preview,
|
||||
GIMP_TYPE_BRUSH,
|
||||
brush_preview_drop_brush,
|
||||
context);
|
||||
|
||||
gtk_table_attach_defaults (GTK_TABLE (indicator_table), brush_preview,
|
||||
0, 1, 0, 1);
|
||||
|
||||
|
||||
/* pattern preview */
|
||||
|
||||
pattern_preview =
|
||||
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (context)),
|
||||
CELL_SIZE, CELL_SIZE, 0,
|
||||
FALSE, TRUE, TRUE);
|
||||
gtk_signal_connect_object_while_alive
|
||||
(GTK_OBJECT (context),
|
||||
"pattern_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
||||
GTK_OBJECT (pattern_preview));
|
||||
|
||||
gimp_help_set_help_data (pattern_preview,
|
||||
_("The active pattern.\n"
|
||||
"Click to open the Patterns Dialog."), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (pattern_preview), "clicked",
|
||||
GTK_SIGNAL_FUNC (pattern_preview_clicked),
|
||||
NULL);
|
||||
gimp_gtk_drag_dest_set_by_type (pattern_preview,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
GIMP_TYPE_PATTERN,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_viewable_dest_set (pattern_preview,
|
||||
GIMP_TYPE_PATTERN,
|
||||
pattern_preview_drop_pattern,
|
||||
context);
|
||||
|
||||
gtk_table_attach_defaults (GTK_TABLE (indicator_table), pattern_preview,
|
||||
1, 2, 0, 1);
|
||||
|
||||
|
||||
/* gradient preview */
|
||||
|
||||
gradient_preview =
|
||||
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (context)),
|
||||
GRAD_CELL_WIDTH, GRAD_CELL_HEIGHT, 0,
|
||||
FALSE, TRUE, TRUE);
|
||||
gtk_signal_connect_object_while_alive
|
||||
(GTK_OBJECT (context),
|
||||
"gradient_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
|
||||
GTK_OBJECT (gradient_preview));
|
||||
|
||||
gimp_help_set_help_data (gradient_preview,
|
||||
_("The active gradient.\n"
|
||||
"Click to open the Gradients Dialog."), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (gradient_preview), "clicked",
|
||||
GTK_SIGNAL_FUNC (gradient_preview_clicked),
|
||||
NULL);
|
||||
gimp_gtk_drag_dest_set_by_type (gradient_preview,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
GIMP_TYPE_GRADIENT,
|
||||
GDK_ACTION_COPY);
|
||||
gimp_dnd_viewable_dest_set (gradient_preview,
|
||||
GIMP_TYPE_GRADIENT,
|
||||
gradient_preview_drop_gradient,
|
||||
context);
|
||||
|
||||
gtk_table_attach_defaults (GTK_TABLE (indicator_table), gradient_preview,
|
||||
0, 2, 1, 2);
|
||||
|
||||
gtk_widget_show (brush_preview);
|
||||
gtk_widget_show (pattern_preview);
|
||||
gtk_widget_show (gradient_preview);
|
||||
gtk_widget_show (indicator_table);
|
||||
|
||||
return indicator_table;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue