gimpbasetypes

gimpbasetypes — Translation between gettext translation domain identifier and GType.

Synopsis

struct              GimpEnumDesc;
struct              GimpFlagsDesc;
void                gimp_type_set_translation_domain    (GType type,
                                                         const gchar *domain);
const gchar *       gimp_type_get_translation_domain    (GType type);
void                gimp_type_set_translation_context   (GType type,
                                                         const gchar *context);
const gchar *       gimp_type_get_translation_context   (GType type);
void                gimp_enum_set_value_descriptions    (GType enum_type,
                                                         const GimpEnumDesc *descriptions);
const GimpEnumDesc * gimp_enum_get_value_descriptions   (GType enum_type);
const GimpFlagsDesc * gimp_flags_get_value_descriptions (GType flags_type);
void                gimp_flags_set_value_descriptions   (GType flags_type,
                                                         const GimpFlagsDesc *descriptions);

Description

Translation between gettext translation domain identifier and GType.

Details

struct GimpEnumDesc

struct GimpEnumDesc {
  gint         value;
  const gchar *value_desc;
  const gchar *value_help;
};

This structure is used to register translatable descriptions and help texts for enum values. See gimp_enum_set_value_descriptions().

gint value;

An enum value.

const gchar *value_desc;

The value's description.

const gchar *value_help;

The value's help text.

struct GimpFlagsDesc

struct GimpFlagsDesc {
  guint        value;
  const gchar *value_desc;
  const gchar *value_help;
};

This structure is used to register translatable descriptions and help texts for flag values. See gimp_flags_set_value_descriptions().

guint value;

A flag value.

const gchar *value_desc;

The value's description.

const gchar *value_help;

The value's help text.

gimp_type_set_translation_domain ()

void                gimp_type_set_translation_domain    (GType type,
                                                         const gchar *domain);

This function attaches a constant string as a gettext translation domain identifier to a GType. The only purpose of this function is to use it when registering a G_TYPE_ENUM with translatable value names.

type :

a GType

domain :

a constant string that identifies a translation domain or NULL

Since GIMP 2.2


gimp_type_get_translation_domain ()

const gchar *       gimp_type_get_translation_domain    (GType type);

Retrieves the gettext translation domain identifier that has been previously set using gimp_type_set_translation_domain(). You should not need to use this function directly, use gimp_enum_get_value() or gimp_enum_value_get_desc() instead.

type :

a GType

Returns :

the translation domain associated with type or NULL if no domain was set

Since GIMP 2.2


gimp_type_set_translation_context ()

void                gimp_type_set_translation_context   (GType type,
                                                         const gchar *context);

This function attaches a constant string as a translation context to a GType. The only purpose of this function is to use it when registering a G_TYPE_ENUM with translatable value names.

type :

a GType

context :

a constant string that identifies a translation context or NULL

Since GIMP 2.8


gimp_type_get_translation_context ()

const gchar *       gimp_type_get_translation_context   (GType type);

Retrieves the translation context that has been previously set using gimp_type_set_translation_context(). You should not need to use this function directly, use gimp_enum_get_value() or gimp_enum_value_get_desc() instead.

type :

a GType

Returns :

the translation context associated with type or NULL if no context was set

Since GIMP 2.8


gimp_enum_set_value_descriptions ()

void                gimp_enum_set_value_descriptions    (GType enum_type,
                                                         const GimpEnumDesc *descriptions);

Sets the array of human readable and translatable descriptions and help texts for enum values.

enum_type :

a GType

descriptions :

a NULL terminated constant static array of GimpEnumDesc

Since GIMP 2.2


gimp_enum_get_value_descriptions ()

const GimpEnumDesc * gimp_enum_get_value_descriptions   (GType enum_type);

Retreives the array of human readable and translatable descriptions and help texts for enum values.

enum_type :

a GType

Returns :

a NULL terminated constant array of GimpEnumDesc

Since GIMP 2.2


gimp_flags_get_value_descriptions ()

const GimpFlagsDesc * gimp_flags_get_value_descriptions (GType flags_type);

Retreives the array of human readable and translatable descriptions and help texts for flags values.

flags_type :

a GType

Returns :

a NULL terminated constant array of GimpFlagsDesc

Since GIMP 2.2


gimp_flags_set_value_descriptions ()

void                gimp_flags_set_value_descriptions   (GType flags_type,
                                                         const GimpFlagsDesc *descriptions);

Sets the array of human readable and translatable descriptions and help texts for flags values.

flags_type :

a GType

descriptions :

a NULL terminated constant static array of GimpFlagsDesc

Since GIMP 2.2