1998-07-09 13:31:06 +08:00
|
|
|
/* 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.
|
|
|
|
*/
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
#include <math.h>
|
1998-09-24 20:05:49 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
1998-07-09 13:31:06 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "gimpbrushgenerated.h"
|
|
|
|
#include "brush_edit.h"
|
1998-07-15 20:15:24 +08:00
|
|
|
#include "actionarea.h"
|
1998-07-09 13:31:06 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1998-07-09 13:31:06 +08:00
|
|
|
|
1998-07-16 19:44:56 +08:00
|
|
|
static void brush_edit_close_callback (GtkWidget *w, void *data);
|
|
|
|
static gint brush_edit_preview_resize (GtkWidget *widget, GdkEvent *event,
|
|
|
|
BrushEditGeneratedWindow *begw);
|
1998-07-15 20:15:24 +08:00
|
|
|
|
|
|
|
/* the action area structure */
|
|
|
|
static ActionAreaItem action_items[] =
|
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
{ N_("Close"), brush_edit_close_callback, NULL, NULL }
|
1998-07-15 20:15:24 +08:00
|
|
|
};
|
|
|
|
|
1998-07-09 13:31:06 +08:00
|
|
|
static void
|
|
|
|
update_brush_callback (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))))
|
|
|
|
{
|
1998-07-15 20:15:24 +08:00
|
|
|
gimp_brush_generated_freeze (begw->brush);
|
1998-07-09 13:31:06 +08:00
|
|
|
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);
|
1998-07-15 20:15:24 +08:00
|
|
|
gimp_brush_generated_thaw (begw->brush);
|
1998-07-09 13:31:06 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-07-15 20:15:24 +08:00
|
|
|
static gint
|
1998-07-09 13:31:06 +08:00
|
|
|
brush_edit_delete_callback (GtkWidget *w,
|
|
|
|
BrushEditGeneratedWindow *begw)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_VISIBLE (w))
|
|
|
|
gtk_widget_hide (w);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-07-15 20:15:24 +08:00
|
|
|
static void
|
|
|
|
brush_edit_clear_preview (BrushEditGeneratedWindow *begw)
|
|
|
|
{
|
|
|
|
unsigned char * buf;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
buf = (unsigned char *) g_malloc (sizeof (char) * 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_callback(GimpBrush *brush,
|
|
|
|
BrushEditGeneratedWindow *begw)
|
|
|
|
{
|
|
|
|
int x, y, width, yend, ystart, xo;
|
|
|
|
int scale;
|
|
|
|
gchar *src, *buf;
|
|
|
|
|
|
|
|
brush_edit_clear_preview (begw);
|
1998-07-16 19:44:56 +08:00
|
|
|
if (brush == NULL)
|
|
|
|
return TRUE;
|
1998-07-15 20:15:24 +08:00
|
|
|
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 = BOUNDS (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++)
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
{
|
|
|
|
/* 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);
|
1998-07-16 19:44:56 +08:00
|
|
|
if (begw->scale != scale)
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
{
|
|
|
|
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);
|
1998-07-15 20:15:24 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-07-09 13:31:06 +08:00
|
|
|
void
|
|
|
|
brush_edit_generated_set_brush(BrushEditGeneratedWindow *begw,
|
|
|
|
GimpBrush *gbrush)
|
|
|
|
{
|
|
|
|
GimpBrushGenerated *brush = 0;
|
1998-09-09 09:35:35 +08:00
|
|
|
if (begw->brush == (GimpBrushGenerated*)gbrush)
|
1998-07-09 13:31:06 +08:00
|
|
|
return;
|
1998-07-15 20:15:24 +08:00
|
|
|
if (begw->brush)
|
1998-07-16 19:44:56 +08:00
|
|
|
{
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_signal_disconnect_by_data(GTK_OBJECT(begw->brush), begw);
|
1998-07-16 19:44:56 +08:00
|
|
|
gtk_object_unref(GTK_OBJECT(begw->brush));
|
1998-09-09 09:35:35 +08:00
|
|
|
begw->brush = NULL;
|
1998-07-16 19:44:56 +08:00
|
|
|
}
|
1998-09-09 09:35:35 +08:00
|
|
|
if (!gbrush || !GIMP_IS_BRUSH_GENERATED(gbrush))
|
|
|
|
{
|
|
|
|
begw->brush = NULL;
|
|
|
|
if (GTK_WIDGET_VISIBLE (begw->shell))
|
|
|
|
gtk_widget_hide (begw->shell);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
brush = GIMP_BRUSH_GENERATED(gbrush);
|
1998-07-09 13:31:06 +08:00
|
|
|
if (begw)
|
|
|
|
{
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_signal_connect(GTK_OBJECT (brush), "dirty",
|
|
|
|
GTK_SIGNAL_FUNC(brush_edit_brush_dirty_callback),
|
|
|
|
begw);
|
1998-07-09 13:31:06 +08:00
|
|
|
begw->brush = NULL;
|
|
|
|
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));
|
|
|
|
begw->brush = brush;
|
1998-07-16 19:44:56 +08:00
|
|
|
gtk_object_ref(GTK_OBJECT(begw->brush));
|
1998-07-15 20:15:24 +08:00
|
|
|
brush_edit_brush_dirty_callback(GIMP_BRUSH(brush), begw);
|
1998-07-09 13:31:06 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BrushEditGeneratedWindow *
|
|
|
|
brush_edit_generated_new ()
|
|
|
|
{
|
|
|
|
BrushEditGeneratedWindow *begw ;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *slider;
|
|
|
|
GtkWidget *table;
|
|
|
|
|
1998-07-15 20:15:24 +08:00
|
|
|
|
1998-07-09 13:31:06 +08:00
|
|
|
|
|
|
|
begw = g_malloc (sizeof (BrushEditGeneratedWindow));
|
1998-07-15 20:15:24 +08:00
|
|
|
begw->brush = NULL;
|
1998-07-09 13:31:06 +08:00
|
|
|
|
|
|
|
begw->shell = gtk_dialog_new ();
|
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (begw->shell), "generatedbrusheditor",
|
|
|
|
"Gimp");
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (begw->shell), _("Brush Editor"));
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_window_set_policy(GTK_WINDOW(begw->shell), FALSE, TRUE, FALSE);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (begw->shell)->vbox), vbox,
|
|
|
|
TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
/* handle the wm close signal */
|
|
|
|
gtk_signal_connect (GTK_OBJECT (begw->shell), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (brush_edit_delete_callback),
|
|
|
|
begw);
|
|
|
|
|
|
|
|
/* Populate the window with some widgets */
|
|
|
|
|
|
|
|
/* 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);
|
1998-07-16 19:44:56 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (begw->preview), 125, 100);
|
|
|
|
gtk_signal_connect_after (GTK_OBJECT(begw->frame), "size_allocate",
|
|
|
|
(GtkSignalFunc) brush_edit_preview_resize,
|
|
|
|
begw);
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (begw->frame), begw->preview);
|
|
|
|
|
|
|
|
gtk_widget_show(begw->preview);
|
|
|
|
gtk_widget_show(begw->frame);
|
|
|
|
|
1998-07-16 19:44:56 +08:00
|
|
|
/* 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);
|
|
|
|
begw->scale = -1;
|
|
|
|
gtk_widget_show(begw->scale_label);
|
1998-07-09 13:31:06 +08:00
|
|
|
/* table for sliders/labels */
|
|
|
|
table = gtk_table_new(2, 4, FALSE);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
/* brush radius scale */
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
label = gtk_label_new (_("Radius:"));
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC(label), 1.0, 0.5);
|
|
|
|
/* gtk_table_attach(GTK_TABLE (table), label, 0, 1, 0, 1, 0, 0, 0, 0); */
|
|
|
|
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 0, 1, 3, 0, 0, 0);
|
1998-07-09 13:31:06 +08:00
|
|
|
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_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 0, 1);
|
|
|
|
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",
|
|
|
|
(GtkSignalFunc) update_brush_callback, begw);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
|
|
|
/* brush hardness scale */
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
label = gtk_label_new (_("Hardness:"));
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC(label), 1.0, 0.5);
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 1, 2, 0, 0, 0, 0);
|
|
|
|
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_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 1, 2);
|
|
|
|
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",
|
|
|
|
(GtkSignalFunc) update_brush_callback, begw);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
|
|
|
/* brush aspect ratio scale */
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
label = gtk_label_new (_("Aspect Ratio:"));
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC(label), 1.0, 0.5);
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 2, 3, 0, 0, 0, 0);
|
|
|
|
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_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 2, 3);
|
|
|
|
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",
|
|
|
|
(GtkSignalFunc) update_brush_callback, begw);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
|
|
|
/* brush angle scale */
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
label = gtk_label_new (_("Angle:"));
|
1998-07-15 20:15:24 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC(label), 1.0, 0.5);
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 3, 4, 0, 0, 0, 0);
|
|
|
|
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_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 3, 4);
|
|
|
|
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",
|
|
|
|
(GtkSignalFunc) update_brush_callback, begw);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
|
|
|
gtk_table_set_row_spacings(GTK_TABLE (table), 3);
|
|
|
|
gtk_table_set_col_spacing(GTK_TABLE (table), 0, 3);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
1998-07-15 20:15:24 +08:00
|
|
|
/* The action area */
|
|
|
|
action_items[0].user_data = begw;
|
|
|
|
build_action_area (GTK_DIALOG (begw->shell), action_items, 1, 0);
|
|
|
|
|
1998-07-09 13:31:06 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
gtk_widget_show (begw->shell);
|
|
|
|
|
|
|
|
|
|
|
|
return begw;
|
|
|
|
}
|
1998-07-15 20:15:24 +08:00
|
|
|
|
1998-07-16 19:44:56 +08:00
|
|
|
static gint
|
|
|
|
brush_edit_preview_resize (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
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_callback(GIMP_BRUSH(begw->brush), begw);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1998-07-15 20:15:24 +08:00
|
|
|
static void
|
|
|
|
brush_edit_close_callback (GtkWidget *w, void *data)
|
|
|
|
{
|
|
|
|
BrushEditGeneratedWindow *begw = (BrushEditGeneratedWindow *)data;
|
|
|
|
if (GTK_WIDGET_VISIBLE (begw->shell))
|
|
|
|
gtk_widget_hide (begw->shell);
|
|
|
|
}
|