user_install added gimpressionist, levels, and curves dirs

* user_install
* user_install.bat: added gimpressionist, levels, and curves dirs

* app/color_panel.c
* app/color_select.c
* app/colormaps.[ch]
* app/palette.c
* app/selection.c: remove vestigal colormap code; use get_color
directly now

* libgimp/color_display.h
* app/gdisplay_color.c: bugfixes, added state load/save hooks,
redid the interface to work on blocks, removed dummy default
handler, work on gamma correction stuff

* app/gimpbrushpipe.c: #include <stdlib.h>

* app/gximage.c: minor cleanups

* app/levels.c: default to ~/.gimp-1.1/levels for load/save; minor
gui prettification

* app/main.c
* app/menus.c: plug-in menu translation patch from SHIRASAKI Yasuhiro
<yasuhiro@awa.tohoku.ac.jp>

* libgimp/stdplugins-intl.h: add INIT_I18N_UI() for calling
gtk_set_locale()

* plug-ins/Lighting/lightin_main.c: use INIT_I18N_UI()

-Yosh
This commit is contained in:
Manish Singh 1999-08-27 21:06:00 +00:00
parent df7ad092f4
commit 4a9ae94655
40 changed files with 390 additions and 218 deletions

View File

@ -1,3 +1,36 @@
Fri Aug 27 10:57:28 PDT 1999 Manish Singh <yosh@gimp.org>
* user_install
* user_install.bat: added gimpressionist, levels, and curves dirs
* app/color_panel.c
* app/color_select.c
* app/colormaps.[ch]
* app/palette.c
* app/selection.c: remove vestigal colormap code; use get_color
directly now
* libgimp/color_display.h
* app/gdisplay_color.c: bugfixes, added state load/save hooks,
redid the interface to work on blocks, removed dummy default
handler, work on gamma correction stuff
* app/gimpbrushpipe.c: #include <stdlib.h>
* app/gximage.c: minor cleanups
* app/levels.c: default to ~/.gimp-1.1/levels for load/save; minor
gui prettification
* app/main.c
* app/menus.c: plug-in menu translation patch from SHIRASAKI Yasuhiro
<yasuhiro@awa.tohoku.ac.jp>
* libgimp/stdplugins-intl.h: add INIT_I18N_UI() for calling
gtk_set_locale()
* plug-ins/Lighting/lightin_main.c: use INIT_I18N_UI()
Fri Aug 27 18:57:50 BST 1999 Andy Thomas <alt@gimp.org>
* app/nav_window.c

View File

@ -170,11 +170,9 @@ color_panel_draw (ColorPanel *color_panel)
private = (ColorPanelPrivate *) color_panel->private_part;
widget = private->drawing_area;
fg.pixel = old_color_pixel;
store_color (&fg.pixel,
color_panel->color[0],
color_panel->color[1],
color_panel->color[2]);
fg.pixel = get_color (color_panel->color[0],
color_panel->color[1],
color_panel->color[2]);
gdk_gc_set_foreground (private->gc, &fg);
gdk_draw_rectangle (widget->window, private->gc, 1, 0, 0,

View File

@ -957,9 +957,10 @@ color_select_update_colors (ColorSelect *csp,
/* if we haven't yet been realised, there's no need to redraw
* anything. */
if (!window) return;
if (!window)
return;
store_color (&color.pixel, red, green, blue);
color.pixel = get_color (red, green, blue);
gdk_window_get_size (window, &width, &height);

View File

@ -50,54 +50,25 @@ gulong new_color_pixel;
gulong marching_ants_pixels[8];
static void make_color (gulong *pixel_ptr,
int red,
int green,
int blue,
int readwrite);
static void
set_app_colors (void)
{
cycled_marching_ants = FALSE;
make_color (&g_black_pixel, 0, 0, 0, FALSE);
make_color (&g_gray_pixel, 127, 127, 127, FALSE);
make_color (&g_white_pixel, 255, 255, 255, FALSE);
make_color (&g_color_pixel, 255, 255, 0, FALSE);
make_color (&g_normal_guide_pixel, 0, 127, 255, FALSE);
make_color (&g_active_guide_pixel, 255, 0, 0, FALSE);
g_black_pixel = get_color (0, 0, 0);
g_gray_pixel = get_color (127, 127, 127);
g_white_pixel = get_color (255, 255, 255);
g_color_pixel = get_color (255, 255, 0);
store_color (&foreground_pixel, 0, 0, 0);
store_color (&background_pixel, 255, 255, 255);
store_color (&old_color_pixel, 0, 0, 0);
store_color (&new_color_pixel, 255, 255, 255);
g_normal_guide_pixel = get_color (0, 127, 255);
g_active_guide_pixel = get_color (255, 0, 0);
foreground_pixel = get_color (0, 0, 0);
background_pixel = get_color (255, 255, 255);
old_color_pixel = get_color (0, 0, 0);
new_color_pixel = get_color (255, 255, 255);
}
/* This probably doesn't belong here - RLL*/
/* static unsigned int
gamma_correct (int intensity, double gamma)
{
unsigned int val;
double ind;
double one_over_gamma;
if (gamma != 0.0)
one_over_gamma = 1.0 / gamma;
else
one_over_gamma = 1.0;
ind = (double) intensity / 256.0;
val = (int) (256 * pow (ind, one_over_gamma));
return val;
} */
/*************************************************************************/
gulong
get_color (int red,
int green,
@ -106,29 +77,8 @@ get_color (int red,
return gdk_rgb_xpixel_from_rgb ((red << 16) | (green << 8) | blue);
}
static void
make_color (gulong *pixel_ptr,
int red,
int green,
int blue,
int readwrite)
{
*pixel_ptr = get_color (red, green, blue);
}
void
store_color (gulong *pixel_ptr,
int red,
int green,
int blue)
{
*pixel_ptr = get_color (red, green, blue);
}
void
get_standard_colormaps ()
get_standard_colormaps (void)
{
GtkPreviewInfo *info;

View File

@ -43,8 +43,6 @@ extern gulong new_color_pixel;
extern gulong marching_ants_pixels[8];
gulong get_color (int red, int green, int blue);
void store_color (gulong *pixel, int red, int green, int blue);
void get_standard_colormaps (void);
#endif /* __COLORMAPS_H__ */

View File

@ -21,6 +21,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "appenv.h"

View File

@ -21,6 +21,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "appenv.h"

View File

@ -599,9 +599,6 @@ render_image_rgb (RenderInfo *info)
dest[1] = src[1];
dest[2] = src[2];
/* info->gdisp->cd_convert (info->gdisp->cd_ID, x, y,
src[0], src[1], src[2], dest); */
src += 3;
dest += 3;
}

View File

@ -93,9 +93,9 @@ cycle_ant_colors (Selection *select)
{
index = (i + (8 - select->index_in)) % 8;
if (index < 4)
store_color (&marching_ants_pixels[i], 0, 0, 0);
marching_ants_pixels[i] = get_color (0, 0, 0);
else
store_color (&marching_ants_pixels[i], 255, 255, 255);
marching_ants_pixels[i] = get_color (255, 255, 255);
}
}

View File

@ -93,12 +93,9 @@ gdisplay_color_attach (GDisplay *gdisp,
info->refs = g_slist_append (info->refs, gdisp);
if (info->methods.new)
{
gdisp->cd_ID = info->methods.new (gdisp->gimage->base_type,
gdisp->gimage->width,
gdisp->gimage->height);
gdisp->cd_convert = info->methods.convert;
}
gdisp->cd_ID = info->methods.new (gdisp->gimage->base_type);
gdisp->cd_convert = info->methods.convert;
}
}
@ -107,45 +104,72 @@ gdisplay_color_detach (GDisplay *gdisp)
{
ColorDisplayInfo *info;
if ((info = g_hash_table_lookup (color_display_table, gdisp->cd_name)))
if (gdisp->cd_name)
{
if (info->methods.destroy)
info->methods.destroy (gdisp->cd_ID);
if ((info = g_hash_table_lookup (color_display_table, gdisp->cd_name)))
{
if (info->methods.destroy)
info->methods.destroy (gdisp->cd_ID);
info->refs = g_slist_remove (info->refs, gdisp);
info->refs = g_slist_remove (info->refs, gdisp);
if (!info->refs && info->methods.finalize)
info->methods.finalize ();
}
g_free (gdisp->cd_name);
if (!info->refs && info->methods.finalize)
info->methods.finalize ();
}
g_free (gdisp->cd_name);
gdisp->cd_name = NULL;
}
}
typedef struct _GammaContext GammaContext;
struct _GammaContext
{
double gamma;
guchar *lookup;
};
static
gpointer gamma_new (int type)
{
int i;
GammaContext *context = NULL;
context = g_new (GammaContext, 1);
context->gamma = 1.0;
context->lookup = g_new (guchar, 256);
for (i = 0; i < 256; i++)
context->lookup[i] = i;
return context;
}
static
void dummy_convert (gpointer cd_ID,
int x,
int y,
guchar r,
guchar g,
guchar b,
guchar *dest)
void gamma_destroy (gpointer cd_ID)
{
dest[0] = r;
dest[1] = g;
dest[2] = b;
GammaContext *context = (GammaContext *) cd_ID;
g_free (context->lookup);
g_free (context);
}
static
void gamma_convert (gpointer cd_ID,
guchar *buf,
int width,
int height,
int bpp)
{
int i;
guchar *lookup = ((GammaContext *) cd_ID)->lookup;
for (i = 0; i < width * height * bpp; i++)
*buf++ = lookup[*buf];
}
void
gdisplay_color_init (void)
{
GimpColorDisplayMethods methods = {
NULL,
NULL,
dummy_convert,
NULL,
NULL,
NULL
};
gimp_color_display_register ("None", &methods);
}

View File

@ -599,9 +599,6 @@ render_image_rgb (RenderInfo *info)
dest[1] = src[1];
dest[2] = src[2];
/* info->gdisp->cd_convert (info->gdisp->cd_ID, x, y,
src[0], src[1], src[2], dest); */
src += 3;
dest += 3;
}

View File

@ -93,9 +93,9 @@ cycle_ant_colors (Selection *select)
{
index = (i + (8 - select->index_in)) % 8;
if (index < 4)
store_color (&marching_ants_pixels[i], 0, 0, 0);
marching_ants_pixels[i] = get_color (0, 0, 0);
else
store_color (&marching_ants_pixels[i], 255, 255, 255);
marching_ants_pixels[i] = get_color (255, 255, 255);
}
}

View File

@ -47,7 +47,7 @@ create_gximage (GdkVisual *visual, int width, int height)
{
GXImage * gximage;
gximage = (GXImage *) g_malloc (sizeof (GXImage));
gximage = g_new (GXImage, 1);
gximage->visual = visual;
gximage->gc = NULL;
@ -72,37 +72,37 @@ delete_gximage (GXImage *gximage)
/* Function definitions */
void
gximage_init ()
gximage_init (void)
{
gximage = create_gximage (g_visual, GXIMAGE_WIDTH, GXIMAGE_HEIGHT);
}
void
gximage_free ()
gximage_free (void)
{
delete_gximage (gximage);
}
guchar*
gximage_get_data ()
gximage_get_data (void)
{
return gximage->data;
}
int
gximage_get_bpp ()
gximage_get_bpp (void)
{
return 3;
}
int
gximage_get_bpl ()
gximage_get_bpl (void)
{
return 3 * GXIMAGE_WIDTH;
}
int
gximage_get_byte_order ()
gximage_get_byte_order (void)
{
return GDK_MSB_FIRST;
}

View File

@ -93,12 +93,9 @@ gdisplay_color_attach (GDisplay *gdisp,
info->refs = g_slist_append (info->refs, gdisp);
if (info->methods.new)
{
gdisp->cd_ID = info->methods.new (gdisp->gimage->base_type,
gdisp->gimage->width,
gdisp->gimage->height);
gdisp->cd_convert = info->methods.convert;
}
gdisp->cd_ID = info->methods.new (gdisp->gimage->base_type);
gdisp->cd_convert = info->methods.convert;
}
}
@ -107,45 +104,72 @@ gdisplay_color_detach (GDisplay *gdisp)
{
ColorDisplayInfo *info;
if ((info = g_hash_table_lookup (color_display_table, gdisp->cd_name)))
if (gdisp->cd_name)
{
if (info->methods.destroy)
info->methods.destroy (gdisp->cd_ID);
if ((info = g_hash_table_lookup (color_display_table, gdisp->cd_name)))
{
if (info->methods.destroy)
info->methods.destroy (gdisp->cd_ID);
info->refs = g_slist_remove (info->refs, gdisp);
info->refs = g_slist_remove (info->refs, gdisp);
if (!info->refs && info->methods.finalize)
info->methods.finalize ();
}
g_free (gdisp->cd_name);
if (!info->refs && info->methods.finalize)
info->methods.finalize ();
}
g_free (gdisp->cd_name);
gdisp->cd_name = NULL;
}
}
typedef struct _GammaContext GammaContext;
struct _GammaContext
{
double gamma;
guchar *lookup;
};
static
gpointer gamma_new (int type)
{
int i;
GammaContext *context = NULL;
context = g_new (GammaContext, 1);
context->gamma = 1.0;
context->lookup = g_new (guchar, 256);
for (i = 0; i < 256; i++)
context->lookup[i] = i;
return context;
}
static
void dummy_convert (gpointer cd_ID,
int x,
int y,
guchar r,
guchar g,
guchar b,
guchar *dest)
void gamma_destroy (gpointer cd_ID)
{
dest[0] = r;
dest[1] = g;
dest[2] = b;
GammaContext *context = (GammaContext *) cd_ID;
g_free (context->lookup);
g_free (context);
}
static
void gamma_convert (gpointer cd_ID,
guchar *buf,
int width,
int height,
int bpp)
{
int i;
guchar *lookup = ((GammaContext *) cd_ID)->lookup;
for (i = 0; i < width * height * bpp; i++)
*buf++ = lookup[*buf];
}
void
gdisplay_color_init (void)
{
GimpColorDisplayMethods methods = {
NULL,
NULL,
dummy_convert,
NULL,
NULL,
NULL
};
gimp_color_display_register ("None", &methods);
}

View File

@ -21,6 +21,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "appenv.h"

View File

@ -957,9 +957,10 @@ color_select_update_colors (ColorSelect *csp,
/* if we haven't yet been realised, there's no need to redraw
* anything. */
if (!window) return;
if (!window)
return;
store_color (&color.pixel, red, green, blue);
color.pixel = get_color (red, green, blue);
gdk_window_get_size (window, &width, &height);

View File

@ -833,7 +833,25 @@ static gchar *
menu_translate (const gchar *path,
gpointer data)
{
return gettext (path);
static gchar menupath[256];
gchar *retval;
retval = gettext (path);
if (!strcmp (path, retval))
{
strcpy (menupath, "<Image>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Image>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
if (!strcmp (path, retval))
{
strcpy (menupath, "<Toolbox>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Toolbox>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
}
}
return retval;
}
static gint

View File

@ -276,7 +276,7 @@ palette_set_foreground (gint r,
palette_get_foreground (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&foreground_pixel, rr, gg, bb);
foreground_pixel = get_color (rr, gg, bb);
color_area_update ();
device_status_update (current_device);
}
@ -297,7 +297,7 @@ palette_set_background (gint r,
palette_get_background (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&background_pixel, rr, gg, bb);
background_pixel = get_color (rr, gg, bb);
color_area_update ();
}
}

View File

@ -47,7 +47,7 @@ create_gximage (GdkVisual *visual, int width, int height)
{
GXImage * gximage;
gximage = (GXImage *) g_malloc (sizeof (GXImage));
gximage = g_new (GXImage, 1);
gximage->visual = visual;
gximage->gc = NULL;
@ -72,37 +72,37 @@ delete_gximage (GXImage *gximage)
/* Function definitions */
void
gximage_init ()
gximage_init (void)
{
gximage = create_gximage (g_visual, GXIMAGE_WIDTH, GXIMAGE_HEIGHT);
}
void
gximage_free ()
gximage_free (void)
{
delete_gximage (gximage);
}
guchar*
gximage_get_data ()
gximage_get_data (void)
{
return gximage->data;
}
int
gximage_get_bpp ()
gximage_get_bpp (void)
{
return 3;
}
int
gximage_get_bpl ()
gximage_get_bpl (void)
{
return 3 * GXIMAGE_WIDTH;
}
int
gximage_get_byte_order ()
gximage_get_byte_order (void)
{
return GDK_MSB_FIRST;
}

View File

@ -599,9 +599,6 @@ render_image_rgb (RenderInfo *info)
dest[1] = src[1];
dest[2] = src[2];
/* info->gdisp->cd_convert (info->gdisp->cd_ID, x, y,
src[0], src[1], src[2], dest); */
src += 3;
dest += 3;
}

View File

@ -36,6 +36,7 @@
#include "lut_funcs.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpenv.h"
#define LOW_INPUT 0x1
#define GAMMA 0x2
@ -553,6 +554,7 @@ levels_new_dialog ()
gtk_widget_show (toggle);
button = gtk_button_new_with_label (_("Load"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_load_callback,
@ -560,6 +562,7 @@ levels_new_dialog ()
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Save"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_save_callback,
@ -1387,12 +1390,19 @@ levels_output_da_events (GtkWidget *widget,
static void
make_file_dlg (gpointer data)
{
gchar *temp;
file_dlg = gtk_file_selection_new (_("Load/Save Levels"));
gtk_window_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->cancel_button),
"clicked", (GtkSignalFunc) file_cancel_callback, data);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->ok_button),
"clicked", (GtkSignalFunc) file_ok_callback, data);
temp = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "levels" G_DIR_SEPARATOR_S,
gimp_directory ());
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_dlg), temp);
g_free (temp);
}
static void

View File

@ -126,6 +126,7 @@ main (int argc, char **argv)
#endif
#ifdef LOCALEDIR
bindtextdomain("gimp", LOCALEDIR);
bindtextdomain("gimp-std-plugins", LOCALEDIR);
#else
bindtextdomain("gimp", g_strconcat (gimp_data_directory (),
G_DIR_SEPARATOR_S,

View File

@ -833,7 +833,25 @@ static gchar *
menu_translate (const gchar *path,
gpointer data)
{
return gettext (path);
static gchar menupath[256];
gchar *retval;
retval = gettext (path);
if (!strcmp (path, retval))
{
strcpy (menupath, "<Image>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Image>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
if (!strcmp (path, retval))
{
strcpy (menupath, "<Toolbox>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Toolbox>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
}
}
return retval;
}
static gint

View File

@ -833,7 +833,25 @@ static gchar *
menu_translate (const gchar *path,
gpointer data)
{
return gettext (path);
static gchar menupath[256];
gchar *retval;
retval = gettext (path);
if (!strcmp (path, retval))
{
strcpy (menupath, "<Image>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Image>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
if (!strcmp (path, retval))
{
strcpy (menupath, "<Toolbox>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Toolbox>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
}
}
return retval;
}
static gint

View File

@ -276,7 +276,7 @@ palette_set_foreground (gint r,
palette_get_foreground (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&foreground_pixel, rr, gg, bb);
foreground_pixel = get_color (rr, gg, bb);
color_area_update ();
device_status_update (current_device);
}
@ -297,7 +297,7 @@ palette_set_background (gint r,
palette_get_background (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&background_pixel, rr, gg, bb);
background_pixel = get_color (rr, gg, bb);
color_area_update ();
}
}

View File

@ -93,9 +93,9 @@ cycle_ant_colors (Selection *select)
{
index = (i + (8 - select->index_in)) % 8;
if (index < 4)
store_color (&marching_ants_pixels[i], 0, 0, 0);
marching_ants_pixels[i] = get_color (0, 0, 0);
else
store_color (&marching_ants_pixels[i], 255, 255, 255);
marching_ants_pixels[i] = get_color (255, 255, 255);
}
}

View File

@ -36,6 +36,7 @@
#include "lut_funcs.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpenv.h"
#define LOW_INPUT 0x1
#define GAMMA 0x2
@ -553,6 +554,7 @@ levels_new_dialog ()
gtk_widget_show (toggle);
button = gtk_button_new_with_label (_("Load"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_load_callback,
@ -560,6 +562,7 @@ levels_new_dialog ()
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Save"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_save_callback,
@ -1387,12 +1390,19 @@ levels_output_da_events (GtkWidget *widget,
static void
make_file_dlg (gpointer data)
{
gchar *temp;
file_dlg = gtk_file_selection_new (_("Load/Save Levels"));
gtk_window_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->cancel_button),
"clicked", (GtkSignalFunc) file_cancel_callback, data);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->ok_button),
"clicked", (GtkSignalFunc) file_ok_callback, data);
temp = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "levels" G_DIR_SEPARATOR_S,
gimp_directory ());
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_dlg), temp);
g_free (temp);
}
static void

View File

@ -36,6 +36,7 @@
#include "lut_funcs.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpenv.h"
#define LOW_INPUT 0x1
#define GAMMA 0x2
@ -553,6 +554,7 @@ levels_new_dialog ()
gtk_widget_show (toggle);
button = gtk_button_new_with_label (_("Load"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_load_callback,
@ -560,6 +562,7 @@ levels_new_dialog ()
gtk_widget_show (button);
button = gtk_button_new_with_label (_("Save"));
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) levels_save_callback,
@ -1387,12 +1390,19 @@ levels_output_da_events (GtkWidget *widget,
static void
make_file_dlg (gpointer data)
{
gchar *temp;
file_dlg = gtk_file_selection_new (_("Load/Save Levels"));
gtk_window_position (GTK_WINDOW (file_dlg), GTK_WIN_POS_MOUSE);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->cancel_button),
"clicked", (GtkSignalFunc) file_cancel_callback, data);
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (file_dlg)->ok_button),
"clicked", (GtkSignalFunc) file_ok_callback, data);
temp = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "levels" G_DIR_SEPARATOR_S,
gimp_directory ());
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_dlg), temp);
g_free (temp);
}
static void

View File

@ -170,11 +170,9 @@ color_panel_draw (ColorPanel *color_panel)
private = (ColorPanelPrivate *) color_panel->private_part;
widget = private->drawing_area;
fg.pixel = old_color_pixel;
store_color (&fg.pixel,
color_panel->color[0],
color_panel->color[1],
color_panel->color[2]);
fg.pixel = get_color (color_panel->color[0],
color_panel->color[1],
color_panel->color[2]);
gdk_gc_set_foreground (private->gc, &fg);
gdk_draw_rectangle (widget->window, private->gc, 1, 0, 0,

View File

@ -833,7 +833,25 @@ static gchar *
menu_translate (const gchar *path,
gpointer data)
{
return gettext (path);
static gchar menupath[256];
gchar *retval;
retval = gettext (path);
if (!strcmp (path, retval))
{
strcpy (menupath, "<Image>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Image>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Image>");
if (!strcmp (path, retval))
{
strcpy (menupath, "<Toolbox>");
strncat (menupath, path, sizeof(menupath) - sizeof("<Toolbox>"));
retval = dgettext ("gimp-std-plugins", menupath) + strlen ("<Toolbox>");
}
}
return retval;
}
static gint

View File

@ -276,7 +276,7 @@ palette_set_foreground (gint r,
palette_get_foreground (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&foreground_pixel, rr, gg, bb);
foreground_pixel = get_color (rr, gg, bb);
color_area_update ();
device_status_update (current_device);
}
@ -297,7 +297,7 @@ palette_set_background (gint r,
palette_get_background (&rr, &gg, &bb);
if (no_interface == FALSE)
{
store_color (&background_pixel, rr, gg, bb);
background_pixel = get_color (rr, gg, bb);
color_area_update ();
}
}

View File

@ -44,6 +44,18 @@ echo "mkdir $2/gflares"
mkdir $2/gflares
echo "mkdir $2/fractalexplorer"
mkdir $2/fractalexplorer
echo "mkdir $2/gimpressionist"
mkdir $2/gimpressionist
echo "mkdir $2/gimpressionist/Brushes"
mkdir $2/gimpressionist/Brushes
echo "mkdir $2/gimpressionist/Paper"
mkdir $2/gimpressionist/Paper
echo "mkdir $2/gimpressionist/Presets"
mkdir $2/gimpressionist/Presets
echo "mkdir $2/levels"
mkdir $2/levels
echo "mkdir $2/curves"
mkdir $2/curves
echo "cp $1/palettes/* $2/palettes"
cp $1/palettes/* $2/palettes

View File

@ -14,5 +14,11 @@ mkdir %2\scripts
mkdir %2\gfig
mkdir %2\gflares
mkdir %2\fractalexplorer
mkdir %2\gimpressionist
mkdir %2\gimpressionist\Brushes
mkdir %2\gimpressionist\Paper
mkdir %2\gimpressionist\Presets
mkdir %2\levels
mkdir %2\curves
pause

View File

@ -21,20 +21,21 @@
#include <glib.h>
typedef void (*GimpColorDisplayInit) (void);
typedef gpointer (*GimpColorDisplayNew) (int type,
int width,
int height);
typedef void (*GimpColorDisplayConvert) (gpointer cd_ID,
int x,
int y,
guchar r,
guchar g,
guchar b,
guchar *dest);
typedef void (*GimpColorDisplayDestroy) (gpointer cd_ID);
typedef void (*GimpColorDisplayFinalize) (void);
typedef void (*GimpColorDisplayConfigure) (gpointer cd_ID);
#include <libgimp/parasite.h>
typedef void (*GimpColorDisplayInit) (void);
typedef gpointer (*GimpColorDisplayNew) (int type);
typedef void (*GimpColorDisplayConvert) (gpointer cd_ID,
guchar *buf,
int width,
int height,
int bpp);
typedef void (*GimpColorDisplayDestroy) (gpointer cd_ID);
typedef void (*GimpColorDisplayFinalize) (void);
typedef void (*GimpColorDisplayLoadState) (gpointer cd_ID,
Parasite *state);
typedef Parasite * (*GimpColorDisplaySaveState) (gpointer cd_ID);
typedef void (*GimpColorDisplayConfigure) (gpointer cd_ID);
typedef struct _GimpColorDisplayMethods GimpColorDisplayMethods;
@ -45,6 +46,8 @@ struct _GimpColorDisplayMethods
GimpColorDisplayConvert convert;
GimpColorDisplayDestroy destroy;
GimpColorDisplayFinalize finalize;
GimpColorDisplayLoadState load;
GimpColorDisplaySaveState save;
GimpColorDisplayConfigure configure;
};

View File

@ -21,20 +21,21 @@
#include <glib.h>
typedef void (*GimpColorDisplayInit) (void);
typedef gpointer (*GimpColorDisplayNew) (int type,
int width,
int height);
typedef void (*GimpColorDisplayConvert) (gpointer cd_ID,
int x,
int y,
guchar r,
guchar g,
guchar b,
guchar *dest);
typedef void (*GimpColorDisplayDestroy) (gpointer cd_ID);
typedef void (*GimpColorDisplayFinalize) (void);
typedef void (*GimpColorDisplayConfigure) (gpointer cd_ID);
#include <libgimp/parasite.h>
typedef void (*GimpColorDisplayInit) (void);
typedef gpointer (*GimpColorDisplayNew) (int type);
typedef void (*GimpColorDisplayConvert) (gpointer cd_ID,
guchar *buf,
int width,
int height,
int bpp);
typedef void (*GimpColorDisplayDestroy) (gpointer cd_ID);
typedef void (*GimpColorDisplayFinalize) (void);
typedef void (*GimpColorDisplayLoadState) (gpointer cd_ID,
Parasite *state);
typedef Parasite * (*GimpColorDisplaySaveState) (gpointer cd_ID);
typedef void (*GimpColorDisplayConfigure) (gpointer cd_ID);
typedef struct _GimpColorDisplayMethods GimpColorDisplayMethods;
@ -45,6 +46,8 @@ struct _GimpColorDisplayMethods
GimpColorDisplayConvert convert;
GimpColorDisplayDestroy destroy;
GimpColorDisplayFinalize finalize;
GimpColorDisplayLoadState load;
GimpColorDisplaySaveState save;
GimpColorDisplayConfigure configure;
};

View File

@ -13,9 +13,14 @@
setlocale(LC_MESSAGES, ""); \
bindtextdomain("gimp-std-plugins", LOCALEDIR); \
textdomain("gimp-std-plugins")
#define INIT_I18N_UI() \
gtk_set_locale(); \
INIT_I18N();
#else
#define INIT_I18N() \
bindtextdomain("gimp-std-plugins", LOCALEDIR); \
textdomain("gimp-std-plugins")
#define INIT_I18N_UI() \
gtk_set_locale(); \
INIT_I18N();
#endif

View File

@ -957,9 +957,10 @@ color_select_update_colors (ColorSelect *csp,
/* if we haven't yet been realised, there's no need to redraw
* anything. */
if (!window) return;
if (!window)
return;
store_color (&color.pixel, red, green, blue);
color.pixel = get_color (red, green, blue);
gdk_window_get_size (window, &width, &height);

View File

@ -166,7 +166,7 @@ static void query(void)
static gint nargs = sizeof (args) / sizeof (args[0]);
static gint nreturn_vals = 0;
INIT_I18N();
INIT_I18N_UI();
gimp_install_procedure ("plug_in_lighting",
_("Apply various lighting effects to an image"),

View File

@ -44,6 +44,18 @@ echo "mkdir $2/gflares"
mkdir $2/gflares
echo "mkdir $2/fractalexplorer"
mkdir $2/fractalexplorer
echo "mkdir $2/gimpressionist"
mkdir $2/gimpressionist
echo "mkdir $2/gimpressionist/Brushes"
mkdir $2/gimpressionist/Brushes
echo "mkdir $2/gimpressionist/Paper"
mkdir $2/gimpressionist/Paper
echo "mkdir $2/gimpressionist/Presets"
mkdir $2/gimpressionist/Presets
echo "mkdir $2/levels"
mkdir $2/levels
echo "mkdir $2/curves"
mkdir $2/curves
echo "cp $1/palettes/* $2/palettes"
cp $1/palettes/* $2/palettes

View File

@ -14,5 +14,11 @@ mkdir %2\scripts
mkdir %2\gfig
mkdir %2\gflares
mkdir %2\fractalexplorer
mkdir %2\gimpressionist
mkdir %2\gimpressionist\Brushes
mkdir %2\gimpressionist\Paper
mkdir %2\gimpressionist\Presets
mkdir %2\levels
mkdir %2\curves
pause