72
67
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
74
config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config);
69
config = GIMP_DISPLAY_CONFIG (shell->display->image->gimp->config);
76
71
gimp_display_shell_format_title (shell, title, sizeof (title),
77
72
config->image_status_format);
79
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "title", title);
74
gimp_statusbar_push (GIMP_STATUSBAR (shell->statusbar), "title",
170
162
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
172
image = shell->gdisp->gimage;
164
image = shell->display->image;
173
165
gimp = image->gimp;
175
gimp_display_shell_scale_get_fraction (shell->scale, &num, &denom);
167
gimp_zoom_model_get_fraction (shell->zoom, &num, &denom);
177
169
while (i < title_len && *format)
186
/* format string ends within %-sequence, print literal '%' */
192
case 'f': /* pruned filename */
194
const gchar *uri = gimp_image_get_uri (image);
197
basename = file_utils_uri_to_utf8_basename (uri);
199
i += print (title, title_len, i, "%s", basename);
205
case 'F': /* full filename */
208
const gchar *uri = gimp_image_get_uri (image);
210
filename = file_utils_uri_to_utf8_filename (uri);
178
/* format string ends within %-sequence, print literal '%' */
184
case 'f': /* pruned filename */
186
const gchar *uri = gimp_image_get_uri (image);
189
basename = file_utils_uri_display_basename (uri);
191
i += print (title, title_len, i, "%s", basename);
197
case 'F': /* full filename */
200
const gchar *uri = gimp_image_get_uri (image);
202
filename = file_utils_uri_display_name (uri);
212
204
i += print (title, title_len, i, "%s", filename);
214
206
g_free (filename);
218
case 'p': /* PDB id */
219
i += print (title, title_len, i, "%d", gimp_image_get_ID (image));
222
case 'i': /* instance */
223
i += print (title, title_len, i, "%d", shell->gdisp->instance);
210
case 'p': /* PDB id */
211
i += print (title, title_len, i, "%d", gimp_image_get_ID (image));
214
case 'i': /* instance */
215
i += print (title, title_len, i, "%d", shell->display->instance);
228
220
const gchar *image_type_str = NULL;
229
221
gboolean empty = gimp_image_is_empty (image);
247
239
i += print (title, title_len, i, "%s", image_type_str);
251
case 's': /* user source zoom factor */
252
i += print (title, title_len, i, "%d", denom);
255
case 'd': /* user destination zoom factor */
256
i += print (title, title_len, i, "%d", num);
259
case 'z': /* user zoom factor (percentage) */
260
i += print (title, title_len, i,
261
shell->scale >= 0.15 ? "%.0f" : "%.2f",
265
case 'D': /* dirty flag */
268
/* format string ends within %D-sequence, print literal '%D' */
243
case 's': /* user source zoom factor */
244
i += print (title, title_len, i, "%d", denom);
247
case 'd': /* user destination zoom factor */
248
i += print (title, title_len, i, "%d", num);
251
case 'z': /* user zoom factor (percentage) */
253
gdouble scale = gimp_zoom_model_get_factor (shell->zoom);
255
i += print (title, title_len, i,
256
scale >= 0.15 ? "%.0f" : "%.2f", 100.0 * scale);
260
case 'D': /* dirty flag */
263
/* format string ends within %D-sequence, print literal '%D' */
269
264
i += print (title, title_len, i, "%%D");
273
title[i++] = format[1];
268
title[i++] = format[1];
277
case 'C': /* clean flag */
280
/* format string ends within %C-sequence, print literal '%C' */
272
case 'C': /* clean flag */
275
/* format string ends within %C-sequence, print literal '%C' */
281
276
i += print (title, title_len, i, "%%C");
285
title[i++] = format[1];
289
case 'B': /* dirty flag (long) */
291
i += print (title, title_len, i, "%s",
295
case 'A': /* clean flag (long) */
297
i += print (title, title_len, i, "%s",
280
title[i++] = format[1];
284
case 'B': /* dirty flag (long) */
286
i += print (title, title_len, i, "%s", _("(modified)"));
289
case 'A': /* clean flag (long) */
291
i += print (title, title_len, i, "%s", _("(clean)"));
301
294
case 'm': /* memory used by image */
366
359
/* else fallthru */
367
case 'w': /* width in pixels */
368
i += print (title, title_len, i, "%d", image->width);
360
case 'w': /* width in pixels */
361
i += print (title, title_len, i, "%d", image->width);
371
case 'H': /* height in real-world units */
364
case 'H': /* height in real-world units */
372
365
if (shell->unit != GIMP_UNIT_PIXEL)
374
367
gchar unit_format[8];
384
377
/* else fallthru */
385
case 'h': /* height in pixels */
386
i += print (title, title_len, i, "%d", image->height);
389
case 'u': /* unit symbol */
390
i += print (title, title_len, i, "%s",
391
_gimp_unit_get_symbol (gimp, shell->unit));
394
case 'U': /* unit abbreviation */
395
i += print (title, title_len, i, "%s",
396
_gimp_unit_get_abbreviation (gimp, shell->unit));
399
/* Other cool things to be added:
378
case 'h': /* height in pixels */
379
i += print (title, title_len, i, "%d", image->height);
382
case 'u': /* unit symbol */
383
i += print (title, title_len, i, "%s",
384
_gimp_unit_get_symbol (gimp, shell->unit));
387
case 'U': /* unit abbreviation */
388
i += print (title, title_len, i, "%s",
389
_gimp_unit_get_abbreviation (gimp, shell->unit));
392
/* Other cool things to be added:
401
394
* %R = yresolution
402
395
* %� = image's fractal dimension
403
396
* %� = the answer to everything
407
400
/* format string contains unknown %-sequence, print it literally */
408
401
i += print (title, title_len, i, "%%%c", *format);
414
title[i++] = *format;
407
title[i++] = *format;