rewrote so gcc-3.0 doesn't complain.
2001-10-29 Sven Neumann <sven@gimp.org> * app/base/temp-buf.c (temp_buf_to_gray): rewrote so gcc-3.0 doesn't complain. * app/widgets/gimpfontselection-dialog.c: use g_ascii_strcasecmp(). * libgimp/gimpintl.h * libgimp/stdplugins-intl.h * plug-ins/script-fu/script-fu-intl.h: don't call gtk_set_locale() since gtk_init() does it for us now. Don't set LC_NUMERIC to "C". INIT_I18N_UI() is the same as INIT_I18N_UI() now. * app/devices.c * app/gimprc.c * app/core/gimpbrushgenerated.c * app/core/gimpgradient.c * app/gui/color-notebook.c * app/gui/gradients-commands.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gimpressionist/presets.c * plug-ins/ifscompose/ifscompose_storage.c: use g_ascii_formatd() and g_ascii_strtod() to serialize and deserialize floats. These functions are locale-independent. There are probably more places that need to be fixed in this fashion. * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/script-fu/script-fu.c: s/INIT_I18N_UI/INIT_I18N/ * tools/gimp-remote.c * app/widgets/gimpwidgets-utils.c * app/core/gimpimage-contiguous-region.c * app/paint-funcs/paint-funcs-indexeda.c * app/paint-funcs/paint-funcs.c * app/tools/gimppathtool.c * app/tools/path_tool.c * modules/colorsel_triangle.c * plug-ins/common/mpeg.c * plug-ins/imagemap/imap_csim_parse.c: cleanups
This commit is contained in:
parent
05e15eb1cc
commit
de5af18f87
41 changed files with 693 additions and 442 deletions
46
ChangeLog
46
ChangeLog
|
|
@ -1,3 +1,46 @@
|
|||
2001-10-29 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/temp-buf.c (temp_buf_to_gray): rewrote so gcc-3.0 doesn't
|
||||
complain.
|
||||
|
||||
* app/widgets/gimpfontselection-dialog.c: use g_ascii_strcasecmp().
|
||||
|
||||
* libgimp/gimpintl.h
|
||||
* libgimp/stdplugins-intl.h
|
||||
* plug-ins/script-fu/script-fu-intl.h: don't call gtk_set_locale()
|
||||
since gtk_init() does it for us now. Don't set LC_NUMERIC to "C".
|
||||
INIT_I18N_UI() is the same as INIT_I18N_UI() now.
|
||||
|
||||
* app/devices.c
|
||||
* app/gimprc.c
|
||||
* app/core/gimpbrushgenerated.c
|
||||
* app/core/gimpgradient.c
|
||||
* app/gui/color-notebook.c
|
||||
* app/gui/gradients-commands.c
|
||||
* plug-ins/gfig/gfig.c
|
||||
* plug-ins/gflare/gflare.c
|
||||
* plug-ins/gimpressionist/presets.c
|
||||
* plug-ins/ifscompose/ifscompose_storage.c: use g_ascii_formatd() and
|
||||
g_ascii_strtod() to serialize and deserialize floats. These functions
|
||||
are locale-independent. There are probably more places that need to be
|
||||
fixed in this fashion.
|
||||
|
||||
* plug-ins/script-fu/script-fu-console.c
|
||||
* plug-ins/script-fu/script-fu-scripts.c
|
||||
* plug-ins/script-fu/script-fu-server.c
|
||||
* plug-ins/script-fu/script-fu.c: s/INIT_I18N_UI/INIT_I18N/
|
||||
|
||||
* tools/gimp-remote.c
|
||||
* app/widgets/gimpwidgets-utils.c
|
||||
* app/core/gimpimage-contiguous-region.c
|
||||
* app/paint-funcs/paint-funcs-indexeda.c
|
||||
* app/paint-funcs/paint-funcs.c
|
||||
* app/tools/gimppathtool.c
|
||||
* app/tools/path_tool.c
|
||||
* modules/colorsel_triangle.c
|
||||
* plug-ins/common/mpeg.c
|
||||
* plug-ins/imagemap/imap_csim_parse.c: cleanups
|
||||
|
||||
2001-10-29 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
Cleanup weekend...
|
||||
|
|
@ -141,7 +184,8 @@
|
|||
* app/*/makefile.msc : updated
|
||||
* app/file/makefile.msc app/display/makefile.msc : new files
|
||||
|
||||
* app/user_install.c : make the G_OS_WIN32 part compile again (fn -> filename)
|
||||
* app/user_install.c : make the G_OS_WIN32 part compile again
|
||||
(fn -> filename)
|
||||
|
||||
* app/core/gimptoolinfo.c (gimp_tool_info_init) : cosmetic change,
|
||||
make implementation signature static like the local prototype
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ gradients_save_as_pov_ok_callback (GtkWidget *widget,
|
|||
const gchar *filename;
|
||||
FILE *file;
|
||||
GimpGradientSegment *seg;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
filesel = GTK_FILE_SELECTION (gtk_widget_get_toplevel (widget));
|
||||
filename = gtk_file_selection_get_filename (filesel);
|
||||
|
|
@ -179,28 +180,46 @@ gradients_save_as_pov_ok_callback (GtkWidget *widget,
|
|||
for (seg = gradient->segments; seg; seg = seg->next)
|
||||
{
|
||||
/* Left */
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.b);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - seg->left_color.a);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%s, %s, %s, %s>]\n",
|
||||
seg->left,
|
||||
seg->left_color.r,
|
||||
seg->left_color.g,
|
||||
seg->left_color.b,
|
||||
1.0 - seg->left_color.a);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
|
||||
/* Middle */
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.r + seg->right_color.r) / 2.0);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.g + seg->right_color.g) / 2.0);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.b + seg->right_color.b) / 2.0);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - (seg->left_color.a + seg->right_color.a) / 2.0);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
seg->middle,
|
||||
(seg->left_color.r + seg->right_color.r) / 2.0,
|
||||
(seg->left_color.g + seg->right_color.g) / 2.0,
|
||||
(seg->left_color.b + seg->right_color.b) / 2.0,
|
||||
1.0 - (seg->left_color.a + seg->right_color.a) / 2.0);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
|
||||
/* Right */
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.b);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - seg->right_color.a);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
seg->right,
|
||||
seg->right_color.r,
|
||||
seg->right_color.g,
|
||||
seg->right_color.b,
|
||||
1.0 - seg->right_color.a);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
}
|
||||
|
||||
fprintf (file, "} /* color_map */\n");
|
||||
|
|
|
|||
|
|
@ -107,11 +107,12 @@ temp_buf_to_gray (TempBuf *src_buf,
|
|||
|
||||
while (num_bytes--)
|
||||
{
|
||||
*dest++ = *src++; /* alpha channel */
|
||||
|
||||
pix = INTENSITY (*src++, *src++, *src++);
|
||||
*dest++ = src[0]; /* alpha channel */
|
||||
|
||||
pix = INTENSITY (src[1], src[2], src[3]);
|
||||
*dest++ = (guchar) pix;
|
||||
|
||||
src += 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ gimp_brush_generated_save (GimpData *data)
|
|||
{
|
||||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED (data), FALSE);
|
||||
|
|
@ -137,19 +138,29 @@ gimp_brush_generated_save (GimpData *data)
|
|||
fprintf (fp, "%.255s\n", GIMP_OBJECT (brush)->name);
|
||||
|
||||
/* write brush spacing */
|
||||
fprintf (fp, "%f\n", (gfloat) GIMP_BRUSH (brush)->spacing);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
GIMP_BRUSH (brush)->spacing));
|
||||
|
||||
/* write brush radius */
|
||||
fprintf (fp, "%f\n", brush->radius);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->radius));
|
||||
|
||||
/* write brush hardness */
|
||||
fprintf (fp, "%f\n", brush->hardness);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->hardness));
|
||||
|
||||
/* write brush aspect_ratio */
|
||||
fprintf (fp, "%f\n", brush->aspect_ratio);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->aspect_ratio));
|
||||
|
||||
/* write brush angle */
|
||||
fprintf (fp, "%f\n", brush->angle);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->angle));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
@ -351,8 +362,6 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar string[256];
|
||||
gfloat fl;
|
||||
gfloat version;
|
||||
|
||||
if ((fp = fopen (filename, "rb")) == NULL)
|
||||
return NULL;
|
||||
|
|
@ -365,8 +374,8 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
|
||||
/* make sure we are reading a compatible version */
|
||||
fgets (string, 255, fp);
|
||||
sscanf (string, "%f", &version);
|
||||
g_return_val_if_fail (version < 2.0, NULL);
|
||||
if (strncmp (string, "1.0", 3))
|
||||
return NULL;
|
||||
|
||||
/* create new brush */
|
||||
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
|
||||
|
|
@ -382,24 +391,24 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
gimp_object_set_name (GIMP_OBJECT (brush), string);
|
||||
|
||||
/* read brush spacing */
|
||||
fscanf (fp, "%f", &fl);
|
||||
GIMP_BRUSH (brush)->spacing = fl;
|
||||
fgets (string, 255, fp);
|
||||
GIMP_BRUSH (brush)->spacing = g_ascii_strtod (string, NULL);
|
||||
|
||||
/* read brush radius */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_radius (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_radius (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush hardness */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_hardness (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_hardness (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush aspect_ratio */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush angle */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_angle (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_angle (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ gimp_brush_generated_save (GimpData *data)
|
|||
{
|
||||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED (data), FALSE);
|
||||
|
|
@ -137,19 +138,29 @@ gimp_brush_generated_save (GimpData *data)
|
|||
fprintf (fp, "%.255s\n", GIMP_OBJECT (brush)->name);
|
||||
|
||||
/* write brush spacing */
|
||||
fprintf (fp, "%f\n", (gfloat) GIMP_BRUSH (brush)->spacing);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
GIMP_BRUSH (brush)->spacing));
|
||||
|
||||
/* write brush radius */
|
||||
fprintf (fp, "%f\n", brush->radius);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->radius));
|
||||
|
||||
/* write brush hardness */
|
||||
fprintf (fp, "%f\n", brush->hardness);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->hardness));
|
||||
|
||||
/* write brush aspect_ratio */
|
||||
fprintf (fp, "%f\n", brush->aspect_ratio);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->aspect_ratio));
|
||||
|
||||
/* write brush angle */
|
||||
fprintf (fp, "%f\n", brush->angle);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->angle));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
@ -351,8 +362,6 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar string[256];
|
||||
gfloat fl;
|
||||
gfloat version;
|
||||
|
||||
if ((fp = fopen (filename, "rb")) == NULL)
|
||||
return NULL;
|
||||
|
|
@ -365,8 +374,8 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
|
||||
/* make sure we are reading a compatible version */
|
||||
fgets (string, 255, fp);
|
||||
sscanf (string, "%f", &version);
|
||||
g_return_val_if_fail (version < 2.0, NULL);
|
||||
if (strncmp (string, "1.0", 3))
|
||||
return NULL;
|
||||
|
||||
/* create new brush */
|
||||
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
|
||||
|
|
@ -382,24 +391,24 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
gimp_object_set_name (GIMP_OBJECT (brush), string);
|
||||
|
||||
/* read brush spacing */
|
||||
fscanf (fp, "%f", &fl);
|
||||
GIMP_BRUSH (brush)->spacing = fl;
|
||||
fgets (string, 255, fp);
|
||||
GIMP_BRUSH (brush)->spacing = g_ascii_strtod (string, NULL);
|
||||
|
||||
/* read brush radius */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_radius (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_radius (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush hardness */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_hardness (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_hardness (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush aspect_ratio */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush angle */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_angle (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_angle (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ gimp_brush_generated_save (GimpData *data)
|
|||
{
|
||||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_BRUSH_GENERATED (data), FALSE);
|
||||
|
|
@ -137,19 +138,29 @@ gimp_brush_generated_save (GimpData *data)
|
|||
fprintf (fp, "%.255s\n", GIMP_OBJECT (brush)->name);
|
||||
|
||||
/* write brush spacing */
|
||||
fprintf (fp, "%f\n", (gfloat) GIMP_BRUSH (brush)->spacing);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
GIMP_BRUSH (brush)->spacing));
|
||||
|
||||
/* write brush radius */
|
||||
fprintf (fp, "%f\n", brush->radius);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->radius));
|
||||
|
||||
/* write brush hardness */
|
||||
fprintf (fp, "%f\n", brush->hardness);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->hardness));
|
||||
|
||||
/* write brush aspect_ratio */
|
||||
fprintf (fp, "%f\n", brush->aspect_ratio);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->aspect_ratio));
|
||||
|
||||
/* write brush angle */
|
||||
fprintf (fp, "%f\n", brush->angle);
|
||||
fprintf (fp, "%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
brush->angle));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
@ -351,8 +362,6 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
GimpBrushGenerated *brush;
|
||||
FILE *fp;
|
||||
gchar string[256];
|
||||
gfloat fl;
|
||||
gfloat version;
|
||||
|
||||
if ((fp = fopen (filename, "rb")) == NULL)
|
||||
return NULL;
|
||||
|
|
@ -365,8 +374,8 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
|
||||
/* make sure we are reading a compatible version */
|
||||
fgets (string, 255, fp);
|
||||
sscanf (string, "%f", &version);
|
||||
g_return_val_if_fail (version < 2.0, NULL);
|
||||
if (strncmp (string, "1.0", 3))
|
||||
return NULL;
|
||||
|
||||
/* create new brush */
|
||||
brush = GIMP_BRUSH_GENERATED (g_object_new (GIMP_TYPE_BRUSH_GENERATED, NULL));
|
||||
|
|
@ -382,24 +391,24 @@ gimp_brush_generated_load (const gchar *filename)
|
|||
gimp_object_set_name (GIMP_OBJECT (brush), string);
|
||||
|
||||
/* read brush spacing */
|
||||
fscanf (fp, "%f", &fl);
|
||||
GIMP_BRUSH (brush)->spacing = fl;
|
||||
fgets (string, 255, fp);
|
||||
GIMP_BRUSH (brush)->spacing = g_ascii_strtod (string, NULL);
|
||||
|
||||
/* read brush radius */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_radius (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_radius (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush hardness */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_hardness (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_hardness (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush aspect_ratio */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_aspect_ratio (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
/* read brush angle */
|
||||
fscanf (fp, "%f", &fl);
|
||||
gimp_brush_generated_set_angle (brush, fl);
|
||||
fgets (string, 255, fp);
|
||||
gimp_brush_generated_set_angle (brush, g_ascii_strtod (string, NULL));
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
|
|
@ -360,6 +361,8 @@ gimp_gradient_load (const gchar *filename)
|
|||
|
||||
for (i = 0; i < num_segments; i++)
|
||||
{
|
||||
gchar *end;
|
||||
|
||||
seg = gimp_gradient_segment_new ();
|
||||
|
||||
seg->prev = prev;
|
||||
|
|
@ -371,27 +374,42 @@ gimp_gradient_load (const gchar *filename)
|
|||
|
||||
fgets (line, 1024, file);
|
||||
|
||||
if (sscanf (line, "%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%d%d",
|
||||
&(seg->left), &(seg->middle), &(seg->right),
|
||||
&(seg->left_color.r),
|
||||
&(seg->left_color.g),
|
||||
&(seg->left_color.b),
|
||||
&(seg->left_color.a),
|
||||
&(seg->right_color.r),
|
||||
&(seg->right_color.g),
|
||||
&(seg->right_color.b),
|
||||
&(seg->right_color.a),
|
||||
&type, &color) != 13)
|
||||
{
|
||||
seg->left = g_ascii_strtod (line, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->middle = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->right = g_ascii_strtod (end, &end);
|
||||
|
||||
if (end && errno != ERANGE)
|
||||
seg->left_color.r = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->left_color.g = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->left_color.b = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->left_color.a = g_ascii_strtod (end, &end);
|
||||
|
||||
if (end && errno != ERANGE)
|
||||
seg->right_color.r = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->right_color.g = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->right_color.b = g_ascii_strtod (end, &end);
|
||||
if (end && errno != ERANGE)
|
||||
seg->right_color.a = g_ascii_strtod (end, &end);
|
||||
|
||||
if (errno != ERANGE &&
|
||||
sscanf (end, "%d %d", &type, &color) == 2)
|
||||
{
|
||||
seg->type = (GimpGradientSegmentType) type;
|
||||
seg->color = (GimpGradientSegmentColor) color;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_message ("%s(): badly formatted gradient segment %d in \"%s\" --- "
|
||||
"bad things may happen soon",
|
||||
G_GNUC_FUNCTION, i, filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
seg->type = (GimpGradientSegmentType) type;
|
||||
seg->color = (GimpGradientSegmentColor) color;
|
||||
}
|
||||
|
||||
prev = seg;
|
||||
}
|
||||
|
|
@ -463,16 +481,23 @@ gimp_gradient_save (GimpData *data)
|
|||
|
||||
for (seg = gradient->segments; seg; seg = seg->next)
|
||||
{
|
||||
fprintf (file, "%f %f %f %f %f %f %f %f %f %f %f %d %d\n",
|
||||
seg->left, seg->middle, seg->right,
|
||||
seg->left_color.r,
|
||||
seg->left_color.g,
|
||||
seg->left_color.b,
|
||||
seg->left_color.a,
|
||||
seg->right_color.r,
|
||||
seg->right_color.g,
|
||||
seg->right_color.b,
|
||||
seg->right_color.a,
|
||||
gchar buf[11][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->middle);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left_color.r);
|
||||
g_ascii_formatd (buf[4], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left_color.g);
|
||||
g_ascii_formatd (buf[5], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left_color.b);
|
||||
g_ascii_formatd (buf[6], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->left_color.a);
|
||||
g_ascii_formatd (buf[7], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right_color.r);
|
||||
g_ascii_formatd (buf[8], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right_color.g);
|
||||
g_ascii_formatd (buf[9], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right_color.b);
|
||||
g_ascii_formatd (buf[10], G_ASCII_DTOSTR_BUF_SIZE, "%f", seg->right_color.a);
|
||||
|
||||
fprintf (file, "%s %s %s %s %s %s %s %s %s %s %s %d %d\n",
|
||||
buf[0], buf[1], buf[2], buf[3], buf[4],
|
||||
buf[5], buf[6], buf[7], buf[8], buf[9], buf[10],
|
||||
(gint) seg->type,
|
||||
(gint) seg->color);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
|
|
|
|||
|
|
@ -665,16 +665,25 @@ devices_write_rc_device (DeviceInfo *device_info,
|
|||
|
||||
{
|
||||
GimpRGB color;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
gimp_context_get_foreground (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
|
||||
gimp_context_get_background (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
}
|
||||
|
||||
if (gimp_context_get_brush (device_info->context))
|
||||
|
|
|
|||
|
|
@ -1290,11 +1290,19 @@ color_history_write (FILE *fp)
|
|||
|
||||
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
|
||||
{
|
||||
fprintf (fp, "\n (color-rgba %f %f %f %f)",
|
||||
color_history[i].r,
|
||||
color_history[i].g,
|
||||
color_history[i].b,
|
||||
color_history[i].a);
|
||||
gchar buf[4][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_ascii_formatd (buf[0],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].r);
|
||||
g_ascii_formatd (buf[1],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].g);
|
||||
g_ascii_formatd (buf[2],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].b);
|
||||
g_ascii_formatd (buf[3],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].a);
|
||||
|
||||
fprintf (fp, "\n (color-rgba %s %s %s %s)",
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
}
|
||||
|
||||
fprintf (fp, ")\n\n");
|
||||
|
|
|
|||
14
app/gimprc.c
14
app/gimprc.c
|
|
@ -166,7 +166,6 @@ static gint parse_unknown (gchar *token_sym);
|
|||
static inline gchar * string_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * path_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * double_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * float_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * int_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * boolean_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * position_to_str (gpointer val1p, gpointer val2p);
|
||||
|
|
@ -2857,9 +2856,8 @@ gimprc_value_to_str (const gchar *name)
|
|||
case TT_PATH:
|
||||
return path_to_str (func->val1p, func->val2p);
|
||||
case TT_DOUBLE:
|
||||
return double_to_str (func->val1p, func->val2p);
|
||||
case TT_FLOAT:
|
||||
return float_to_str (func->val1p, func->val2p);
|
||||
return double_to_str (func->val1p, func->val2p);
|
||||
case TT_INT:
|
||||
return int_to_str (func->val1p, func->val2p);
|
||||
case TT_BOOLEAN:
|
||||
|
|
@ -2924,14 +2922,10 @@ static inline gchar *
|
|||
double_to_str (gpointer val1p,
|
||||
gpointer val2p)
|
||||
{
|
||||
return g_strdup_printf ("%f", *((gdouble *)val1p));
|
||||
}
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
static inline gchar *
|
||||
float_to_str (gpointer val1p,
|
||||
gpointer val2p)
|
||||
{
|
||||
return g_strdup_printf ("%f", (gdouble)(*((float *)val1p)));
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", *((gdouble *)val1p));
|
||||
return g_strdup (buf);
|
||||
}
|
||||
|
||||
static inline gchar *
|
||||
|
|
|
|||
|
|
@ -1290,11 +1290,19 @@ color_history_write (FILE *fp)
|
|||
|
||||
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
|
||||
{
|
||||
fprintf (fp, "\n (color-rgba %f %f %f %f)",
|
||||
color_history[i].r,
|
||||
color_history[i].g,
|
||||
color_history[i].b,
|
||||
color_history[i].a);
|
||||
gchar buf[4][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_ascii_formatd (buf[0],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].r);
|
||||
g_ascii_formatd (buf[1],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].g);
|
||||
g_ascii_formatd (buf[2],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].b);
|
||||
g_ascii_formatd (buf[3],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].a);
|
||||
|
||||
fprintf (fp, "\n (color-rgba %s %s %s %s)",
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
}
|
||||
|
||||
fprintf (fp, ")\n\n");
|
||||
|
|
|
|||
|
|
@ -665,16 +665,25 @@ devices_write_rc_device (DeviceInfo *device_info,
|
|||
|
||||
{
|
||||
GimpRGB color;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
gimp_context_get_foreground (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
|
||||
gimp_context_get_background (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
}
|
||||
|
||||
if (gimp_context_get_brush (device_info->context))
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ gradients_save_as_pov_ok_callback (GtkWidget *widget,
|
|||
const gchar *filename;
|
||||
FILE *file;
|
||||
GimpGradientSegment *seg;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
filesel = GTK_FILE_SELECTION (gtk_widget_get_toplevel (widget));
|
||||
filename = gtk_file_selection_get_filename (filesel);
|
||||
|
|
@ -179,28 +180,46 @@ gradients_save_as_pov_ok_callback (GtkWidget *widget,
|
|||
for (seg = gradient->segments; seg; seg = seg->next)
|
||||
{
|
||||
/* Left */
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->left_color.b);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - seg->left_color.a);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%s, %s, %s, %s>]\n",
|
||||
seg->left,
|
||||
seg->left_color.r,
|
||||
seg->left_color.g,
|
||||
seg->left_color.b,
|
||||
1.0 - seg->left_color.a);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
|
||||
/* Middle */
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.r + seg->right_color.r) / 2.0);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.g + seg->right_color.g) / 2.0);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
(seg->left_color.b + seg->right_color.b) / 2.0);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - (seg->left_color.a + seg->right_color.a) / 2.0);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
seg->middle,
|
||||
(seg->left_color.r + seg->right_color.r) / 2.0,
|
||||
(seg->left_color.g + seg->right_color.g) / 2.0,
|
||||
(seg->left_color.b + seg->right_color.b) / 2.0,
|
||||
1.0 - (seg->left_color.a + seg->right_color.a) / 2.0);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
|
||||
/* Right */
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
seg->right_color.b);
|
||||
g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
1.0 - seg->right_color.a);
|
||||
|
||||
fprintf (file, "\t[%f color rgbt <%f, %f, %f, %f>]\n",
|
||||
seg->right,
|
||||
seg->right_color.r,
|
||||
seg->right_color.g,
|
||||
seg->right_color.b,
|
||||
1.0 - seg->right_color.a);
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
}
|
||||
|
||||
fprintf (file, "} /* color_map */\n");
|
||||
|
|
|
|||
|
|
@ -665,16 +665,25 @@ devices_write_rc_device (DeviceInfo *device_info,
|
|||
|
||||
{
|
||||
GimpRGB color;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
gimp_context_get_foreground (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
|
||||
gimp_context_get_background (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
}
|
||||
|
||||
if (gimp_context_get_brush (device_info->context))
|
||||
|
|
|
|||
|
|
@ -674,9 +674,9 @@ shrink_line (gdouble *dest,
|
|||
register const gdouble inv_step = 1.0 / step;
|
||||
gdouble position;
|
||||
|
||||
fprintf(stderr, "shrink_line bytes=%d old_width=%d width=%d interp=%d "
|
||||
"step=%f inv_step=%f\n",
|
||||
bytes, old_width, width, interp, step, inv_step);
|
||||
g_printerr ("shrink_line bytes=%d old_width=%d width=%d interp=%d "
|
||||
"step=%f inv_step=%f\n",
|
||||
bytes, old_width, width, interp, step, inv_step);
|
||||
|
||||
for (b = 0; b < bytes; b++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4161,9 +4161,9 @@ shrink_line (gdouble *dest,
|
|||
register const gdouble inv_step = 1.0 / step;
|
||||
gdouble position;
|
||||
|
||||
fprintf(stderr, "shrink_line bytes=%d old_width=%d width=%d interp=%d "
|
||||
"step=%f inv_step=%f\n",
|
||||
bytes, old_width, width, interp, step, inv_step);
|
||||
g_printerr ("shrink_line bytes=%d old_width=%d width=%d interp=%d "
|
||||
"step=%f inv_step=%f\n",
|
||||
bytes, old_width, width, interp, step, inv_step);
|
||||
|
||||
for (b = 0; b < bytes; b++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1645,7 +1645,7 @@ levels_read_from_file (FILE *f)
|
|||
if (!fgets (buf, 50, f))
|
||||
return FALSE;
|
||||
|
||||
gamma[i] = strtod(buf, &nptr);
|
||||
gamma[i] = g_ascii_strtod (buf, &nptr);
|
||||
|
||||
if (buf == nptr || errno == ERANGE)
|
||||
return FALSE;
|
||||
|
|
@ -1671,17 +1671,19 @@ levels_read_from_file (FILE *f)
|
|||
static void
|
||||
levels_write_to_file (FILE *f)
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
fprintf (f, "# GIMP Levels File\n");
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
fprintf (f, "%d %d %d %d %f\n",
|
||||
fprintf (f, "%d %d %d %d %s\n",
|
||||
levels_dialog->low_input[i],
|
||||
levels_dialog->high_input[i],
|
||||
levels_dialog->low_output[i],
|
||||
levels_dialog->high_output[i],
|
||||
levels_dialog->gamma[i]);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f",
|
||||
levels_dialog->gamma[i]));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpmath/gimpmath.h"
|
||||
|
|
@ -219,8 +217,8 @@ gimp_path_tool_finalize (GObject *object)
|
|||
path_tool = GIMP_PATH_TOOL (object);
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "gimp_path_tool_free start\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("gimp_path_tool_free start\n");
|
||||
#endif
|
||||
|
||||
if (path_tool->cur_path)
|
||||
{
|
||||
|
|
@ -239,8 +237,8 @@ gimp_path_tool_control (GimpTool *tool,
|
|||
GimpPathTool *path_tool;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_control\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_control\n");
|
||||
#endif
|
||||
|
||||
path_tool = GIMP_PATH_TOOL (tool);
|
||||
|
||||
|
|
@ -275,14 +273,14 @@ gimp_path_tool_button_press (GimpTool *tool,
|
|||
gint halfwidth, dummy;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_button_press\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press\n");
|
||||
#endif
|
||||
|
||||
/* Transform window-coordinates to canvas-coordinates */
|
||||
gdisplay_untransform_coords_f (gdisp, bevent->x, bevent->y, &x, &y, TRUE);
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "Clickcoordinates %.2f, %.2f\n",x,y);
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Clickcoordinates %.2f, %.2f\n",x,y);
|
||||
#endif
|
||||
path_tool->click_x = x;
|
||||
path_tool->click_y = y;
|
||||
path_tool->click_modifier = bevent->state;
|
||||
|
|
@ -354,15 +352,15 @@ gimp_path_tool_button_press_anchor (GimpPathTool *path_tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_anchor:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_anchor:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -374,8 +372,8 @@ gimp_path_tool_button_press_anchor (GimpPathTool *path_tool,
|
|||
if (bevent->time - last_click_time < 250) {
|
||||
doubleclick=TRUE;
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Doppelclick!\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Doppelclick!\n");
|
||||
#endif
|
||||
} else
|
||||
doubleclick=FALSE;
|
||||
last_click_time = bevent->time;
|
||||
|
|
@ -395,8 +393,8 @@ gimp_path_tool_button_press_anchor (GimpPathTool *path_tool,
|
|||
p_sas = path_tool->single_active_segment;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "p_sas: %p\n", p_sas);
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("p_sas: %p\n", p_sas);
|
||||
#endif
|
||||
|
||||
if (path_tool->click_modifier & GDK_SHIFT_MASK) {
|
||||
if (path_tool->active_count == 1 && p_sas && p_sas != path_tool->click_segment &&
|
||||
|
|
@ -477,15 +475,15 @@ gimp_path_tool_button_press_handle (GimpPathTool *path_tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_handle:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_handle:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -497,8 +495,8 @@ gimp_path_tool_button_press_handle (GimpPathTool *path_tool,
|
|||
if (bevent->time - last_click_time < 250) {
|
||||
doubleclick=TRUE;
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Doppelclick!\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Doppelclick!\n");
|
||||
#endif
|
||||
} else
|
||||
doubleclick=FALSE;
|
||||
last_click_time = bevent->time;
|
||||
|
|
@ -518,15 +516,15 @@ gimp_path_tool_button_press_canvas (GimpPathTool *path_tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_canvas:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_canvas:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -571,15 +569,15 @@ gimp_path_tool_button_press_curve (GimpPathTool *path_tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_curve:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_curve:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current NPath\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current NPath\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -611,8 +609,8 @@ gimp_path_tool_button_release (GimpTool *tool,
|
|||
GimpPathTool *path_tool = GIMP_PATH_TOOL (tool);
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_button_release\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_release\n");
|
||||
#endif
|
||||
|
||||
path_tool->state &= ~PATH_TOOL_DRAG;
|
||||
|
||||
|
|
@ -809,10 +807,9 @@ gimp_path_tool_cursor_update (GimpTool *tool,
|
|||
#if 0
|
||||
gint x, y, halfwidth, dummy, cursor_location;
|
||||
|
||||
#idef PATH_TOOL_DEBUG
|
||||
/* fprintf (stderr, "path_tool_cursor_update\n");
|
||||
*/
|
||||
#edif PATH_TOOL_DEBUG
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_cursor_update\n");
|
||||
#endif
|
||||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, TRUE, 0);
|
||||
/* get halfwidth in image coord */
|
||||
|
|
|
|||
|
|
@ -250,8 +250,8 @@ path_traverse_segment (NPath *path,
|
|||
gpointer data)
|
||||
{
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_traverse_segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_traverse_segment\n");
|
||||
#endif
|
||||
|
||||
/* XXX: here we need path_curve_get_point(s) */
|
||||
|
||||
|
|
@ -276,8 +276,8 @@ path_add_curve (NPath * cur_path,
|
|||
PathCurve * new_curve = NULL;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_add_curve\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_add_curve\n");
|
||||
#endif
|
||||
|
||||
if (cur_path) {
|
||||
new_curve = g_new (PathCurve, 1);
|
||||
|
|
@ -296,8 +296,8 @@ path_add_curve (NPath * cur_path,
|
|||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf (stderr, "Fatal Error: path_add_curve called without valid path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_add_curve called without valid path\n");
|
||||
#endif
|
||||
|
||||
return new_curve;
|
||||
}
|
||||
|
|
@ -314,8 +314,8 @@ path_append_segment (NPath * cur_path,
|
|||
PathSegment * new_segment = NULL;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_append_segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_append_segment\n");
|
||||
#endif
|
||||
|
||||
if (cur_curve) {
|
||||
tmp = cur_curve->segments;
|
||||
|
|
@ -345,13 +345,13 @@ path_append_segment (NPath * cur_path,
|
|||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf(stderr, "Fatal Error: path_append_segment called with a closed curve\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_append_segment called with a closed curve\n");
|
||||
#endif
|
||||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf(stderr, "Fatal Error: path_append_segment called without valid curve\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_append_segment called without valid curve\n");
|
||||
#endif
|
||||
|
||||
return new_segment;
|
||||
}
|
||||
|
|
@ -368,8 +368,8 @@ path_prepend_segment (NPath * cur_path,
|
|||
PathSegment * new_segment = NULL;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_prepend_segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_prepend_segment\n");
|
||||
#endif
|
||||
|
||||
if (cur_curve) {
|
||||
tmp = cur_curve->segments;
|
||||
|
|
@ -396,13 +396,13 @@ path_prepend_segment (NPath * cur_path,
|
|||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf(stderr, "Fatal Error: path_prepend_segment called with a closed curve\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_prepend_segment called with a closed curve\n");
|
||||
#endif
|
||||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf(stderr, "Fatal Error: path_prepend_segment called without valid curve\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_prepend_segment called without valid curve\n");
|
||||
#endif
|
||||
|
||||
return new_segment;
|
||||
}
|
||||
|
|
@ -414,8 +414,8 @@ path_split_segment (PathSegment *segment,
|
|||
PathSegment * new_segment = NULL;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_split_segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_split_segment\n");
|
||||
#endif
|
||||
if (segment && segment->next) {
|
||||
new_segment = g_new (PathSegment, 1);
|
||||
|
||||
|
|
@ -437,8 +437,8 @@ path_split_segment (PathSegment *segment,
|
|||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else
|
||||
fprintf(stderr, "path_split_segment without valid segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_split_segment without valid segment\n");
|
||||
#endif
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
|
@ -457,14 +457,14 @@ path_join_curves (PathSegment *segment1,
|
|||
|
||||
if ((segment1->next && segment1->prev) || (segment2->next && segment2->prev)) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "Fatal Error: path_join_curves called with a closed segment\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_join_curves called with a closed segment\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
if (segment1->parent == segment2->parent) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Joining beginning and end of the same curve...\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Joining beginning and end of the same curve...\n");
|
||||
#endif
|
||||
if (segment2->next == NULL) {
|
||||
segment2->next = segment1;
|
||||
segment1->prev = segment2;
|
||||
|
|
@ -478,8 +478,8 @@ path_join_curves (PathSegment *segment1,
|
|||
|
||||
if (segment1->next == NULL && segment2->next == NULL) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Flipping second curve (next, next)...\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Flipping second curve (next, next)...\n");
|
||||
#endif
|
||||
path_flip_curve (segment2->parent);
|
||||
/* segment2 = segment2->parent->segments;
|
||||
*/
|
||||
|
|
@ -487,8 +487,8 @@ path_join_curves (PathSegment *segment1,
|
|||
|
||||
if (segment1->prev == NULL && segment2->prev == NULL) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Flipping second curve (prev, prev)...\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Flipping second curve (prev, prev)...\n");
|
||||
#endif
|
||||
path_flip_curve (segment2->parent);
|
||||
/* segment2 = segment2->parent->segments;
|
||||
* while (segment2->next)
|
||||
|
|
@ -498,8 +498,8 @@ path_join_curves (PathSegment *segment1,
|
|||
|
||||
if (segment1->next == NULL && segment2->prev == NULL) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Appending second to first curve...\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Appending second to first curve...\n");
|
||||
#endif
|
||||
curve1 = segment1->parent;
|
||||
curve2 = segment2->parent;
|
||||
|
||||
|
|
@ -530,8 +530,8 @@ path_join_curves (PathSegment *segment1,
|
|||
|
||||
if (segment1->prev == NULL && segment2->next == NULL) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Prepending second to first curve...\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Prepending second to first curve...\n");
|
||||
#endif
|
||||
curve1 = segment1->parent;
|
||||
curve2 = segment2->parent;
|
||||
|
||||
|
|
@ -559,9 +559,9 @@ path_join_curves (PathSegment *segment1,
|
|||
}
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Cant join these curves yet...\nThis should not happen.");
|
||||
g_printerr ("Cant join these curves yet...\nThis should not happen.");
|
||||
return;
|
||||
#endif PATH_TOOL_DEBUG
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -579,8 +579,8 @@ path_flip_curve (PathCurve *curve)
|
|||
|
||||
if (!curve && !curve->segments) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_flip_curve: No curve o no segments to flip!\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_flip_curve: No curve o no segments to flip!\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -773,8 +773,8 @@ path_tool_button_press (Tool *tool,
|
|||
gint x, y, halfwidth, dummy;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_button_press\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press\n");
|
||||
#endif
|
||||
|
||||
path_tool = (PathTool *) tool->private;
|
||||
tool->gdisp = gdisp;
|
||||
|
|
@ -782,8 +782,8 @@ path_tool_button_press (Tool *tool,
|
|||
/* Transform window-coordinates to canvas-coordinates */
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, TRUE, 0);
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "Clickcoordinates %d, %d\n",x,y);
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Clickcoordinates %d, %d\n",x,y);
|
||||
#endif
|
||||
path_tool->click_x = x;
|
||||
path_tool->click_y = y;
|
||||
path_tool->click_modifier = bevent->state;
|
||||
|
|
@ -853,15 +853,15 @@ path_tool_button_press_anchor (Tool *tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_anchor:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_anchor:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -873,8 +873,8 @@ path_tool_button_press_anchor (Tool *tool,
|
|||
if (bevent->time - last_click_time < 250) {
|
||||
doubleclick=TRUE;
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Doppelclick!\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Doppelclick!\n");
|
||||
#endif
|
||||
} else
|
||||
doubleclick=FALSE;
|
||||
last_click_time = bevent->time;
|
||||
|
|
@ -894,8 +894,8 @@ path_tool_button_press_anchor (Tool *tool,
|
|||
p_sas = path_tool->single_active_segment;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "p_sas: %p\n", p_sas);
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("p_sas: %p\n", p_sas);
|
||||
#endif
|
||||
|
||||
if (path_tool->click_modifier & GDK_SHIFT_MASK) {
|
||||
if (path_tool->active_count == 1 && p_sas && p_sas != path_tool->click_segment &&
|
||||
|
|
@ -977,15 +977,15 @@ path_tool_button_press_handle (Tool *tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_handle:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_handle:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -997,8 +997,8 @@ path_tool_button_press_handle (Tool *tool,
|
|||
if (bevent->time - last_click_time < 250) {
|
||||
doubleclick=TRUE;
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Doppelclick!\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Doppelclick!\n");
|
||||
#endif
|
||||
} else
|
||||
doubleclick=FALSE;
|
||||
last_click_time = bevent->time;
|
||||
|
|
@ -1019,15 +1019,15 @@ path_tool_button_press_canvas (Tool *tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_canvas:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_canvas:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current Path\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current Path\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1074,15 +1074,15 @@ path_tool_button_press_curve (Tool *tool,
|
|||
gint grab_pointer;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf(stderr, "path_tool_button_press_curve:\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_press_curve:\n");
|
||||
#endif
|
||||
|
||||
grab_pointer = 1;
|
||||
|
||||
if (!cur_path) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal error: No current NPath\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal error: No current NPath\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1113,8 +1113,8 @@ path_tool_button_release (Tool *tool,
|
|||
PathTool * path_tool;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_button_release\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_button_release\n");
|
||||
#endif
|
||||
|
||||
path_tool = (PathTool *) tool->private;
|
||||
|
||||
|
|
@ -1325,9 +1325,9 @@ path_tool_cursor_update (Tool *tool,
|
|||
gint x, y, halfwidth, dummy, cursor_location;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
/* fprintf (stderr, "path_tool_cursor_update\n");
|
||||
/* g_printerr ("path_tool_cursor_update\n");
|
||||
*/
|
||||
#endif PATH_TOOL_DEBUG
|
||||
#endif
|
||||
|
||||
path_tool = (PathTool *) tool->private;
|
||||
|
||||
|
|
@ -1369,8 +1369,8 @@ path_tool_control (Tool *tool,
|
|||
PathTool * path_tool;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_control\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_control\n");
|
||||
#endif
|
||||
|
||||
path_tool = (PathTool *) tool->private;
|
||||
|
||||
|
|
@ -1386,8 +1386,8 @@ path_tool_control (Tool *tool,
|
|||
|
||||
case HALT:
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_control: HALT\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_control: HALT\n");
|
||||
#endif
|
||||
draw_core_stop (path_tool->core, tool);
|
||||
tool->state = INACTIVE;
|
||||
break;
|
||||
|
|
@ -1396,8 +1396,8 @@ path_tool_control (Tool *tool,
|
|||
break;
|
||||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_control: end\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_control: end\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
Tool *
|
||||
|
|
@ -1460,8 +1460,8 @@ tools_free_path_tool (Tool *tool)
|
|||
PathTool * path_tool;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "tools_free_path_tool start\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("tools_free_path_tool start\n");
|
||||
#endif
|
||||
path_tool = (PathTool *) tool->private;
|
||||
gdisp = tool->gdisp;
|
||||
|
||||
|
|
@ -1476,8 +1476,8 @@ tools_free_path_tool (Tool *tool)
|
|||
|
||||
g_free (path_tool);
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "tools_free_path_tool end\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("tools_free_path_tool end\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1848,8 +1848,8 @@ path_tool_draw_helper (NPath *path,
|
|||
|
||||
if (!tool) {
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "Fatal Error: path_tool_draw_segment called without valid tool *\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("Fatal Error: path_tool_draw_segment called without valid tool *\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1882,8 +1882,8 @@ path_tool_draw_helper (NPath *path,
|
|||
}
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
else if (!segment)
|
||||
fprintf(stderr, "path_tool_draw_segment: no segment to draw\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_draw_segment: no segment to draw\n");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1896,8 +1896,8 @@ path_tool_draw (Tool *tool)
|
|||
PathTool * path_tool;
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
fprintf (stderr, "path_tool_draw\n");
|
||||
#endif PATH_TOOL_DEBUG
|
||||
g_printerr ("path_tool_draw\n");
|
||||
#endif
|
||||
|
||||
gdisp = tool->gdisp;
|
||||
path_tool = tool->private;
|
||||
|
|
@ -1906,9 +1906,9 @@ path_tool_draw (Tool *tool)
|
|||
path_traverse_path (cur_path, NULL, path_tool_draw_helper, NULL, tool);
|
||||
|
||||
#ifdef PATH_TOOL_DEBUG
|
||||
/* fprintf (stderr, "path_tool_draw end.\n");
|
||||
/* g_printerr ("path_tool_draw end.\n");
|
||||
*/
|
||||
#endif PATH_TOOL_DEBUG
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1290,11 +1290,19 @@ color_history_write (FILE *fp)
|
|||
|
||||
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
|
||||
{
|
||||
fprintf (fp, "\n (color-rgba %f %f %f %f)",
|
||||
color_history[i].r,
|
||||
color_history[i].g,
|
||||
color_history[i].b,
|
||||
color_history[i].a);
|
||||
gchar buf[4][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_ascii_formatd (buf[0],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].r);
|
||||
g_ascii_formatd (buf[1],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].g);
|
||||
g_ascii_formatd (buf[2],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].b);
|
||||
g_ascii_formatd (buf[3],
|
||||
G_ASCII_DTOSTR_BUF_SIZE, "%f", color_history[i].a);
|
||||
|
||||
fprintf (fp, "\n (color-rgba %s %s %s %s)",
|
||||
buf[0], buf[1], buf[2], buf[3]);
|
||||
}
|
||||
|
||||
fprintf (fp, ")\n\n");
|
||||
|
|
|
|||
|
|
@ -665,16 +665,25 @@ devices_write_rc_device (DeviceInfo *device_info,
|
|||
|
||||
{
|
||||
GimpRGB color;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
gimp_context_get_foreground (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
|
||||
gimp_context_get_background (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
}
|
||||
|
||||
if (gimp_context_get_brush (device_info->context))
|
||||
|
|
|
|||
|
|
@ -665,16 +665,25 @@ devices_write_rc_device (DeviceInfo *device_info,
|
|||
|
||||
{
|
||||
GimpRGB color;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
gimp_context_get_foreground (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (foreground (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
|
||||
gimp_context_get_background (device_info->context, &color);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %f %f %f))",
|
||||
color.r, color.g, color.b);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.r);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.g);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", color.b);
|
||||
|
||||
fprintf (fp, "\n (background (color-rgb %s %s %s))",
|
||||
buf[0], buf[1], buf[2]);
|
||||
}
|
||||
|
||||
if (gimp_context_get_brush (device_info->context))
|
||||
|
|
|
|||
|
|
@ -279,8 +279,8 @@ gimp_font_selection_dialog_set_font_desc (GimpFontSelectionDialog *dialog,
|
|||
|
||||
for (i = 0; i < dialog->n_families; i++)
|
||||
{
|
||||
if (!g_strcasecmp (name,
|
||||
pango_font_family_get_name (dialog->families[i])))
|
||||
if (!g_ascii_strcasecmp (name,
|
||||
pango_font_family_get_name (dialog->families[i])))
|
||||
{
|
||||
row = i;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
|
@ -77,7 +76,7 @@ gimp_message_box (gchar *message,
|
|||
|
||||
if (g_list_length (message_boxes) > MESSAGE_BOX_MAXIMUM)
|
||||
{
|
||||
fprintf (stderr, "%s: %s\n", prog_name, message);
|
||||
g_printerr ("%s: %s\n", prog_name, message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +114,7 @@ gimp_message_box (gchar *message,
|
|||
|
||||
if (g_list_length (message_boxes) == MESSAGE_BOX_MAXIMUM)
|
||||
{
|
||||
fprintf (stderr, "%s: %s\n", prog_name, message);
|
||||
g_printerr ("%s: %s\n", prog_name, message);
|
||||
message = _("WARNING:\n"
|
||||
"Too many open message dialogs.\n"
|
||||
"Messages are redirected to stderr.");
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@
|
|||
#endif
|
||||
|
||||
#define INIT_LOCALE( domain ) G_STMT_START{ \
|
||||
gtk_set_locale (); \
|
||||
setlocale (LC_NUMERIC, "C"); \
|
||||
setlocale (LC_ALL, ""); \
|
||||
bindtextdomain (domain, LOCALEDIR); \
|
||||
bind_textdomain_codeset (domain, "UTF-8"); \
|
||||
textdomain (domain); \
|
||||
|
|
|
|||
|
|
@ -26,18 +26,15 @@
|
|||
|
||||
|
||||
#define INIT_I18N() G_STMT_START{ \
|
||||
setlocale (LC_ALL, ""); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-libgimp", LOCALEDIR); \
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE"-libgimp", "UTF-8"); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-std-plugins", LOCALEDIR); \
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE"-std-plugins", "UTF-8"); \
|
||||
textdomain(GETTEXT_PACKAGE"-std-plugins"); \
|
||||
setlocale (LC_NUMERIC, "C"); \
|
||||
}G_STMT_END
|
||||
|
||||
#define INIT_I18N_UI() G_STMT_START{ \
|
||||
gtk_set_locale(); \
|
||||
INIT_I18N(); \
|
||||
}G_STMT_END
|
||||
#define INIT_I18N_UI() INIT_I18N()
|
||||
|
||||
|
||||
#endif /* __STDPLUGINS_INTL_H__ */
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
|
|
|||
|
|
@ -1182,7 +1182,8 @@ gfig_load (const gchar *filename,
|
|||
gfig->draw_name = g_strdup (load_buf);
|
||||
|
||||
get_line (load_buf, MAX_LOAD_LINE, fp, 0);
|
||||
sscanf (load_buf, "Version: %f", &gfig->version);
|
||||
if (strncmp (load_buf, "Version: ", 9) == 0)
|
||||
gfig->version = g_ascii_strtod (load_buf + 9, NULL);
|
||||
|
||||
get_line (load_buf, MAX_LOAD_LINE, fp, 0);
|
||||
sscanf (load_buf, "ObjCount: %d", &load_count);
|
||||
|
|
@ -1448,7 +1449,8 @@ gfig_save_callbk (void)
|
|||
gint count = 0;
|
||||
gchar *savename;
|
||||
gchar *message;
|
||||
gchar conv_buf[MAX_LOAD_LINE*3 +1];
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
gchar conv_buf[MAX_LOAD_LINE*3 +1];
|
||||
|
||||
savename = current_obj->filename;
|
||||
|
||||
|
|
@ -1477,7 +1479,8 @@ gfig_save_callbk (void)
|
|||
|
||||
gfig_name_encode (conv_buf, current_obj->draw_name);
|
||||
fprintf (fp, "Name: %s\n", conv_buf);
|
||||
fprintf (fp, "Version: %f\n", current_obj->version);
|
||||
fprintf (fp, "Version: %s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", current_obj->version));
|
||||
objs = current_obj->obj_list;
|
||||
|
||||
count = gfig_obj_counts (objs);
|
||||
|
|
|
|||
|
|
@ -1500,10 +1500,14 @@ gflare_read_int (gint *intvar, GFlareFile *gf)
|
|||
static void
|
||||
gflare_read_double (gdouble *dblvar, GFlareFile *gf)
|
||||
{
|
||||
gchar buf[30];
|
||||
|
||||
if (gf->error)
|
||||
return;
|
||||
|
||||
if (fscanf (gf->fp, "%le", dblvar) != 1)
|
||||
if (fscanf (gf->fp, "%30s", buf) == 1)
|
||||
*dblvar = g_ascii_strtod (buf, NULL);
|
||||
else
|
||||
gf->error = TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1578,6 +1582,7 @@ gflare_save (GFlare *gflare)
|
|||
{
|
||||
FILE *fp;
|
||||
gchar *path;
|
||||
gchar buf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
static gboolean message_ok = FALSE;
|
||||
|
||||
if (gflare->filename == NULL)
|
||||
|
|
@ -1624,25 +1629,38 @@ gflare_save (GFlare *gflare)
|
|||
}
|
||||
|
||||
fprintf (fp, "%s", GFLARE_FILE_HEADER);
|
||||
fprintf (fp, "%f %s\n", gflare->glow_opacity, gflare_modes[gflare->glow_mode]);
|
||||
fprintf (fp, "%f %s\n", gflare->rays_opacity, gflare_modes[gflare->rays_mode]);
|
||||
fprintf (fp, "%f %s\n", gflare->sflare_opacity, gflare_modes[gflare->sflare_mode]);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->glow_opacity);
|
||||
fprintf (fp, "%s %s\n", buf[0], gflare_modes[gflare->glow_mode]);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->rays_opacity);
|
||||
fprintf (fp, "%s %s\n", buf[0], gflare_modes[gflare->rays_mode]);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->sflare_opacity);
|
||||
fprintf (fp, "%s %s\n", buf[0], gflare_modes[gflare->sflare_mode]);
|
||||
|
||||
gflare_write_gradient_name (gflare->glow_radial, fp);
|
||||
gflare_write_gradient_name (gflare->glow_angular, fp);
|
||||
gflare_write_gradient_name (gflare->glow_angular_size, fp);
|
||||
fprintf (fp, "%f %f %f\n", gflare->glow_size, gflare->glow_rotation, gflare->glow_hue);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->glow_size);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->glow_rotation);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->glow_hue);
|
||||
fprintf (fp, "%s %s %s\n", buf[0], buf[1], buf[2]);
|
||||
|
||||
gflare_write_gradient_name (gflare->rays_radial, fp);
|
||||
gflare_write_gradient_name (gflare->rays_angular, fp);
|
||||
gflare_write_gradient_name (gflare->rays_angular_size, fp);
|
||||
fprintf (fp, "%f %f %f\n", gflare->rays_size, gflare->rays_rotation, gflare->rays_hue);
|
||||
fprintf (fp, "%d %f\n", gflare->rays_nspikes, gflare->rays_thickness);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->rays_size);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->rays_rotation);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->rays_hue);
|
||||
fprintf (fp, "%s %s %s\n", buf[0], buf[1], buf[2]);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->rays_thickness);
|
||||
fprintf (fp, "%d %s\n", gflare->rays_nspikes, buf[0]);
|
||||
|
||||
gflare_write_gradient_name (gflare->sflare_radial, fp);
|
||||
gflare_write_gradient_name (gflare->sflare_sizefac, fp);
|
||||
gflare_write_gradient_name (gflare->sflare_probability, fp);
|
||||
fprintf (fp, "%f %f %f\n", gflare->sflare_size, gflare->sflare_rotation, gflare->sflare_hue);
|
||||
g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->sflare_size);
|
||||
g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->sflare_rotation);
|
||||
g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", gflare->sflare_hue);
|
||||
fprintf (fp, "%s %s %s\n", buf[0], buf[1], buf[2]);
|
||||
fprintf (fp, "%s %d %d\n", gflare_shapes[gflare->sflare_shape], gflare->sflare_nverts, gflare->sflare_seed_time ? -1 : gflare->sflare_seed);
|
||||
|
||||
fclose (fp);
|
||||
|
|
|
|||
|
|
@ -95,25 +95,25 @@ void setorientvector(char *str)
|
|||
n = atoi(tmps);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].x = atof(++tmps);
|
||||
pcvals.orientvector[n].x = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].y = atof(++tmps);
|
||||
pcvals.orientvector[n].y = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].dir = atof(++tmps);
|
||||
pcvals.orientvector[n].dir = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].dx = atof(++tmps);
|
||||
pcvals.orientvector[n].dx = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].dy = atof(++tmps);
|
||||
pcvals.orientvector[n].dy = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].str = atof(++tmps);
|
||||
pcvals.orientvector[n].str = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.orientvector[n].type = atoi(++tmps);
|
||||
pcvals.orientvector[n].type = atoi (++tmps);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -126,16 +126,16 @@ void setsizevector(char *str)
|
|||
n = atoi(tmps);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.sizevector[n].x = atof(++tmps);
|
||||
pcvals.sizevector[n].x = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.sizevector[n].y = atof(++tmps);
|
||||
pcvals.sizevector[n].y = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.sizevector[n].siz = atof(++tmps);
|
||||
pcvals.sizevector[n].siz = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
if(!(tmps = strchr(tmps, ','))) return;
|
||||
pcvals.sizevector[n].str = atof(++tmps);
|
||||
pcvals.sizevector[n].str = g_ascii_strtod (++tmps, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -161,39 +161,39 @@ void setval(char *key, char *val)
|
|||
else if(!strcmp(key, "orientnum"))
|
||||
pcvals.orientnum = atoi(val);
|
||||
else if(!strcmp(key, "orientfirst"))
|
||||
pcvals.orientfirst = atof(val);
|
||||
pcvals.orientfirst = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "orientlast"))
|
||||
pcvals.orientlast = atof(val);
|
||||
pcvals.orientlast = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "orienttype"))
|
||||
pcvals.orienttype = atoi(val);
|
||||
|
||||
else if(!strcmp(key, "sizenum"))
|
||||
pcvals.sizenum = atoi(val);
|
||||
else if(!strcmp(key, "sizefirst"))
|
||||
pcvals.sizefirst = atof(val);
|
||||
pcvals.sizefirst = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "sizelast"))
|
||||
pcvals.sizelast = atof(val);
|
||||
pcvals.sizelast = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "sizetype"))
|
||||
pcvals.sizetype = atoi(val);
|
||||
|
||||
else if(!strcmp(key, "brushrelief"))
|
||||
pcvals.brushrelief = atof(val);
|
||||
pcvals.brushrelief = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "brushscale")) {
|
||||
/* For compatibility */
|
||||
pcvals.sizenum = 1;
|
||||
pcvals.sizefirst = pcvals.sizelast = atof(val);
|
||||
pcvals.sizefirst = pcvals.sizelast = g_ascii_strtod (val, NULL);
|
||||
}
|
||||
else if(!strcmp(key, "brushdensity"))
|
||||
pcvals.brushdensity = atof(val);
|
||||
pcvals.brushdensity = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "brushgamma"))
|
||||
pcvals.brushgamma = atof(val);
|
||||
pcvals.brushgamma = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "brushaspect"))
|
||||
pcvals.brushaspect = atof(val);
|
||||
pcvals.brushaspect = g_ascii_strtod (val, NULL);
|
||||
|
||||
else if(!strcmp(key, "generalbgtype"))
|
||||
pcvals.generalbgtype = atoi(val);
|
||||
else if(!strcmp(key, "generaldarkedge"))
|
||||
pcvals.generaldarkedge = atof(val);
|
||||
pcvals.generaldarkedge = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "generalpaintedges"))
|
||||
pcvals.generalpaintedges = atoi(val);
|
||||
else if(!strcmp(key, "generaltileable"))
|
||||
|
|
@ -201,18 +201,18 @@ void setval(char *key, char *val)
|
|||
else if(!strcmp(key, "generaldropshadow"))
|
||||
pcvals.generaldropshadow = atoi(val);
|
||||
else if(!strcmp(key, "generalshadowdarkness"))
|
||||
pcvals.generalshadowdarkness = atof(val);
|
||||
pcvals.generalshadowdarkness = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "generalshadowdepth"))
|
||||
pcvals.generalshadowdepth = atoi(val);
|
||||
else if(!strcmp(key, "generalshadowblur"))
|
||||
pcvals.generalshadowblur = atoi(val);
|
||||
else if(!strcmp(key, "devthresh"))
|
||||
pcvals.devthresh = atof(val);
|
||||
pcvals.devthresh = g_ascii_strtod (val, NULL);
|
||||
|
||||
else if(!strcmp(key, "paperrelief"))
|
||||
pcvals.paperrelief = atof(val);
|
||||
pcvals.paperrelief = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "paperscale"))
|
||||
pcvals.paperscale = atof(val);
|
||||
pcvals.paperscale = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "paperinvert"))
|
||||
pcvals.paperinvert = atoi(val);
|
||||
else if(!strcmp(key, "paperoverlay"))
|
||||
|
|
@ -236,9 +236,9 @@ void setval(char *key, char *val)
|
|||
else if(!strcmp(key, "orientvector"))
|
||||
setorientvector(val);
|
||||
else if(!strcmp(key, "orientangoff"))
|
||||
pcvals.orientangoff = atof(val);
|
||||
pcvals.orientangoff = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "orientstrexp"))
|
||||
pcvals.orientstrexp = atof(val);
|
||||
pcvals.orientstrexp = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "orientvoronoi"))
|
||||
pcvals.orientvoronoi = atoi(val);
|
||||
|
||||
|
|
@ -247,14 +247,14 @@ void setval(char *key, char *val)
|
|||
else if(!strcmp(key, "sizevector"))
|
||||
setsizevector(val);
|
||||
else if(!strcmp(key, "sizestrexp"))
|
||||
pcvals.sizestrexp = atof(val);
|
||||
pcvals.sizestrexp = g_ascii_strtod (val, NULL);
|
||||
else if(!strcmp(key, "sizevoronoi"))
|
||||
pcvals.sizevoronoi = atoi(val);
|
||||
|
||||
else if(!strcmp(key, "colortype"))
|
||||
pcvals.colortype = atoi(val);
|
||||
else if(!strcmp(key, "colornoise"))
|
||||
pcvals.colornoise = atof(val);
|
||||
pcvals.colornoise = g_ascii_strtod (val, NULL);
|
||||
}
|
||||
|
||||
int loadpreset(char *fn)
|
||||
|
|
@ -422,6 +422,8 @@ void savepreset(GtkWidget *wg, GtkWidget *p)
|
|||
static char fname[200];
|
||||
FILE *f;
|
||||
GList *thispath;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
gchar vbuf[6][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
int i;
|
||||
|
||||
l = gtk_entry_get_text(GTK_ENTRY(presetnameentry));
|
||||
|
|
@ -443,32 +445,45 @@ void savepreset(GtkWidget *wg, GtkWidget *p)
|
|||
fprintf(f, "%s\n", PRESETMAGIC);
|
||||
fprintf(f, "desc=%s\n", presetdesc);
|
||||
fprintf(f, "orientnum=%d\n", pcvals.orientnum);
|
||||
fprintf(f, "orientfirst=%f\n", pcvals.orientfirst);
|
||||
fprintf(f, "orientlast=%f\n", pcvals.orientlast);
|
||||
fprintf(f, "orientfirst=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientfirst));
|
||||
fprintf(f, "orientlast=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientlast));
|
||||
fprintf(f, "orienttype=%d\n", pcvals.orienttype);
|
||||
|
||||
fprintf(f, "sizenum=%d\n", pcvals.sizenum);
|
||||
fprintf(f, "sizefirst=%f\n", pcvals.sizefirst);
|
||||
fprintf(f, "sizelast=%f\n", pcvals.sizelast);
|
||||
fprintf(f, "sizefirst=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizefirst));
|
||||
fprintf(f, "sizelast=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizelast));
|
||||
fprintf(f, "sizetype=%d\n", pcvals.sizetype);
|
||||
|
||||
fprintf(f, "brushrelief=%f\n", pcvals.brushrelief);
|
||||
fprintf(f, "brushdensity=%f\n", pcvals.brushdensity);
|
||||
fprintf(f, "brushgamma=%f\n", pcvals.brushgamma);
|
||||
fprintf(f, "brushaspect=%f\n", pcvals.brushaspect);
|
||||
fprintf(f, "brushrelief=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.brushrelief));
|
||||
fprintf(f, "brushdensity=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.brushdensity));
|
||||
fprintf(f, "brushgamma=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.brushgamma));
|
||||
fprintf(f, "brushaspect=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.brushaspect));
|
||||
|
||||
fprintf(f, "generalbgtype=%d\n", pcvals.generalbgtype);
|
||||
fprintf(f, "generaldarkedge=%f\n", pcvals.generaldarkedge);
|
||||
fprintf(f, "generaldarkedge=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.generaldarkedge));
|
||||
fprintf(f, "generalpaintedges=%d\n", pcvals.generalpaintedges);
|
||||
fprintf(f, "generaltileable=%d\n", pcvals.generaltileable);
|
||||
fprintf(f, "generaldropshadow=%d\n", pcvals.generaldropshadow);
|
||||
fprintf(f, "generalshadowdarkness=%f\n", pcvals.generalshadowdarkness);
|
||||
fprintf(f, "generalshadowdarkness=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.generalshadowdarkness));
|
||||
fprintf(f, "generalshadowdepth=%d\n", pcvals.generalshadowdepth);
|
||||
fprintf(f, "generalshadowblur=%d\n", pcvals.generalshadowblur);
|
||||
fprintf(f, "devthresh=%f\n", pcvals.devthresh);
|
||||
fprintf(f, "devthresh=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.devthresh));
|
||||
|
||||
fprintf(f, "paperrelief=%f\n", pcvals.paperrelief);
|
||||
fprintf(f, "paperscale=%f\n", pcvals.paperscale);
|
||||
fprintf(f, "paperrelief=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.paperrelief));
|
||||
fprintf(f, "paperscale=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.paperscale));
|
||||
fprintf(f, "paperinvert=%d\n", pcvals.paperinvert);
|
||||
fprintf(f, "paperoverlay=%d\n", pcvals.paperoverlay);
|
||||
|
||||
|
|
@ -482,33 +497,43 @@ void savepreset(GtkWidget *wg, GtkWidget *p)
|
|||
fprintf(f, "placecenter=%d\n", pcvals.placecenter);
|
||||
|
||||
fprintf(f, "numorientvector=%d\n", pcvals.numorientvector);
|
||||
for(i = 0; i < pcvals.numorientvector; i++) {
|
||||
fprintf(f, "orientvector=%d,%f,%f,%f,%f,%f,%f,%d\n", i,
|
||||
pcvals.orientvector[i].x,
|
||||
pcvals.orientvector[i].y,
|
||||
pcvals.orientvector[i].dir,
|
||||
pcvals.orientvector[i].dx,
|
||||
pcvals.orientvector[i].dy,
|
||||
pcvals.orientvector[i].str,
|
||||
pcvals.orientvector[i].type);
|
||||
}
|
||||
fprintf(f, "orientangoff=%f\n", pcvals.orientangoff);
|
||||
fprintf(f, "orientstrexp=%f\n", pcvals.orientstrexp);
|
||||
for(i = 0; i < pcvals.numorientvector; i++)
|
||||
{
|
||||
g_ascii_formatd (vbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].x);
|
||||
g_ascii_formatd (vbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].y);
|
||||
g_ascii_formatd (vbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].dir);
|
||||
g_ascii_formatd (vbuf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].dx);
|
||||
g_ascii_formatd (vbuf[4], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].dy);
|
||||
g_ascii_formatd (vbuf[5], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientvector[i].str);
|
||||
|
||||
fprintf (f, "orientvector=%d,%s,%s,%s,%s,%s,%s,%d\n", i,
|
||||
vbuf[0], vbuf[1], vbuf[2], vbuf[3], vbuf[4], vbuf[5],
|
||||
pcvals.orientvector[i].type);
|
||||
}
|
||||
|
||||
fprintf(f, "orientangoff=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientangoff));
|
||||
fprintf(f, "orientstrexp=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientstrexp));
|
||||
fprintf(f, "orientvoronoi=%d\n", pcvals.orientvoronoi);
|
||||
|
||||
fprintf(f, "numsizevector=%d\n", pcvals.numsizevector);
|
||||
for(i = 0; i < pcvals.numsizevector; i++) {
|
||||
fprintf(f, "sizevector=%d,%f,%f,%f,%f\n", i,
|
||||
pcvals.sizevector[i].x,
|
||||
pcvals.sizevector[i].y,
|
||||
pcvals.sizevector[i].siz,
|
||||
pcvals.sizevector[i].str);
|
||||
}
|
||||
fprintf(f, "sizestrexp=%f\n", pcvals.sizestrexp);
|
||||
for (i = 0; i < pcvals.numsizevector; i++)
|
||||
{
|
||||
g_ascii_formatd (vbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizevector[i].x);
|
||||
g_ascii_formatd (vbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizevector[i].y);
|
||||
g_ascii_formatd (vbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizevector[i].siz);
|
||||
g_ascii_formatd (vbuf[3], G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizevector[i].str);
|
||||
fprintf (f, "sizevector=%d,%s,%s,%s,%s\n", i,
|
||||
vbuf[0], vbuf[1], vbuf[2], vbuf[3]);
|
||||
}
|
||||
fprintf(f, "sizestrexp=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.sizestrexp));
|
||||
fprintf(f, "sizevoronoi=%d\n", pcvals.sizevoronoi);
|
||||
|
||||
fprintf(f, "colortype=%d\n", pcvals.colortype);
|
||||
fprintf(f, "colornoise=%f\n", pcvals.colornoise);
|
||||
fprintf(f, "colornoise=%s\n",
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.colornoise));
|
||||
|
||||
fclose(f);
|
||||
presetsrefresh();
|
||||
|
|
|
|||
|
|
@ -450,53 +450,77 @@ char *
|
|||
ifsvals_stringify (IfsComposeVals *vals, AffElement **elements)
|
||||
{
|
||||
gint i;
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
gchar cbuf[3][G_ASCII_DTOSTR_BUF_SIZE];
|
||||
GString *result = g_string_new (NULL);
|
||||
|
||||
g_string_append_printf (result, "iterations %d\n", vals->iterations);
|
||||
g_string_append_printf (result, "max_memory %d\n", vals->max_memory);
|
||||
g_string_append_printf (result, "subdivide %d\n", vals->subdivide);
|
||||
g_string_append_printf (result, "radius %f\n", vals->radius);
|
||||
g_string_append_printf (result, "aspect_ratio %f\n", vals->aspect_ratio);
|
||||
g_string_append_printf (result, "center_x %f\n", vals->center_x);
|
||||
g_string_append_printf (result, "center_y %f\n", vals->center_y);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", vals->radius);
|
||||
g_string_append_printf (result, "radius %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", vals->aspect_ratio);
|
||||
g_string_append_printf (result, "aspect_ratio %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", vals->center_x);
|
||||
g_string_append_printf (result, "center_x %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", vals->center_y);
|
||||
g_string_append_printf (result, "center_y %s\n", buf);
|
||||
|
||||
for (i=0; i<vals->num_elements; i++)
|
||||
{
|
||||
g_string_append (result, "element {\n");
|
||||
g_string_append_printf (result, " x %f\n", elements[i]->v.x);
|
||||
g_string_append_printf (result, " y %f\n", elements[i]->v.y);
|
||||
g_string_append_printf (result, " theta %f\n", elements[i]->v.theta);
|
||||
g_string_append_printf (result, " scale %f\n", elements[i]->v.scale);
|
||||
g_string_append_printf (result, " asym %f\n", elements[i]->v.asym);
|
||||
g_string_append_printf (result, " shear %f\n", elements[i]->v.shear);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.x);
|
||||
g_string_append_printf (result, " x %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.y);
|
||||
g_string_append_printf (result, " y %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.theta);
|
||||
g_string_append_printf (result, " theta %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.scale);
|
||||
g_string_append_printf (result, " scale %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.asym);
|
||||
g_string_append_printf (result, " asym %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.shear);
|
||||
g_string_append_printf (result, " shear %s\n", buf);
|
||||
g_string_append_printf (result, " flip %d\n", elements[i]->v.flip);
|
||||
g_string_append_printf (result, " red_color { %f,%f,%f }\n",
|
||||
elements[i]->v.red_color.r,
|
||||
elements[i]->v.red_color.g,
|
||||
elements[i]->v.red_color.b);
|
||||
g_string_append_printf (result, " green_color { %f,%f,%f }\n",
|
||||
elements[i]->v.green_color.r,
|
||||
elements[i]->v.green_color.g,
|
||||
elements[i]->v.green_color.b);
|
||||
g_string_append_printf (result, " blue_color { %f,%f,%f }\n",
|
||||
elements[i]->v.blue_color.r,
|
||||
elements[i]->v.blue_color.g,
|
||||
elements[i]->v.blue_color.b);
|
||||
g_string_append_printf (result, " black_color { %f,%f,%f }\n",
|
||||
elements[i]->v.black_color.r,
|
||||
elements[i]->v.black_color.g,
|
||||
elements[i]->v.black_color.b);
|
||||
g_string_append_printf (result, " target_color { %f,%f,%f }\n",
|
||||
elements[i]->v.target_color.r,
|
||||
elements[i]->v.target_color.g,
|
||||
elements[i]->v.target_color.b);
|
||||
g_string_append_printf (result, " hue_scale %f\n",
|
||||
elements[i]->v.hue_scale);
|
||||
g_string_append_printf (result, " value_scale %f\n",
|
||||
elements[i]->v.value_scale);
|
||||
|
||||
g_ascii_formatd (cbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.red_color.r);
|
||||
g_ascii_formatd (cbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.red_color.g);
|
||||
g_ascii_formatd (cbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.red_color.b);
|
||||
g_string_append_printf (result, " red_color { %s,%s,%s }\n",
|
||||
cbuf[0], cbuf[1], cbuf[2]);
|
||||
|
||||
g_ascii_formatd (cbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.green_color.r);
|
||||
g_ascii_formatd (cbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.green_color.g);
|
||||
g_ascii_formatd (cbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.green_color.b);
|
||||
g_string_append_printf (result, " green_color { %s,%s,%s }\n",
|
||||
cbuf[0], cbuf[1], cbuf[2]);
|
||||
|
||||
g_ascii_formatd (cbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.blue_color.r);
|
||||
g_ascii_formatd (cbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.blue_color.g);
|
||||
g_ascii_formatd (cbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.blue_color.b);
|
||||
g_string_append_printf (result, " blue_color { %s,%s,%s }\n",
|
||||
cbuf[0], cbuf[1], cbuf[2]);
|
||||
|
||||
g_ascii_formatd (cbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.black_color.r);
|
||||
g_ascii_formatd (cbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.black_color.g);
|
||||
g_ascii_formatd (cbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.black_color.b);
|
||||
g_string_append_printf (result, " black_color { %s,%s,%s }\n",
|
||||
cbuf[0], cbuf[1], cbuf[2]);
|
||||
|
||||
g_ascii_formatd (cbuf[0], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.target_color.r);
|
||||
g_ascii_formatd (cbuf[1], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.target_color.g);
|
||||
g_ascii_formatd (cbuf[2], G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.target_color.b);
|
||||
g_string_append_printf (result, " target_color { %s,%s,%s }\n",
|
||||
cbuf[0], cbuf[1], cbuf[2]);
|
||||
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.hue_scale);
|
||||
g_string_append_printf (result, " hue_scale %s\n", buf);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.value_scale);
|
||||
g_string_append_printf (result, " value_scale %s\n", buf);
|
||||
g_string_append_printf (result, " simple_color %d\n",
|
||||
elements[i]->v.simple_color);
|
||||
g_string_append_printf (result, " prob %f\n", elements[i]->v.prob);
|
||||
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", elements[i]->v.prob);
|
||||
g_string_append_printf (result, " prob %s\n", buf);
|
||||
g_string_append (result, "}\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -882,16 +882,16 @@ case 23:
|
|||
case 36:
|
||||
#line 159 "imap_csim.y"
|
||||
{
|
||||
if (!g_strcasecmp(yyvsp[0].id, "RECT")) {
|
||||
if (!g_ascii_strcasecmp(yyvsp[0].id, "RECT")) {
|
||||
current_object = create_rectangle(0, 0, 0, 0);
|
||||
current_type = RECTANGLE;
|
||||
} else if (!g_strcasecmp(yyvsp[0].id, "CIRCLE")) {
|
||||
} else if (!g_ascii_strcasecmp(yyvsp[0].id, "CIRCLE")) {
|
||||
current_object = create_circle(0, 0, 0);
|
||||
current_type = CIRCLE;
|
||||
} else if (!g_strcasecmp(yyvsp[0].id, "POLY")) {
|
||||
} else if (!g_ascii_strcasecmp(yyvsp[0].id, "POLY")) {
|
||||
current_object = create_polygon(NULL);
|
||||
current_type = POLYGON;
|
||||
} else if (!g_strcasecmp(yyvsp[0].id, "DEFAULT")) {
|
||||
} else if (!g_ascii_strcasecmp(yyvsp[0].id, "DEFAULT")) {
|
||||
current_type = UNDEFINED;
|
||||
}
|
||||
;
|
||||
|
|
|
|||
|
|
@ -165,8 +165,6 @@ script_fu_console_interface (void)
|
|||
GtkWidget *hbox;
|
||||
GIOChannel *input_channel;
|
||||
|
||||
INIT_I18N_UI();
|
||||
|
||||
gimp_ui_init ("script-fu", FALSE);
|
||||
|
||||
dialog = gimp_dialog_new (_("Script-Fu Console"), "script-fu-console",
|
||||
|
|
|
|||
|
|
@ -1195,7 +1195,7 @@ script_fu_interface (SFScript *script)
|
|||
|
||||
if (!gtk_initted)
|
||||
{
|
||||
INIT_I18N_UI();
|
||||
INIT_I18N();
|
||||
|
||||
gimp_ui_init ("script-fu", TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,25 +23,11 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
#define INIT_I18N() G_STMT_START{ \
|
||||
setlocale(LC_MESSAGES, ""); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-libgimp", LOCALEDIR); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-script-fu", LOCALEDIR); \
|
||||
textdomain(GETTEXT_PACKAGE"-script-fu"); \
|
||||
}G_STMT_END
|
||||
#else
|
||||
#define INIT_I18N() G_STMT_START{ \
|
||||
setlocale (LC_ALL, ""); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-libgimp", LOCALEDIR); \
|
||||
bindtextdomain(GETTEXT_PACKAGE"-script-fu", LOCALEDIR); \
|
||||
textdomain(GETTEXT_PACKAGE"-script-fu"); \
|
||||
}G_STMT_END
|
||||
#endif
|
||||
|
||||
#define INIT_I18N_UI() G_STMT_START{ \
|
||||
gtk_set_locale(); \
|
||||
setlocale (LC_NUMERIC, "C"); \
|
||||
INIT_I18N(); \
|
||||
}G_STMT_END
|
||||
}G_STMT_END
|
||||
|
||||
#endif /* __SCRIPT_FU_INTL_H__ */
|
||||
|
|
|
|||
|
|
@ -1195,7 +1195,7 @@ script_fu_interface (SFScript *script)
|
|||
|
||||
if (!gtk_initted)
|
||||
{
|
||||
INIT_I18N_UI();
|
||||
INIT_I18N();
|
||||
|
||||
gimp_ui_init ("script-fu", TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ server_interface (void)
|
|||
GtkWidget *dlg;
|
||||
GtkWidget *table;
|
||||
|
||||
INIT_I18N_UI();
|
||||
INIT_I18N();
|
||||
|
||||
gimp_ui_init ("script-fu", FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -180,6 +180,8 @@ script_fu_run (gchar *name,
|
|||
gint *nreturn_vals,
|
||||
GimpParam **return_vals)
|
||||
{
|
||||
INIT_I18N();
|
||||
|
||||
siod_set_output_file (stdout);
|
||||
|
||||
/* Determine before we allow scripts to register themselves
|
||||
|
|
@ -275,8 +277,6 @@ script_fu_auxillary_init (void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N_UI();
|
||||
|
||||
gimp_install_temp_proc ("script_fu_refresh",
|
||||
_("Re-read all available scripts"),
|
||||
_("Re-read all available scripts"),
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ main (gint argc,
|
|||
exit (-1);
|
||||
}
|
||||
|
||||
gimp_window = gdk_window_foreign_new (gimp_x_window);
|
||||
gimp_window = gdk_window_foreign_new ((GdkNativeWindow) gimp_x_window);
|
||||
if (!gimp_window)
|
||||
{
|
||||
g_printerr ("Couldn't create gdk_window for gimp_x_window\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue