mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
ec6056e3ab
The glib-mkenums program allows generating code to handle enums/flags with very different purposes. One of its purposes could be generating per-enum/flag methods to be exposed in a library API, and while doing that, it would be nice to have a way to specify in which API version the enum/flag was introduced, so that the same version could be shown in the generated API methods. E.g. From the following code: /** * QmiWmsMessageProtocol: * @QMI_WMS_MESSAGE_PROTOCOL_CDMA: CDMA. * @QMI_WMS_MESSAGE_PROTOCOL_WCDMA: WCDMA. * * Type of message protocol. * * Since: 1.0 */ typedef enum { /*< since=1.0 >*/ QMI_WMS_MESSAGE_PROTOCOL_CDMA = 0x00, QMI_WMS_MESSAGE_PROTOCOL_WCDMA = 0x01 } QmiWmsMessageProtocol; The template would allow us to generate a method documented like this, including the Since tag with the value given in the mkenums 'since' tag. /** * qmi_wms_message_protocol_get_string: * @val: a QmiWmsMessageProtocol. * * Gets the nickname string for the #QmiWmsMessageProtocol specified at @val. * * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value. * Since: 1.0 */ const gchar *qmi_wms_message_protocol_get_string (QmiWmsMessageProtocol val); Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> |
||
---|---|---|
.. | ||
images | ||
xml | ||
glib-genmarshal.xml | ||
glib-mkenums.xml | ||
gobject-docs.xml | ||
gobject-overrides.txt | ||
gobject-query.xml | ||
gobject-sections.txt | ||
meson.build | ||
tut_gobject.xml | ||
tut_gsignal.xml | ||
tut_gtype.xml | ||
tut_howto.xml | ||
tut_intro.xml | ||
tut_tools.xml | ||
version.xml.in |