mirror of https://github.com/GNOME/gimp.git
app/brush_select.[ch] removed almost all code by using the
2001-02-12 Michael Natterer <mitch@gimp.org> * app/brush_select.[ch] * app/pattern_select.[ch]: removed almost all code by using the GimpContainerGridView. * app/brushes.c * app/patterns.c: brush|pattern_select_freeze|thaw_all() don't exist any more. * app/devices.c: made it work again. * app/gimpgradientpreview.c: the gradient popup is 128 x 32 again. * app/plug_in.c: follow the brush and pattern dialog function renaming. * app/gimppalette.[ch] * app/gimppalettepreview.c: added a "Columns" attribute and show the popups accordingly. The palette file format has changed again. It now can have an optional "Columns: <n>" line after the palette's name. * data/palettes/Bgold.gpl * data/palettes/Borders.gpl * data/palettes/Cascade.gpl * data/palettes/China.gpl * data/palettes/Coldfire.gpl * data/palettes/Dark_pastels.gpl * data/palettes/Ega.gpl * data/palettes/Gold.gpl * data/palettes/Grayblue.gpl * data/palettes/Hilite.gpl * data/palettes/Kahki.gpl * data/palettes/Named_Colors.gpl * data/palettes/News3.gpl * data/palettes/Op2.gpl * data/palettes/Plasma.gpl * data/palettes/Visibone.gpl * data/palettes/Visibone_2.gpl * data/palettes/Web.gpl: added the "Columns" parameter where it makes sense and remove those ugly black colors which were hanging around as first color of may palettes.
This commit is contained in:
parent
097ca64786
commit
267894970d
45
ChangeLog
45
ChangeLog
|
@ -1,3 +1,48 @@
|
|||
2001-02-12 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/brush_select.[ch]
|
||||
* app/pattern_select.[ch]: removed almost all code by using
|
||||
the GimpContainerGridView.
|
||||
|
||||
* app/brushes.c
|
||||
* app/patterns.c: brush|pattern_select_freeze|thaw_all() don't
|
||||
exist any more.
|
||||
|
||||
* app/devices.c: made it work again.
|
||||
|
||||
* app/gimpgradientpreview.c: the gradient popup is 128 x 32 again.
|
||||
|
||||
* app/plug_in.c: follow the brush and pattern dialog function
|
||||
renaming.
|
||||
|
||||
* app/gimppalette.[ch]
|
||||
* app/gimppalettepreview.c: added a "Columns" attribute and show
|
||||
the popups accordingly.
|
||||
|
||||
The palette file format has changed again. It now can have an
|
||||
optional "Columns: <n>" line after the palette's name.
|
||||
|
||||
* data/palettes/Bgold.gpl
|
||||
* data/palettes/Borders.gpl
|
||||
* data/palettes/Cascade.gpl
|
||||
* data/palettes/China.gpl
|
||||
* data/palettes/Coldfire.gpl
|
||||
* data/palettes/Dark_pastels.gpl
|
||||
* data/palettes/Ega.gpl
|
||||
* data/palettes/Gold.gpl
|
||||
* data/palettes/Grayblue.gpl
|
||||
* data/palettes/Hilite.gpl
|
||||
* data/palettes/Kahki.gpl
|
||||
* data/palettes/Named_Colors.gpl
|
||||
* data/palettes/News3.gpl
|
||||
* data/palettes/Op2.gpl
|
||||
* data/palettes/Plasma.gpl
|
||||
* data/palettes/Visibone.gpl
|
||||
* data/palettes/Visibone_2.gpl
|
||||
* data/palettes/Web.gpl: added the "Columns" parameter where it
|
||||
makes sense and remove those ugly black colors which were hanging
|
||||
around as first color of may palettes.
|
||||
|
||||
2001-02-12 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am: took gimpcontextpreview.[ch] out of the build
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
1288
app/brush_select.c
1288
app/brush_select.c
File diff suppressed because it is too large
Load Diff
|
@ -32,9 +32,7 @@ struct _BrushSelect
|
|||
GtkWidget *brush_selection_box;
|
||||
GtkWidget *paint_options_box;
|
||||
|
||||
/* The preview and it's vscale data */
|
||||
GtkWidget *preview;
|
||||
GtkAdjustment *sbar_data;
|
||||
GtkWidget *view;
|
||||
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *brush_name;
|
||||
|
@ -46,13 +44,6 @@ struct _BrushSelect
|
|||
GtkWidget *delete_button;
|
||||
GtkWidget *option_menu;
|
||||
|
||||
/* Brush popup */
|
||||
GtkWidget *brush_popup;
|
||||
GtkWidget *brush_preview;
|
||||
guint popup_timeout_tag;
|
||||
guint popup_anim_timeout_tag;
|
||||
guint popup_pipe_index;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
|
||||
|
@ -60,20 +51,6 @@ struct _BrushSelect
|
|||
GimpContext *context;
|
||||
gint spacing_value;
|
||||
|
||||
GimpBrush *dnd_brush;
|
||||
|
||||
/* Some variables to keep the GUI consistent */
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_BRUSH_COLUMNS;
|
||||
gint NUM_BRUSH_ROWS;
|
||||
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
|
||||
GQuark name_changed_handler_id;
|
||||
GQuark dirty_handler_id;
|
||||
};
|
||||
|
@ -85,29 +62,27 @@ extern GSList *brush_active_dialogs;
|
|||
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);
|
||||
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);
|
||||
|
||||
void brush_select_free (BrushSelect *bsp);
|
||||
|
||||
void brush_select_freeze_all (void);
|
||||
void brush_select_thaw_all (void);
|
||||
|
||||
void brushes_check_dialogs (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 */
|
||||
void brush_dialog_free (void);
|
||||
void brush_dialog_create (void);
|
||||
|
||||
|
||||
#endif /* __BRUSH_SELECT_H__ */
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "brush_select.h"
|
||||
#include "brushes.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpbrushgenerated.h"
|
||||
|
@ -43,8 +42,6 @@ brushes_init (gboolean no_data)
|
|||
{
|
||||
gchar *common_brush_path;
|
||||
|
||||
brush_select_freeze_all ();
|
||||
|
||||
common_brush_path = g_strconcat (brush_path,
|
||||
G_SEARCHPATH_SEPARATOR_S,
|
||||
brush_vbr_path,
|
||||
|
@ -68,8 +65,6 @@ brushes_init (gboolean no_data)
|
|||
NULL);
|
||||
|
||||
g_free (common_brush_path);
|
||||
|
||||
brush_select_thaw_all ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,13 +74,9 @@ brushes_free (void)
|
|||
if (gimp_container_num_children (global_brush_list) == 0)
|
||||
return;
|
||||
|
||||
brush_select_freeze_all ();
|
||||
|
||||
gimp_data_list_save_and_clear (GIMP_DATA_LIST (global_brush_list),
|
||||
brush_vbr_path,
|
||||
GIMP_BRUSH_GENERATED_FILE_EXTENSION);
|
||||
|
||||
brush_select_thaw_all ();
|
||||
}
|
||||
|
||||
GimpBrush *
|
||||
|
|
|
@ -112,6 +112,8 @@ gimp_palette_init (GimpPalette *palette)
|
|||
palette->colors = NULL;
|
||||
palette->n_colors = 0;
|
||||
|
||||
palette->n_columns = 0;
|
||||
|
||||
palette->pixmap = NULL;
|
||||
}
|
||||
|
||||
|
@ -165,8 +167,10 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
0, 0,
|
||||
white);
|
||||
|
||||
columns = width / 3;
|
||||
rows = height / 3;
|
||||
#define CELL_SIZE 4
|
||||
|
||||
columns = width / CELL_SIZE;
|
||||
rows = height / CELL_SIZE;
|
||||
|
||||
buf = temp_buf_data (temp_buf);
|
||||
b = g_new (guchar, width * 3);
|
||||
|
@ -184,24 +188,26 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
list = g_list_next (list);
|
||||
|
||||
gimp_rgb_get_uchar (&entry->color,
|
||||
&b[x * 3 * 3 + 0],
|
||||
&b[x * 3 * 3 + 1],
|
||||
&b[x * 3 * 3 + 2]);
|
||||
&b[x * CELL_SIZE * 3 + 0],
|
||||
&b[x * CELL_SIZE * 3 + 1],
|
||||
&b[x * CELL_SIZE * 3 + 2]);
|
||||
|
||||
for (i = 1; i < 3; i++)
|
||||
for (i = 1; i < CELL_SIZE; i++)
|
||||
{
|
||||
b[(x * 3 + i) * 3 + 0] = b[(x * 3) * 3 + 0];
|
||||
b[(x * 3 + i) * 3 + 1] = b[(x * 3) * 3 + 1];
|
||||
b[(x * 3 + i) * 3 + 2] = b[(x * 3) * 3 + 2];
|
||||
b[(x * CELL_SIZE + i) * 3 + 0] = b[(x * CELL_SIZE) * 3 + 0];
|
||||
b[(x * CELL_SIZE + i) * 3 + 1] = b[(x * CELL_SIZE) * 3 + 1];
|
||||
b[(x * CELL_SIZE + i) * 3 + 2] = b[(x * CELL_SIZE) * 3 + 2];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < CELL_SIZE; i++)
|
||||
{
|
||||
memcpy (buf + ((y * 3 + i) * width) * 3, b, width * 3);
|
||||
memcpy (buf + ((y * CELL_SIZE + i) * width) * 3, b, width * 3);
|
||||
}
|
||||
}
|
||||
|
||||
#undef CELL_SIZE
|
||||
|
||||
g_free (b);
|
||||
|
||||
return temp_buf;
|
||||
|
@ -301,6 +307,36 @@ gimp_palette_load (const gchar *filename)
|
|||
}
|
||||
|
||||
linenum++;
|
||||
|
||||
if (! strncmp (str, "Columns: ", strlen ("Columns: ")))
|
||||
{
|
||||
gint columns;
|
||||
|
||||
columns = atoi (g_strstrip (&str[strlen ("Columns: ")]));
|
||||
|
||||
if (columns < 0 || columns > 256)
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\n"
|
||||
"Invalid number or columns"),
|
||||
filename, linenum);
|
||||
|
||||
columns = 0;
|
||||
}
|
||||
|
||||
palette->n_columns = columns;
|
||||
|
||||
if (! fgets (str, 1024, fp))
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\nRead error"),
|
||||
filename, linenum);
|
||||
|
||||
fclose (fp);
|
||||
gtk_object_sink (GTK_OBJECT (palette));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linenum++;
|
||||
}
|
||||
}
|
||||
else /* old palette format */
|
||||
{
|
||||
|
@ -402,7 +438,8 @@ gimp_palette_save (GimpData *data)
|
|||
}
|
||||
|
||||
fprintf (fp, "GIMP Palette\n");
|
||||
fprintf (fp, "Name: %s\n#\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Name: %s\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Columns: %d\n#\n", CLAMP (palette->n_columns, 0, 256));
|
||||
|
||||
for (list = palette->colors; list; list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -112,6 +112,8 @@ gimp_palette_init (GimpPalette *palette)
|
|||
palette->colors = NULL;
|
||||
palette->n_colors = 0;
|
||||
|
||||
palette->n_columns = 0;
|
||||
|
||||
palette->pixmap = NULL;
|
||||
}
|
||||
|
||||
|
@ -165,8 +167,10 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
0, 0,
|
||||
white);
|
||||
|
||||
columns = width / 3;
|
||||
rows = height / 3;
|
||||
#define CELL_SIZE 4
|
||||
|
||||
columns = width / CELL_SIZE;
|
||||
rows = height / CELL_SIZE;
|
||||
|
||||
buf = temp_buf_data (temp_buf);
|
||||
b = g_new (guchar, width * 3);
|
||||
|
@ -184,24 +188,26 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
list = g_list_next (list);
|
||||
|
||||
gimp_rgb_get_uchar (&entry->color,
|
||||
&b[x * 3 * 3 + 0],
|
||||
&b[x * 3 * 3 + 1],
|
||||
&b[x * 3 * 3 + 2]);
|
||||
&b[x * CELL_SIZE * 3 + 0],
|
||||
&b[x * CELL_SIZE * 3 + 1],
|
||||
&b[x * CELL_SIZE * 3 + 2]);
|
||||
|
||||
for (i = 1; i < 3; i++)
|
||||
for (i = 1; i < CELL_SIZE; i++)
|
||||
{
|
||||
b[(x * 3 + i) * 3 + 0] = b[(x * 3) * 3 + 0];
|
||||
b[(x * 3 + i) * 3 + 1] = b[(x * 3) * 3 + 1];
|
||||
b[(x * 3 + i) * 3 + 2] = b[(x * 3) * 3 + 2];
|
||||
b[(x * CELL_SIZE + i) * 3 + 0] = b[(x * CELL_SIZE) * 3 + 0];
|
||||
b[(x * CELL_SIZE + i) * 3 + 1] = b[(x * CELL_SIZE) * 3 + 1];
|
||||
b[(x * CELL_SIZE + i) * 3 + 2] = b[(x * CELL_SIZE) * 3 + 2];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < CELL_SIZE; i++)
|
||||
{
|
||||
memcpy (buf + ((y * 3 + i) * width) * 3, b, width * 3);
|
||||
memcpy (buf + ((y * CELL_SIZE + i) * width) * 3, b, width * 3);
|
||||
}
|
||||
}
|
||||
|
||||
#undef CELL_SIZE
|
||||
|
||||
g_free (b);
|
||||
|
||||
return temp_buf;
|
||||
|
@ -301,6 +307,36 @@ gimp_palette_load (const gchar *filename)
|
|||
}
|
||||
|
||||
linenum++;
|
||||
|
||||
if (! strncmp (str, "Columns: ", strlen ("Columns: ")))
|
||||
{
|
||||
gint columns;
|
||||
|
||||
columns = atoi (g_strstrip (&str[strlen ("Columns: ")]));
|
||||
|
||||
if (columns < 0 || columns > 256)
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\n"
|
||||
"Invalid number or columns"),
|
||||
filename, linenum);
|
||||
|
||||
columns = 0;
|
||||
}
|
||||
|
||||
palette->n_columns = columns;
|
||||
|
||||
if (! fgets (str, 1024, fp))
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\nRead error"),
|
||||
filename, linenum);
|
||||
|
||||
fclose (fp);
|
||||
gtk_object_sink (GTK_OBJECT (palette));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linenum++;
|
||||
}
|
||||
}
|
||||
else /* old palette format */
|
||||
{
|
||||
|
@ -402,7 +438,8 @@ gimp_palette_save (GimpData *data)
|
|||
}
|
||||
|
||||
fprintf (fp, "GIMP Palette\n");
|
||||
fprintf (fp, "Name: %s\n#\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Name: %s\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Columns: %d\n#\n", CLAMP (palette->n_columns, 0, 256));
|
||||
|
||||
for (list = palette->colors; list; list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -112,6 +112,8 @@ gimp_palette_init (GimpPalette *palette)
|
|||
palette->colors = NULL;
|
||||
palette->n_colors = 0;
|
||||
|
||||
palette->n_columns = 0;
|
||||
|
||||
palette->pixmap = NULL;
|
||||
}
|
||||
|
||||
|
@ -165,8 +167,10 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
0, 0,
|
||||
white);
|
||||
|
||||
columns = width / 3;
|
||||
rows = height / 3;
|
||||
#define CELL_SIZE 4
|
||||
|
||||
columns = width / CELL_SIZE;
|
||||
rows = height / CELL_SIZE;
|
||||
|
||||
buf = temp_buf_data (temp_buf);
|
||||
b = g_new (guchar, width * 3);
|
||||
|
@ -184,24 +188,26 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
list = g_list_next (list);
|
||||
|
||||
gimp_rgb_get_uchar (&entry->color,
|
||||
&b[x * 3 * 3 + 0],
|
||||
&b[x * 3 * 3 + 1],
|
||||
&b[x * 3 * 3 + 2]);
|
||||
&b[x * CELL_SIZE * 3 + 0],
|
||||
&b[x * CELL_SIZE * 3 + 1],
|
||||
&b[x * CELL_SIZE * 3 + 2]);
|
||||
|
||||
for (i = 1; i < 3; i++)
|
||||
for (i = 1; i < CELL_SIZE; i++)
|
||||
{
|
||||
b[(x * 3 + i) * 3 + 0] = b[(x * 3) * 3 + 0];
|
||||
b[(x * 3 + i) * 3 + 1] = b[(x * 3) * 3 + 1];
|
||||
b[(x * 3 + i) * 3 + 2] = b[(x * 3) * 3 + 2];
|
||||
b[(x * CELL_SIZE + i) * 3 + 0] = b[(x * CELL_SIZE) * 3 + 0];
|
||||
b[(x * CELL_SIZE + i) * 3 + 1] = b[(x * CELL_SIZE) * 3 + 1];
|
||||
b[(x * CELL_SIZE + i) * 3 + 2] = b[(x * CELL_SIZE) * 3 + 2];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < CELL_SIZE; i++)
|
||||
{
|
||||
memcpy (buf + ((y * 3 + i) * width) * 3, b, width * 3);
|
||||
memcpy (buf + ((y * CELL_SIZE + i) * width) * 3, b, width * 3);
|
||||
}
|
||||
}
|
||||
|
||||
#undef CELL_SIZE
|
||||
|
||||
g_free (b);
|
||||
|
||||
return temp_buf;
|
||||
|
@ -301,6 +307,36 @@ gimp_palette_load (const gchar *filename)
|
|||
}
|
||||
|
||||
linenum++;
|
||||
|
||||
if (! strncmp (str, "Columns: ", strlen ("Columns: ")))
|
||||
{
|
||||
gint columns;
|
||||
|
||||
columns = atoi (g_strstrip (&str[strlen ("Columns: ")]));
|
||||
|
||||
if (columns < 0 || columns > 256)
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\n"
|
||||
"Invalid number or columns"),
|
||||
filename, linenum);
|
||||
|
||||
columns = 0;
|
||||
}
|
||||
|
||||
palette->n_columns = columns;
|
||||
|
||||
if (! fgets (str, 1024, fp))
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\nRead error"),
|
||||
filename, linenum);
|
||||
|
||||
fclose (fp);
|
||||
gtk_object_sink (GTK_OBJECT (palette));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linenum++;
|
||||
}
|
||||
}
|
||||
else /* old palette format */
|
||||
{
|
||||
|
@ -402,7 +438,8 @@ gimp_palette_save (GimpData *data)
|
|||
}
|
||||
|
||||
fprintf (fp, "GIMP Palette\n");
|
||||
fprintf (fp, "Name: %s\n#\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Name: %s\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Columns: %d\n#\n", CLAMP (palette->n_columns, 0, 256));
|
||||
|
||||
for (list = palette->colors; list; list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -54,6 +54,8 @@ struct _GimpPalette
|
|||
GList *colors;
|
||||
gint n_colors;
|
||||
|
||||
gint n_columns;
|
||||
|
||||
/* EEK */
|
||||
GdkPixmap *pixmap;
|
||||
};
|
||||
|
|
|
@ -904,7 +904,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
|
||||
GIMP_TYPE_BRUSH,
|
||||
device_status_drop_brush,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
|
||||
4, 5, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -927,7 +927,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
|
||||
GIMP_TYPE_PATTERN,
|
||||
device_status_drop_pattern,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
|
||||
5, 6, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -950,7 +950,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
|
||||
GIMP_TYPE_GRADIENT,
|
||||
device_status_drop_gradient,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
|
||||
6, 7, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
|
|
@ -137,8 +137,8 @@ gimp_gradient_preview_create_popup (GimpPreview *preview)
|
|||
|
||||
gradient = GIMP_GRADIENT (preview->viewable);
|
||||
|
||||
popup_width = 48;
|
||||
popup_height = 24;
|
||||
popup_width = 128;
|
||||
popup_height = 32;
|
||||
|
||||
return gimp_preview_new_full (preview->viewable,
|
||||
popup_width,
|
||||
|
|
|
@ -112,6 +112,8 @@ gimp_palette_init (GimpPalette *palette)
|
|||
palette->colors = NULL;
|
||||
palette->n_colors = 0;
|
||||
|
||||
palette->n_columns = 0;
|
||||
|
||||
palette->pixmap = NULL;
|
||||
}
|
||||
|
||||
|
@ -165,8 +167,10 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
0, 0,
|
||||
white);
|
||||
|
||||
columns = width / 3;
|
||||
rows = height / 3;
|
||||
#define CELL_SIZE 4
|
||||
|
||||
columns = width / CELL_SIZE;
|
||||
rows = height / CELL_SIZE;
|
||||
|
||||
buf = temp_buf_data (temp_buf);
|
||||
b = g_new (guchar, width * 3);
|
||||
|
@ -184,24 +188,26 @@ gimp_palette_get_new_preview (GimpViewable *viewable,
|
|||
list = g_list_next (list);
|
||||
|
||||
gimp_rgb_get_uchar (&entry->color,
|
||||
&b[x * 3 * 3 + 0],
|
||||
&b[x * 3 * 3 + 1],
|
||||
&b[x * 3 * 3 + 2]);
|
||||
&b[x * CELL_SIZE * 3 + 0],
|
||||
&b[x * CELL_SIZE * 3 + 1],
|
||||
&b[x * CELL_SIZE * 3 + 2]);
|
||||
|
||||
for (i = 1; i < 3; i++)
|
||||
for (i = 1; i < CELL_SIZE; i++)
|
||||
{
|
||||
b[(x * 3 + i) * 3 + 0] = b[(x * 3) * 3 + 0];
|
||||
b[(x * 3 + i) * 3 + 1] = b[(x * 3) * 3 + 1];
|
||||
b[(x * 3 + i) * 3 + 2] = b[(x * 3) * 3 + 2];
|
||||
b[(x * CELL_SIZE + i) * 3 + 0] = b[(x * CELL_SIZE) * 3 + 0];
|
||||
b[(x * CELL_SIZE + i) * 3 + 1] = b[(x * CELL_SIZE) * 3 + 1];
|
||||
b[(x * CELL_SIZE + i) * 3 + 2] = b[(x * CELL_SIZE) * 3 + 2];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < CELL_SIZE; i++)
|
||||
{
|
||||
memcpy (buf + ((y * 3 + i) * width) * 3, b, width * 3);
|
||||
memcpy (buf + ((y * CELL_SIZE + i) * width) * 3, b, width * 3);
|
||||
}
|
||||
}
|
||||
|
||||
#undef CELL_SIZE
|
||||
|
||||
g_free (b);
|
||||
|
||||
return temp_buf;
|
||||
|
@ -301,6 +307,36 @@ gimp_palette_load (const gchar *filename)
|
|||
}
|
||||
|
||||
linenum++;
|
||||
|
||||
if (! strncmp (str, "Columns: ", strlen ("Columns: ")))
|
||||
{
|
||||
gint columns;
|
||||
|
||||
columns = atoi (g_strstrip (&str[strlen ("Columns: ")]));
|
||||
|
||||
if (columns < 0 || columns > 256)
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\n"
|
||||
"Invalid number or columns"),
|
||||
filename, linenum);
|
||||
|
||||
columns = 0;
|
||||
}
|
||||
|
||||
palette->n_columns = columns;
|
||||
|
||||
if (! fgets (str, 1024, fp))
|
||||
{
|
||||
g_message (_("Loading palette %s (line %d):\nRead error"),
|
||||
filename, linenum);
|
||||
|
||||
fclose (fp);
|
||||
gtk_object_sink (GTK_OBJECT (palette));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linenum++;
|
||||
}
|
||||
}
|
||||
else /* old palette format */
|
||||
{
|
||||
|
@ -402,7 +438,8 @@ gimp_palette_save (GimpData *data)
|
|||
}
|
||||
|
||||
fprintf (fp, "GIMP Palette\n");
|
||||
fprintf (fp, "Name: %s\n#\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Name: %s\n", GIMP_OBJECT (palette)->name);
|
||||
fprintf (fp, "Columns: %d\n#\n", CLAMP (palette->n_columns, 0, 256));
|
||||
|
||||
for (list = palette->colors; list; list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -54,6 +54,8 @@ struct _GimpPalette
|
|||
GList *colors;
|
||||
gint n_colors;
|
||||
|
||||
gint n_columns;
|
||||
|
||||
/* EEK */
|
||||
GdkPixmap *pixmap;
|
||||
};
|
||||
|
|
|
@ -137,12 +137,18 @@ gimp_palette_preview_create_popup (GimpPreview *preview)
|
|||
|
||||
palette = GIMP_PALETTE (preview->viewable);
|
||||
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
if (palette->n_columns)
|
||||
popup_width = palette->n_columns;
|
||||
else
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
|
||||
popup_height = MAX (1, palette->n_colors / popup_width);
|
||||
|
||||
g_print ("columns: %d\n", palette->n_columns);
|
||||
|
||||
return gimp_preview_new_full (preview->viewable,
|
||||
popup_width * 3,
|
||||
popup_height * 3,
|
||||
popup_width * 4,
|
||||
popup_height * 4,
|
||||
0,
|
||||
TRUE, FALSE, FALSE);
|
||||
}
|
||||
|
@ -156,11 +162,15 @@ gimp_palette_preview_needs_popup (GimpPreview *preview)
|
|||
|
||||
palette = GIMP_PALETTE (preview->viewable);
|
||||
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
if (palette->n_columns)
|
||||
popup_width = palette->n_columns;
|
||||
else
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
|
||||
popup_height = MAX (1, palette->n_colors / popup_width);
|
||||
|
||||
if (popup_width * 3 > preview->width ||
|
||||
popup_height * 3 > preview->height)
|
||||
if (popup_width * 4 > preview->width ||
|
||||
popup_height * 4 > preview->height)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,9 +32,7 @@ struct _BrushSelect
|
|||
GtkWidget *brush_selection_box;
|
||||
GtkWidget *paint_options_box;
|
||||
|
||||
/* The preview and it's vscale data */
|
||||
GtkWidget *preview;
|
||||
GtkAdjustment *sbar_data;
|
||||
GtkWidget *view;
|
||||
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *brush_name;
|
||||
|
@ -46,13 +44,6 @@ struct _BrushSelect
|
|||
GtkWidget *delete_button;
|
||||
GtkWidget *option_menu;
|
||||
|
||||
/* Brush popup */
|
||||
GtkWidget *brush_popup;
|
||||
GtkWidget *brush_preview;
|
||||
guint popup_timeout_tag;
|
||||
guint popup_anim_timeout_tag;
|
||||
guint popup_pipe_index;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
|
||||
|
@ -60,20 +51,6 @@ struct _BrushSelect
|
|||
GimpContext *context;
|
||||
gint spacing_value;
|
||||
|
||||
GimpBrush *dnd_brush;
|
||||
|
||||
/* Some variables to keep the GUI consistent */
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_BRUSH_COLUMNS;
|
||||
gint NUM_BRUSH_ROWS;
|
||||
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
|
||||
GQuark name_changed_handler_id;
|
||||
GQuark dirty_handler_id;
|
||||
};
|
||||
|
@ -85,29 +62,27 @@ extern GSList *brush_active_dialogs;
|
|||
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);
|
||||
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);
|
||||
|
||||
void brush_select_free (BrushSelect *bsp);
|
||||
|
||||
void brush_select_freeze_all (void);
|
||||
void brush_select_thaw_all (void);
|
||||
|
||||
void brushes_check_dialogs (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 */
|
||||
void brush_dialog_free (void);
|
||||
void brush_dialog_create (void);
|
||||
|
||||
|
||||
#endif /* __BRUSH_SELECT_H__ */
|
||||
|
|
|
@ -904,7 +904,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
|
||||
GIMP_TYPE_BRUSH,
|
||||
device_status_drop_brush,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
|
||||
4, 5, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -927,7 +927,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
|
||||
GIMP_TYPE_PATTERN,
|
||||
device_status_drop_pattern,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
|
||||
5, 6, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -950,7 +950,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
|
||||
GIMP_TYPE_GRADIENT,
|
||||
device_status_drop_gradient,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
|
||||
6, 7, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
|
|
@ -904,7 +904,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
|
||||
GIMP_TYPE_BRUSH,
|
||||
device_status_drop_brush,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
|
||||
4, 5, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -927,7 +927,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
|
||||
GIMP_TYPE_PATTERN,
|
||||
device_status_drop_pattern,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
|
||||
5, 6, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -950,7 +950,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
|
||||
GIMP_TYPE_GRADIENT,
|
||||
device_status_drop_gradient,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
|
||||
6, 7, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -26,44 +26,22 @@ struct _PatternSelect
|
|||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
/* The preview and it's vscale data */
|
||||
GtkWidget *preview;
|
||||
GdkGC *gc;
|
||||
GtkAdjustment *sbar_data;
|
||||
GtkWidget *view;
|
||||
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *pattern_name;
|
||||
GtkWidget *pattern_size;
|
||||
|
||||
/* Pattern popup */
|
||||
GtkWidget *pattern_popup;
|
||||
GtkWidget *pattern_preview;
|
||||
guint popup_timeout_tag;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
|
||||
/* Context to store the current pattern */
|
||||
GimpContext *context;
|
||||
|
||||
GimpPattern *dnd_pattern;
|
||||
|
||||
/* Some variables to keep the GUI consistent */
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_PATTERN_COLUMNS;
|
||||
gint NUM_PATTERN_ROWS;
|
||||
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
|
||||
GQuark name_changed_handler_id;
|
||||
GQuark dirty_handler_id;
|
||||
};
|
||||
|
||||
|
||||
/* list of active dialogs */
|
||||
extern GSList *pattern_active_dialogs;
|
||||
|
||||
|
@ -71,19 +49,15 @@ extern GSList *pattern_active_dialogs;
|
|||
extern PatternSelect *pattern_select_dialog;
|
||||
|
||||
|
||||
PatternSelect * pattern_select_new (gchar *title,
|
||||
gchar *initial_pattern);
|
||||
PatternSelect * pattern_select_new (gchar *title,
|
||||
gchar *initial_pattern);
|
||||
void pattern_select_free (PatternSelect *psp);
|
||||
void pattern_select_dialogs_check (void);
|
||||
|
||||
void pattern_select_free (PatternSelect *psp);
|
||||
|
||||
void pattern_select_freeze_all (void);
|
||||
void pattern_select_thaw_all (void);
|
||||
|
||||
void patterns_check_dialogs (void);
|
||||
|
||||
/* the main pattern selection */
|
||||
void pattern_dialog_create (void);
|
||||
void pattern_dialog_free (void);
|
||||
void pattern_dialog_create (void);
|
||||
void pattern_dialog_free (void);
|
||||
|
||||
|
||||
#endif /* __PATTERN_SELECT_H__ */
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -26,44 +26,22 @@ struct _PatternSelect
|
|||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
/* The preview and it's vscale data */
|
||||
GtkWidget *preview;
|
||||
GdkGC *gc;
|
||||
GtkAdjustment *sbar_data;
|
||||
GtkWidget *view;
|
||||
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *pattern_name;
|
||||
GtkWidget *pattern_size;
|
||||
|
||||
/* Pattern popup */
|
||||
GtkWidget *pattern_popup;
|
||||
GtkWidget *pattern_preview;
|
||||
guint popup_timeout_tag;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
|
||||
/* Context to store the current pattern */
|
||||
GimpContext *context;
|
||||
|
||||
GimpPattern *dnd_pattern;
|
||||
|
||||
/* Some variables to keep the GUI consistent */
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_PATTERN_COLUMNS;
|
||||
gint NUM_PATTERN_ROWS;
|
||||
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
|
||||
GQuark name_changed_handler_id;
|
||||
GQuark dirty_handler_id;
|
||||
};
|
||||
|
||||
|
||||
/* list of active dialogs */
|
||||
extern GSList *pattern_active_dialogs;
|
||||
|
||||
|
@ -71,19 +49,15 @@ extern GSList *pattern_active_dialogs;
|
|||
extern PatternSelect *pattern_select_dialog;
|
||||
|
||||
|
||||
PatternSelect * pattern_select_new (gchar *title,
|
||||
gchar *initial_pattern);
|
||||
PatternSelect * pattern_select_new (gchar *title,
|
||||
gchar *initial_pattern);
|
||||
void pattern_select_free (PatternSelect *psp);
|
||||
void pattern_select_dialogs_check (void);
|
||||
|
||||
void pattern_select_free (PatternSelect *psp);
|
||||
|
||||
void pattern_select_freeze_all (void);
|
||||
void pattern_select_thaw_all (void);
|
||||
|
||||
void patterns_check_dialogs (void);
|
||||
|
||||
/* the main pattern selection */
|
||||
void pattern_dialog_create (void);
|
||||
void pattern_dialog_free (void);
|
||||
void pattern_dialog_create (void);
|
||||
void pattern_dialog_free (void);
|
||||
|
||||
|
||||
#endif /* __PATTERN_SELECT_H__ */
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "gimppattern.h"
|
||||
#include "gimprc.h"
|
||||
#include "patterns.h"
|
||||
#include "pattern_select.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
||||
|
@ -40,8 +39,6 @@ patterns_init (gboolean no_data)
|
|||
|
||||
if (pattern_path != NULL && !no_data)
|
||||
{
|
||||
pattern_select_freeze_all ();
|
||||
|
||||
gimp_data_list_load (GIMP_DATA_LIST (global_pattern_list),
|
||||
pattern_path,
|
||||
|
||||
|
@ -49,8 +46,6 @@ patterns_init (gboolean no_data)
|
|||
GIMP_PATTERN_FILE_EXTENSION,
|
||||
|
||||
NULL);
|
||||
|
||||
pattern_select_thaw_all ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,13 +55,9 @@ patterns_free (void)
|
|||
if (gimp_container_num_children (global_pattern_list) == 0)
|
||||
return;
|
||||
|
||||
pattern_select_freeze_all ();
|
||||
|
||||
gimp_data_list_save_and_clear (GIMP_DATA_LIST (global_pattern_list),
|
||||
pattern_path,
|
||||
GIMP_PATTERN_FILE_EXTENSION);
|
||||
|
||||
pattern_select_thaw_all ();
|
||||
}
|
||||
|
||||
GimpPattern *
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -1218,8 +1218,8 @@ plug_in_close (PlugIn *plug_in,
|
|||
}
|
||||
|
||||
/* Close any dialogs that this plugin might have opened */
|
||||
brushes_check_dialogs ();
|
||||
patterns_check_dialogs ();
|
||||
brush_select_dialogs_check ();
|
||||
pattern_select_dialogs_check ();
|
||||
gradients_check_dialogs ();
|
||||
|
||||
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
||||
|
|
|
@ -904,7 +904,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
|
||||
GIMP_TYPE_BRUSH,
|
||||
device_status_drop_brush,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
|
||||
4, 5, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -927,7 +927,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
|
||||
GIMP_TYPE_PATTERN,
|
||||
device_status_drop_pattern,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
|
||||
5, 6, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -950,7 +950,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
|
||||
GIMP_TYPE_GRADIENT,
|
||||
device_status_drop_gradient,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
|
||||
6, 7, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
|
|
@ -904,7 +904,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
|
||||
GIMP_TYPE_BRUSH,
|
||||
device_status_drop_brush,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
|
||||
4, 5, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -927,7 +927,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
|
||||
GIMP_TYPE_PATTERN,
|
||||
device_status_drop_pattern,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
|
||||
5, 6, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
@ -950,7 +950,7 @@ device_status_create (void)
|
|||
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
|
||||
GIMP_TYPE_GRADIENT,
|
||||
device_status_drop_gradient,
|
||||
NULL);
|
||||
GUINT_TO_POINTER (device_info->device));
|
||||
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
|
||||
6, 7, i, i+1,
|
||||
0, 0, 2, 2);
|
||||
|
|
|
@ -137,8 +137,8 @@ gimp_gradient_preview_create_popup (GimpPreview *preview)
|
|||
|
||||
gradient = GIMP_GRADIENT (preview->viewable);
|
||||
|
||||
popup_width = 48;
|
||||
popup_height = 24;
|
||||
popup_width = 128;
|
||||
popup_height = 32;
|
||||
|
||||
return gimp_preview_new_full (preview->viewable,
|
||||
popup_width,
|
||||
|
|
|
@ -137,12 +137,18 @@ gimp_palette_preview_create_popup (GimpPreview *preview)
|
|||
|
||||
palette = GIMP_PALETTE (preview->viewable);
|
||||
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
if (palette->n_columns)
|
||||
popup_width = palette->n_columns;
|
||||
else
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
|
||||
popup_height = MAX (1, palette->n_colors / popup_width);
|
||||
|
||||
g_print ("columns: %d\n", palette->n_columns);
|
||||
|
||||
return gimp_preview_new_full (preview->viewable,
|
||||
popup_width * 3,
|
||||
popup_height * 3,
|
||||
popup_width * 4,
|
||||
popup_height * 4,
|
||||
0,
|
||||
TRUE, FALSE, FALSE);
|
||||
}
|
||||
|
@ -156,11 +162,15 @@ gimp_palette_preview_needs_popup (GimpPreview *preview)
|
|||
|
||||
palette = GIMP_PALETTE (preview->viewable);
|
||||
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
if (palette->n_columns)
|
||||
popup_width = palette->n_columns;
|
||||
else
|
||||
popup_width = MIN (palette->n_colors, 16);
|
||||
|
||||
popup_height = MAX (1, palette->n_colors / popup_width);
|
||||
|
||||
if (popup_width * 3 > preview->width ||
|
||||
popup_height * 3 > preview->height)
|
||||
if (popup_width * 4 > preview->width ||
|
||||
popup_height * 4 > preview->height)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Bgold
|
||||
#
|
||||
0 0 0 grey0
|
||||
236 216 20 Untitled
|
||||
236 216 20 Untitled
|
||||
236 216 20 Untitled
|
||||
236 212 20 Untitled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Borders
|
||||
#
|
||||
0 0 0 grey0
|
||||
204 52 180 Untitled
|
||||
204 52 180 Untitled
|
||||
204 52 184 Untitled
|
||||
204 48 188 Untitled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Cascade
|
||||
#
|
||||
0 0 0 grey0
|
||||
108 88 128 Untitled
|
||||
108 88 128 Untitled
|
||||
108 88 128 Untitled
|
||||
104 92 132 Untitled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: China
|
||||
#
|
||||
0 0 0 grey0
|
||||
224 76 240 Untitled
|
||||
224 76 240 Untitled
|
||||
224 80 240 Untitled
|
||||
224 84 240 Untitled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Coldfire
|
||||
#
|
||||
0 0 0 grey0
|
||||
0 172 252 Untitled
|
||||
0 172 252 Untitled
|
||||
0 172 252 Untitled
|
||||
0 168 252 Untitled
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Dark pastels
|
||||
#
|
||||
0 0 0 grey0
|
||||
56 104 184 Untitled
|
||||
52 104 180 Untitled
|
||||
52 104 180 Untitled
|
||||
|
@ -257,3 +256,4 @@ Name: Dark pastels
|
|||
56 108 188 Untitled
|
||||
56 104 188 Untitled
|
||||
56 104 184 Untitled
|
||||
56 104 184 Untitled
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Ega
|
||||
Columns: 16
|
||||
#
|
||||
0 0 0 grey0
|
||||
168 0 168 Untitled
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Gold
|
||||
#
|
||||
0 0 0 grey0
|
||||
252 252 128 Untitled
|
||||
252 252 128 Untitled
|
||||
252 248 124 Untitled
|
||||
|
@ -257,3 +256,4 @@ Name: Gold
|
|||
0 0 0 grey0
|
||||
0 0 0 grey0
|
||||
0 0 0 grey0
|
||||
0 0 0 grey0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Grayblue
|
||||
#
|
||||
0 0 0 grey0
|
||||
124 164 128 Untitled
|
||||
124 164 128 Untitled
|
||||
124 164 124 Untitled
|
||||
124 160 124 Untitled
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Hilite
|
||||
#
|
||||
0 0 0 grey0
|
||||
164 144 180 Untitled
|
||||
160 144 180 Untitled
|
||||
160 144 180 Untitled
|
||||
|
@ -257,3 +256,4 @@ Name: Hilite
|
|||
160 184 176 Untitled
|
||||
160 184 176 Untitled
|
||||
156 180 176 Untitled
|
||||
156 180 176 Untitled
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Kahki
|
||||
#
|
||||
0 0 0 grey0
|
||||
144 132 108 Untitled
|
||||
144 132 112 Untitled
|
||||
144 132 112 Untitled
|
||||
|
@ -257,3 +256,4 @@ Name: Kahki
|
|||
64 96 36 Untitled
|
||||
64 92 36 Untitled
|
||||
60 92 36 Untitled
|
||||
60 92 36 Untitled
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Named Colors
|
||||
Columns: 16
|
||||
#
|
||||
255 250 250 snow (255 250 250)
|
||||
248 248 255 ghost white (248 248 255)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: News3
|
||||
#
|
||||
0 0 0 grey0
|
||||
236 232 4 Untitled
|
||||
236 232 4 Untitled
|
||||
232 232 4 Untitled
|
||||
228 232 4 Untitled
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GIMP Palette
|
||||
Name: Op2
|
||||
#
|
||||
0 0 0 grey0
|
||||
204 144 100 Untitled
|
||||
204 144 100 Untitled
|
||||
200 148 104 Untitled
|
||||
200 152 108 Untitled
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Plasma
|
||||
Columns: 16
|
||||
#
|
||||
240 240 0 Untitled
|
||||
240 224 0 Untitled
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Visibone
|
||||
Columns: 16
|
||||
#
|
||||
# Visibone -- GIMP Palette file
|
||||
#
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Visibone 2
|
||||
Columns: 16
|
||||
#
|
||||
# Visibone 2 -- GIMP Palette file
|
||||
#
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
GIMP Palette
|
||||
Name: Web
|
||||
Columns: 6
|
||||
#
|
||||
255 255 255 Untitled
|
||||
255 255 204 Untitled
|
||||
|
|
Loading…
Reference in New Issue