mirror of https://github.com/GNOME/gimp.git
special handling of a dropped "Standard" brush/pattern/gradient because
1999-11-14 Michael Natterer <mitch@gimp.org> * app/gimpdnd.c: special handling of a dropped "Standard" brush/pattern/gradient because they are not part of their lists. * app/pattern.c: fill the standard_pattern with a b/w grid.
This commit is contained in:
parent
0c922cd3b0
commit
a4358a5397
|
@ -1,3 +1,10 @@
|
||||||
|
1999-11-14 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/gimpdnd.c: special handling of a dropped "Standard"
|
||||||
|
brush/pattern/gradient because they are not part of their lists.
|
||||||
|
|
||||||
|
* app/pattern.c: fill the standard_pattern with a b/w grid.
|
||||||
|
|
||||||
1999-11-14 Michael Natterer <mitch@gimp.org>
|
1999-11-14 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/airbrush.c
|
* app/airbrush.c
|
||||||
|
|
|
@ -823,7 +823,10 @@ gimp_dnd_set_brush_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
brush = gimp_brush_list_get_brush (brush_list, name);
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
brush = brushes_get_standard_brush ();
|
||||||
|
else
|
||||||
|
brush = gimp_brush_list_get_brush (brush_list, name);
|
||||||
|
|
||||||
if (brush)
|
if (brush)
|
||||||
(* (GimpDndDropBrushFunc) set_brush_func) (widget, brush, set_brush_data);
|
(* (GimpDndDropBrushFunc) set_brush_func) (widget, brush, set_brush_data);
|
||||||
|
@ -927,7 +930,10 @@ gimp_dnd_set_pattern_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
pattern = pattern_list_get_pattern (pattern_list, name);
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
pattern = patterns_get_standard_pattern ();
|
||||||
|
else
|
||||||
|
pattern = pattern_list_get_pattern (pattern_list, name);
|
||||||
|
|
||||||
if (pattern)
|
if (pattern)
|
||||||
(* (GimpDndDropPatternFunc) set_pattern_func) (widget, pattern,
|
(* (GimpDndDropPatternFunc) set_pattern_func) (widget, pattern,
|
||||||
|
@ -1032,7 +1038,12 @@ gimp_dnd_set_gradient_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
if ((gradient = gradient_list_get_gradient (gradients_list, name)))
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
gradient = gradients_get_standard_gradient ();
|
||||||
|
else
|
||||||
|
gradient = gradient_list_get_gradient (gradients_list, name);
|
||||||
|
|
||||||
|
if (gradient)
|
||||||
(* (GimpDndDropGradientFunc) set_gradient_func) (widget, gradient,
|
(* (GimpDndDropGradientFunc) set_gradient_func) (widget, gradient,
|
||||||
set_gradient_data);
|
set_gradient_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,27 +29,23 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "colormaps.h"
|
|
||||||
#include "datafiles.h"
|
#include "datafiles.h"
|
||||||
#include "devices.h"
|
|
||||||
#include "patterns.h"
|
#include "patterns.h"
|
||||||
#include "pattern_header.h"
|
#include "pattern_header.h"
|
||||||
#include "colormaps.h"
|
#include "gimpcontext.h"
|
||||||
#include "errors.h"
|
|
||||||
#include "gimprc.h"
|
#include "gimprc.h"
|
||||||
#include "dialog_handler.h"
|
|
||||||
|
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
/* global variables */
|
/* global variables */
|
||||||
GPattern *active_pattern = NULL;
|
GPattern *active_pattern = NULL;
|
||||||
GSList *pattern_list = NULL;
|
GSList *pattern_list = NULL;
|
||||||
gint num_patterns = 0;
|
gint num_patterns = 0;
|
||||||
|
|
||||||
/* static variables */
|
/* static variables */
|
||||||
static GPattern *standard_pattern = NULL;
|
static GPattern *standard_pattern = NULL;
|
||||||
|
|
||||||
/* static function prototypes */
|
/* local function prototypes */
|
||||||
static GSList * insert_pattern_in_list (GSList *, GPattern *);
|
static GSList * insert_pattern_in_list (GSList *, GPattern *);
|
||||||
static void load_pattern (gchar *);
|
static void load_pattern (gchar *);
|
||||||
static void pattern_free_func (gpointer, gpointer);
|
static void pattern_free_func (gpointer, gpointer);
|
||||||
|
@ -80,7 +76,7 @@ patterns_init (gboolean no_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
patterns_free ()
|
patterns_free (void)
|
||||||
{
|
{
|
||||||
if (pattern_list)
|
if (pattern_list)
|
||||||
{
|
{
|
||||||
|
@ -97,13 +93,23 @@ patterns_get_standard_pattern (void)
|
||||||
{
|
{
|
||||||
if (! standard_pattern)
|
if (! standard_pattern)
|
||||||
{
|
{
|
||||||
|
guchar *data;
|
||||||
|
gint row, col;
|
||||||
|
|
||||||
standard_pattern = g_new (GPattern, 1);
|
standard_pattern = g_new (GPattern, 1);
|
||||||
|
|
||||||
standard_pattern->filename = NULL;
|
standard_pattern->filename = NULL;
|
||||||
standard_pattern->name = g_strdup ("Standard");
|
standard_pattern->name = g_strdup ("Standard");
|
||||||
standard_pattern->index = -1; /* not part of the pattern list */
|
standard_pattern->index = -1; /* not part of the pattern list */
|
||||||
/* TODO: fill it with something */
|
standard_pattern->mask = temp_buf_new (32, 32, 3, 0, 0, NULL);
|
||||||
standard_pattern->mask = temp_buf_new (8, 8, 8, 0, 0, NULL);
|
|
||||||
|
data = temp_buf_data (standard_pattern->mask);
|
||||||
|
|
||||||
|
for (row = 0; row < standard_pattern->mask->height; row++)
|
||||||
|
for (col = 0; col < standard_pattern->mask->width; col++)
|
||||||
|
{
|
||||||
|
*data++ = *data++ = *data++ = (col % 2) && (row % 2) ? 255 : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return standard_pattern;
|
return standard_pattern;
|
||||||
|
|
|
@ -823,7 +823,10 @@ gimp_dnd_set_brush_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
brush = gimp_brush_list_get_brush (brush_list, name);
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
brush = brushes_get_standard_brush ();
|
||||||
|
else
|
||||||
|
brush = gimp_brush_list_get_brush (brush_list, name);
|
||||||
|
|
||||||
if (brush)
|
if (brush)
|
||||||
(* (GimpDndDropBrushFunc) set_brush_func) (widget, brush, set_brush_data);
|
(* (GimpDndDropBrushFunc) set_brush_func) (widget, brush, set_brush_data);
|
||||||
|
@ -927,7 +930,10 @@ gimp_dnd_set_pattern_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
pattern = pattern_list_get_pattern (pattern_list, name);
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
pattern = patterns_get_standard_pattern ();
|
||||||
|
else
|
||||||
|
pattern = pattern_list_get_pattern (pattern_list, name);
|
||||||
|
|
||||||
if (pattern)
|
if (pattern)
|
||||||
(* (GimpDndDropPatternFunc) set_pattern_func) (widget, pattern,
|
(* (GimpDndDropPatternFunc) set_pattern_func) (widget, pattern,
|
||||||
|
@ -1032,7 +1038,12 @@ gimp_dnd_set_gradient_data (GtkWidget *widget,
|
||||||
|
|
||||||
name = (gchar *) vals;
|
name = (gchar *) vals;
|
||||||
|
|
||||||
if ((gradient = gradient_list_get_gradient (gradients_list, name)))
|
if (strcmp (name, "Standard") == 0)
|
||||||
|
gradient = gradients_get_standard_gradient ();
|
||||||
|
else
|
||||||
|
gradient = gradient_list_get_gradient (gradients_list, name);
|
||||||
|
|
||||||
|
if (gradient)
|
||||||
(* (GimpDndDropGradientFunc) set_gradient_func) (widget, gradient,
|
(* (GimpDndDropGradientFunc) set_gradient_func) (widget, gradient,
|
||||||
set_gradient_data);
|
set_gradient_data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue