mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-20 19:43:01 +00:00
6711646648
2004-10-25 Michael Natterer <mitch@gimp.org> Don't store human readable and translatable enum/flag strings in GEnumValue's and GTypeValue's fields but attach them to their GType using separate structs and utility functions: * tools/gimp-mkenums: added params and perl voodoo to support generating a second array of values, which is used by the Makefiles below to create and register arrays of value descriptions. * libgimpbase/gimpbasetypes.[ch]: added API to attach/retreive arrays of translatable strings to/from enum and flags types. Added structs GimpEnumDesc and GimpFlagsDesc for that purpose. * libgimpbase/gimputils.[ch]: changed existing enum utility functions, added new ones and added a symmetric API for flags. * app/base/Makefile.am * app/core/Makefile.am * app/display/Makefile.am * app/paint/Makefile.am * app/text/Makefile.am * app/tools/Makefile.am * app/widgets/Makefile.am * libgimp/Makefile.am * libgimpbase/Makefile.am: changed *-enums.c generation rules accordingly. * app/base/base-enums.c * app/core/core-enums.c * app/display/display-enums.c * app/paint/paint-enums.c * app/text/text-enums.c * app/tools/tools-enums.c * app/widgets/widgets-enums.c * libgimpbase/gimpbaseenums.c: regenerated. * app/widgets/gimpenumstore.c * app/widgets/gimpenumwidgets.c * app/widgets/gimptemplateeditor.c * libgimpwidgets/gimppreviewarea.c: follow the enum utility function API changes.
132 lines
3.1 KiB
C
132 lines
3.1 KiB
C
|
|
/* Generated data (by gimp-mkenums) */
|
|
|
|
#include "config.h"
|
|
#include <glib-object.h>
|
|
#include "libgimpbase/gimpbase.h"
|
|
#include "text-enums.h"
|
|
#include "gimp-intl.h"
|
|
|
|
/* enumerations from "./text-enums.h" */
|
|
GType
|
|
gimp_text_box_mode_get_type (void)
|
|
{
|
|
static const GEnumValue values[] =
|
|
{
|
|
{ GIMP_TEXT_BOX_DYNAMIC, "GIMP_TEXT_BOX_DYNAMIC", "dynamic" },
|
|
{ GIMP_TEXT_BOX_FIXED, "GIMP_TEXT_BOX_FIXED", "fixed" },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static const GimpEnumDesc descs[] =
|
|
{
|
|
{ GIMP_TEXT_BOX_DYNAMIC, "GIMP_TEXT_BOX_DYNAMIC", NULL },
|
|
{ GIMP_TEXT_BOX_FIXED, "GIMP_TEXT_BOX_FIXED", NULL },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static GType type = 0;
|
|
|
|
if (! type)
|
|
{
|
|
type = g_enum_register_static ("GimpTextBoxMode", values);
|
|
gimp_enum_set_value_descriptions (type, descs);
|
|
}
|
|
|
|
return type;
|
|
}
|
|
|
|
GType
|
|
gimp_text_direction_get_type (void)
|
|
{
|
|
static const GEnumValue values[] =
|
|
{
|
|
{ GIMP_TEXT_DIRECTION_LTR, "GIMP_TEXT_DIRECTION_LTR", "ltr" },
|
|
{ GIMP_TEXT_DIRECTION_RTL, "GIMP_TEXT_DIRECTION_RTL", "rtl" },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static const GimpEnumDesc descs[] =
|
|
{
|
|
{ GIMP_TEXT_DIRECTION_LTR, N_("From left to right"), NULL },
|
|
{ GIMP_TEXT_DIRECTION_RTL, N_("From right to left"), NULL },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static GType type = 0;
|
|
|
|
if (! type)
|
|
{
|
|
type = g_enum_register_static ("GimpTextDirection", values);
|
|
gimp_enum_set_value_descriptions (type, descs);
|
|
}
|
|
|
|
return type;
|
|
}
|
|
|
|
GType
|
|
gimp_text_justification_get_type (void)
|
|
{
|
|
static const GEnumValue values[] =
|
|
{
|
|
{ GIMP_TEXT_JUSTIFY_LEFT, "GIMP_TEXT_JUSTIFY_LEFT", "left" },
|
|
{ GIMP_TEXT_JUSTIFY_RIGHT, "GIMP_TEXT_JUSTIFY_RIGHT", "right" },
|
|
{ GIMP_TEXT_JUSTIFY_CENTER, "GIMP_TEXT_JUSTIFY_CENTER", "center" },
|
|
{ GIMP_TEXT_JUSTIFY_FILL, "GIMP_TEXT_JUSTIFY_FILL", "fill" },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static const GimpEnumDesc descs[] =
|
|
{
|
|
{ GIMP_TEXT_JUSTIFY_LEFT, N_("Left justified"), NULL },
|
|
{ GIMP_TEXT_JUSTIFY_RIGHT, N_("Right justified"), NULL },
|
|
{ GIMP_TEXT_JUSTIFY_CENTER, N_("Centered"), NULL },
|
|
{ GIMP_TEXT_JUSTIFY_FILL, N_("Filled"), NULL },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static GType type = 0;
|
|
|
|
if (! type)
|
|
{
|
|
type = g_enum_register_static ("GimpTextJustification", values);
|
|
gimp_enum_set_value_descriptions (type, descs);
|
|
}
|
|
|
|
return type;
|
|
}
|
|
|
|
GType
|
|
gimp_text_outline_get_type (void)
|
|
{
|
|
static const GEnumValue values[] =
|
|
{
|
|
{ GIMP_TEXT_OUTLINE_NONE, "GIMP_TEXT_OUTLINE_NONE", "none" },
|
|
{ GIMP_TEXT_OUTLINE_STROKE_ONLY, "GIMP_TEXT_OUTLINE_STROKE_ONLY", "stroke-only" },
|
|
{ GIMP_TEXT_OUTLINE_STROKE_FILL, "GIMP_TEXT_OUTLINE_STROKE_FILL", "stroke-fill" },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static const GimpEnumDesc descs[] =
|
|
{
|
|
{ GIMP_TEXT_OUTLINE_NONE, "GIMP_TEXT_OUTLINE_NONE", NULL },
|
|
{ GIMP_TEXT_OUTLINE_STROKE_ONLY, "GIMP_TEXT_OUTLINE_STROKE_ONLY", NULL },
|
|
{ GIMP_TEXT_OUTLINE_STROKE_FILL, "GIMP_TEXT_OUTLINE_STROKE_FILL", NULL },
|
|
{ 0, NULL, NULL }
|
|
};
|
|
|
|
static GType type = 0;
|
|
|
|
if (! type)
|
|
{
|
|
type = g_enum_register_static ("GimpTextOutline", values);
|
|
gimp_enum_set_value_descriptions (type, descs);
|
|
}
|
|
|
|
return type;
|
|
}
|
|
|
|
|
|
/* Generated data ends here */
|
|
|