Commit 65ab53a8 authored by Manish Singh's avatar Manish Singh
Browse files

applied gimp-bjj-980922-0, makes get_token's EOF report "sticky"

* app/general.c: applied gimp-bjj-980922-0, makes get_token's
EOF report "sticky"

* app/devices.c: applied gimp-bjj-980922-1, sanity check our
saved device info for NULL pointers

* app/file_new_dialog.c
* app/gimage_cmds.[ch]
* app/gimpimage.[ch]
* app/info_window.c
* app/internal_procs.c
* libgimp/gimp.h
* libgimp/gimpimage.c
* plug-ins/tiff/tiff.c: applied gimp-austin-980916-0, adds resolution
info to GimpImage, with accessors, and support in the tiff plug-in

-Yosh
parent 8357369b
Mon Oct 5 02:42:47 PDT 1998 Manish Singh <yosh@gimp.org>
* app/general.c: applied gimp-bjj-980922-0, makes get_token's
EOF report "sticky"
* app/devices.c: applied gimp-bjj-980922-1, sanity check our
saved device info for NULL pointers
* app/file_new_dialog.c
* app/gimage_cmds.[ch]
* app/gimpimage.[ch]
* app/info_window.c
* app/internal_procs.c
* libgimp/gimp.h
* libgimp/gimpimage.c
* plug-ins/tiff/tiff.c: applied gimp-austin-980916-0, adds resolution
info to GimpImage, with accessors, and support in the tiff plug-in
Mon Oct 5 00:28:58 PDT 1998 Manish Singh <yosh@gimp.org>
* po/de.po
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -150,6 +150,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
}
GtkType gimp_image_get_type(void){
......@@ -293,6 +294,20 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
}
void
gimp_image_set_resolution (GimpImage *gimage, float resolution)
{
gimage->resolution = resolution;
}
float
gimp_image_get_resolution (GimpImage *gimage)
{
return gimage->resolution;
}
void
gimp_image_resize (GimpImage *gimage, int new_width, int new_height,
int offset_x, int offset_y)
......
......@@ -102,6 +102,8 @@ GtkType gimp_image_get_type(void);
GimpImage * gimp_image_new (int, int, int);
void gimp_image_set_filename (GimpImage *, char *);
void gimp_image_set_resolution (GimpImage *, float);
float gimp_image_get_resolution (GimpImage *);
void gimp_image_resize (GimpImage *, int, int, int, int);
void gimp_image_scale (GimpImage *, int, int);
GimpImage * gimp_image_get_named (char *);
......
......@@ -597,9 +597,12 @@ devices_write_rc_device (DeviceInfo *device_info, FILE *fp)
if (device_info->is_init)
{
fprintf(fp, "\n (brush \"%s\")",device_info->brush->name);
fprintf(fp, "\n (pattern \"%s\")",device_info->pattern->name);
fprintf(fp, "\n (tool \"%s\")",
if (device_info->brush)
fprintf(fp, "\n (brush \"%s\")",device_info->brush->name);
if (device_info->pattern)
fprintf(fp, "\n (pattern \"%s\")",device_info->pattern->name);
if (device_info->tool)
fprintf(fp, "\n (tool \"%s\")",
tool_info[device_info->tool].tool_name);
fprintf(fp, "\n (foreground %d %d %d)",
device_info->foreground[0],
......
......@@ -113,6 +113,8 @@ file_new_ok_callback (GtkWidget *widget,
gimage = gimage_new (vals->width, vals->height, vals->type);
gimp_image_set_resolution(gimage, vals->resolution);
/* Make the background (or first) layer */
layer = layer_new (gimage, gimage->width, gimage->height,
type, "Background", OPAQUE_OPACITY, NORMAL);
......
......@@ -39,6 +39,7 @@ struct _InfoWinData
char visual_class_str[MAX_BUF];
char visual_depth_str[MAX_BUF];
char shades_str[MAX_BUF];
char resolution_str[MAX_BUF];
};
/* The different classes of visuals */
......@@ -144,6 +145,7 @@ info_window_create (void *gdisp_ptr)
iwd = (InfoWinData *) g_malloc (sizeof (InfoWinData));
info_win->user_data = iwd;
iwd->dimensions_str[0] = '\0';
iwd->resolution_str[0] = '\0';
iwd->scale_str[0] = '\0';
iwd->color_type_str[0] = '\0';
iwd->visual_class_str[0] = '\0';
......@@ -152,6 +154,7 @@ info_window_create (void *gdisp_ptr)
/* add the information fields */
info_dialog_add_field (info_win, "Dimensions (w x h): ", iwd->dimensions_str, NULL, NULL);
info_dialog_add_field (info_win, "Resolution: ", iwd->resolution_str, NULL, NULL);
info_dialog_add_field (info_win, "Scale Ratio: ", iwd->scale_str, NULL, NULL);
info_dialog_add_field (info_win, "Display Type: ", iwd->color_type_str, NULL, NULL);
info_dialog_add_field (info_win, "Visual Class: ", iwd->visual_class_str, NULL, NULL);
......@@ -195,6 +198,9 @@ info_window_update (InfoDialog *info_win,
sprintf (iwd->dimensions_str, "%d x %d",
(int) gdisp->gimage->width, (int) gdisp->gimage->height);
/* image resolution */
sprintf (iwd->resolution_str, "%g dpi", gdisp->gimage->resolution);
/* zoom ratio */
sprintf (iwd->scale_str, "%d:%d",
SCALEDEST (gdisp), SCALESRC (gdisp));
......
......@@ -113,6 +113,8 @@ file_new_ok_callback (GtkWidget *widget,
gimage = gimage_new (vals->width, vals->height, vals->type);
gimp_image_set_resolution(gimage, vals->resolution);
/* Make the background (or first) layer */
layer = layer_new (gimage, gimage->width, gimage->height,
type, "Background", OPAQUE_OPACITY, NORMAL);
......
......@@ -137,11 +137,11 @@ get_token (ParseInfo *info)
info->position = -1;
if ((info->position == -1) || (buffer[info->position] == '\0'))
{
info->position = 0;
count = fread (buffer, sizeof (char), info->buffer_size - 1, info->fp);
if ((count == 0) && feof (info->fp))
return TOKEN_EOF;
buffer[count] = '\0';
info->position = 0;
}
info->inc_charnum = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment