327
324
dump_describe_param (GParamSpec *param_spec)
326
const gchar *blurb = g_param_spec_get_blurb (param_spec);
331
327
const gchar *values = NULL;
333
blurb = g_param_spec_get_blurb (param_spec);
337
331
g_warning ("FIXME: Property '%s' has no blurb.", param_spec->name);
339
333
blurb = g_strdup_printf ("The %s property has no description.",
343
type = param_spec->value_type;
345
if (g_type_is_a (type, GIMP_TYPE_RGB))
348
"The color is specified in the form (color-rgba red green blue alpha) "
349
"with channel values as floats between 0.0 and 1.0.";
351
else if (g_type_is_a (type, GIMP_TYPE_MEMSIZE))
354
"The integer size can contain a suffix of 'B', 'K', 'M' or 'G' which "
355
"makes GIMP interpret the size as being specified in bytes, kilobytes, "
356
"megabytes or gigabytes. If no suffix is specified the size defaults "
357
"to being specified in kilobytes.";
359
else if (g_type_is_a (type, GIMP_TYPE_PATH))
361
switch (gimp_param_spec_path_type (param_spec))
363
case GIMP_PARAM_PATH_FILE:
364
values = "This is a single filename.";
367
case GIMP_PARAM_PATH_FILE_LIST:
368
switch (G_SEARCHPATH_SEPARATOR)
371
values = "This is a colon-separated list of files.";
374
values = "This is a semicolon-separated list of files.";
377
g_warning ("unhandled G_SEARCHPATH_SEPARATOR value");
382
case GIMP_PARAM_PATH_DIR:
383
values = "This is a single folder.";
386
case GIMP_PARAM_PATH_DIR_LIST:
387
switch (G_SEARCHPATH_SEPARATOR)
390
values = "This is a colon-separated list of folders to search.";
393
values = "This is a semicolon-separated list of folders to search.";
396
g_warning ("unhandled G_SEARCHPATH_SEPARATOR value");
402
else if (g_type_is_a (type, GIMP_TYPE_UNIT))
405
"The unit can be one inches, millimeters, points or picas plus "
406
"those in your user units database.";
408
else if (g_type_is_a (type, GIMP_TYPE_CONFIG))
337
if (GIMP_IS_PARAM_SPEC_RGB (param_spec))
339
if (gimp_param_spec_rgb_has_alpha (param_spec))
341
"The color is specified in the form (color-rgba red green blue "
342
"alpha) with channel values as floats in the range of 0.0 to 1.0.";
345
"The color is specified in the form (color-rgb red green blue) "
346
"with channel values as floats in the range of 0.0 to 1.0.";
348
else if (GIMP_IS_PARAM_SPEC_MEMSIZE (param_spec))
351
"The integer size can contain a suffix of 'B', 'K', 'M' or 'G' which "
352
"makes GIMP interpret the size as being specified in bytes, kilobytes, "
353
"megabytes or gigabytes. If no suffix is specified the size defaults "
354
"to being specified in kilobytes.";
356
else if (GIMP_IS_PARAM_SPEC_CONFIG_PATH (param_spec))
358
switch (gimp_param_spec_config_path_type (param_spec))
360
case GIMP_CONFIG_PATH_FILE:
361
values = "This is a single filename.";
364
case GIMP_CONFIG_PATH_FILE_LIST:
365
switch (G_SEARCHPATH_SEPARATOR)
368
values = "This is a colon-separated list of files.";
371
values = "This is a semicolon-separated list of files.";
374
g_warning ("unhandled G_SEARCHPATH_SEPARATOR value");
379
case GIMP_CONFIG_PATH_DIR:
380
values = "This is a single folder.";
383
case GIMP_CONFIG_PATH_DIR_LIST:
384
switch (G_SEARCHPATH_SEPARATOR)
387
values = "This is a colon-separated list of folders to search.";
390
values = "This is a semicolon-separated list of folders to search.";
393
g_warning ("unhandled G_SEARCHPATH_SEPARATOR value");
399
else if (GIMP_IS_PARAM_SPEC_UNIT (param_spec))
402
"The unit can be one inches, millimeters, points or picas plus "
403
"those in your user units database.";
405
else if (g_type_is_a (param_spec->value_type, GIMP_TYPE_CONFIG))
410
407
values = "This is a parameter list.";
414
switch (G_TYPE_FUNDAMENTAL (type))
417
values = "Possible values are yes and no.";
423
values = "This is an integer value.";
427
values = "This is a float value.";
431
if (strcmp (g_param_spec_get_name (param_spec), "image-title-format")
433
strcmp (g_param_spec_get_name (param_spec), "image-status-format"))
435
values = "This is a string value.";
439
values = display_format_description;
444
GEnumClass *enum_class;
445
GEnumValue *enum_value;
449
enum_class = g_type_class_peek (type);
451
str = g_string_new (blurb);
453
g_string_append (str, " Possible values are ");
455
for (i = 0, enum_value = enum_class->values;
456
i < enum_class->n_values;
459
g_string_append (str, enum_value->value_nick);
461
switch (enum_class->n_values - i)
464
g_string_append_c (str, '.');
467
g_string_append (str, " and ");
470
g_string_append (str, ", ");
475
return g_string_free (str, FALSE);
411
switch (G_TYPE_FUNDAMENTAL (param_spec->value_type))
414
values = "Possible values are yes and no.";
420
values = "This is an integer value.";
424
values = "This is a float value.";
428
if (strcmp (g_param_spec_get_name (param_spec), "image-title-format")
430
strcmp (g_param_spec_get_name (param_spec), "image-status-format"))
432
values = "This is a string value.";
436
values = display_format_description;
441
GEnumClass *enum_class;
442
GEnumValue *enum_value;
446
enum_class = g_type_class_peek (param_spec->value_type);
448
str = g_string_new (blurb);
450
g_string_append (str, " Possible values are ");
452
for (i = 0, enum_value = enum_class->values;
453
i < enum_class->n_values;
456
g_string_append (str, enum_value->value_nick);
458
switch (enum_class->n_values - i)
461
g_string_append_c (str, '.');
464
g_string_append (str, " and ");
467
g_string_append (str, ", ");
472
return g_string_free (str, FALSE);
484
g_warning ("FIXME: Can't tell anything about a %s.", g_type_name (type));
481
g_warning ("FIXME: Can't tell anything about a %s.",
482
g_type_name (param_spec->value_type));
486
484
return g_strdup_printf ("%s %s", blurb, values);