docs: include documentation for enum/flags helpers

This commit is contained in:
Aleksander Morgado
2012-10-04 10:17:13 +02:00
parent 3228ca10be
commit 8bdf70e1c2
5 changed files with 97 additions and 58 deletions
+24 -14
View File
@@ -17,9 +17,9 @@ static const G@Type@Value @enum_name@_values[] = {
};
/* Define type-specific symbols */
#undef IS_ENUM
#undef IS_FLAGS
#define IS_@TYPE@
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_@TYPE@__
GType
@enum_name@_get_type (void)
@@ -36,10 +36,15 @@ GType
return g_define_type_id__volatile;
}
/* Enum-specific method to get the value as a string.
* We get the nick of the GEnumValue. Note that this will be
* valid even if the GEnumClass is not referenced anywhere. */
#if defined IS_ENUM
/**
* @enum_name@_get_string:
* @val: a @EnumName@.
*
* Gets the nickname string for the #@EnumName@ specified at @val.
*
* Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
*/
#if defined __MM_IS_ENUM__
const gchar *
@enum_name@_get_string (@EnumName@ val)
{
@@ -52,13 +57,18 @@ const gchar *
return NULL;
}
#endif /* IS_ENUM */
#endif /* __MM_IS_ENUM_ */
/* Flags-specific method to build a string with the given mask.
* We get a comma separated list of the nicks of the GFlagsValues.
* Note that this will be valid even if the GFlagsClass is not referenced
* anywhere. */
#if defined IS_FLAGS
/**
* @enum_name@_build_string_from_mask:
* @mask: bitmask of @EnumName@ values.
*
* Builds a string containing a comma-separated list of nicknames for
* each #@EnumName@ in @mask.
*
* Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
*/
#if defined __MM_IS_FLAGS__
gchar *
@enum_name@_build_string_from_mask (@EnumName@ mask)
{
@@ -96,7 +106,7 @@ gchar *
return (str ? g_string_free (str, FALSE) : NULL);
}
#endif /* IS_FLAGS */
#endif /* __MM_IS_FLAGS__ */
/*** END value-tail ***/
+5 -5
View File
@@ -15,15 +15,15 @@ GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/* Define type-specific symbols */
#undef IS_ENUM
#undef IS_FLAGS
#define IS_@TYPE@
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_@TYPE@__
#if defined IS_ENUM
#if defined __MM_IS_ENUM__
const gchar *@enum_name@_get_string (@EnumName@ val);
#endif
#if defined IS_FLAGS
#if defined __MM_IS_FLAGS__
gchar *@enum_name@_build_string_from_mask (@EnumName@ mask);
#endif
@@ -51,6 +51,11 @@
<part>
<title>High level API</title>
<chapter>
<title>Common enums and flags helpers</title>
<xi:include href="xml/mm-enums-types.xml"/>
</chapter>
<chapter>
<title>The Manager object</title>
<xi:include href="xml/mm-manager.xml"/>
@@ -905,54 +905,54 @@ mm_sms_properties_get_type
<SECTION>
<FILE>mm-enums-types</FILE>
IS_ENUM
IS_FLAGS
mm_bearer_ip_family_build_string_from_mask
mm_bearer_ip_family_get_string
mm_bearer_ip_method_build_string_from_mask
<TITLE>Flags and Enumerations</TITLE>
mm_bearer_ip_method_get_string
mm_firmware_image_type_build_string_from_mask
mm_firmware_image_type_get_string
mm_modem_3gpp_facility_build_string_from_mask
mm_modem_3gpp_facility_get_string
mm_modem_3gpp_network_availability_build_string_from_mask
mm_modem_3gpp_network_availability_get_string
mm_modem_3gpp_registration_state_build_string_from_mask
mm_modem_3gpp_registration_state_get_string
mm_modem_3gpp_ussd_session_state_build_string_from_mask
mm_modem_3gpp_ussd_session_state_get_string
mm_modem_access_technology_build_string_from_mask
mm_modem_access_technology_get_string
mm_modem_band_build_string_from_mask
mm_modem_band_get_string
mm_bearer_ip_family_get_string
mm_modem_capability_build_string_from_mask
mm_modem_capability_get_string
mm_modem_cdma_activation_state_build_string_from_mask
mm_modem_cdma_activation_state_get_string
mm_modem_cdma_registration_state_build_string_from_mask
mm_modem_cdma_registration_state_get_string
mm_modem_cdma_rm_protocol_build_string_from_mask
mm_modem_cdma_rm_protocol_get_string
mm_modem_contacts_storage_build_string_from_mask
mm_modem_contacts_storage_get_string
mm_modem_location_source_build_string_from_mask
mm_modem_location_source_get_string
mm_modem_lock_build_string_from_mask
mm_modem_state_get_string
mm_modem_state_change_reason_get_string
mm_modem_lock_get_string
mm_modem_access_technology_build_string_from_mask
mm_modem_mode_build_string_from_mask
mm_modem_mode_get_string
mm_modem_band_get_string
mm_modem_3gpp_registration_state_get_string
mm_modem_3gpp_facility_build_string_from_mask
mm_modem_3gpp_network_availability_get_string
mm_modem_3gpp_ussd_session_state_get_string
mm_modem_cdma_registration_state_get_string
mm_modem_cdma_activation_state_get_string
mm_modem_cdma_rm_protocol_get_string
mm_modem_location_source_build_string_from_mask
mm_modem_contacts_storage_get_string
mm_sms_pdu_type_get_string
mm_sms_state_get_string
mm_sms_delivery_state_get_string
mm_sms_storage_get_string
mm_firmware_image_type_get_string
<SUBSECTION Private>
mm_modem_capability_get_string
mm_modem_lock_build_string_from_mask
mm_modem_state_build_string_from_mask
mm_modem_state_change_reason_build_string_from_mask
mm_modem_state_change_reason_get_string
mm_modem_state_get_string
mm_sms_delivery_state_build_string_from_mask
mm_sms_delivery_state_get_string
mm_modem_access_technology_get_string
mm_modem_mode_get_string
mm_modem_band_build_string_from_mask
mm_sms_pdu_type_build_string_from_mask
mm_sms_pdu_type_get_string
mm_sms_state_build_string_from_mask
mm_sms_state_get_string
mm_sms_delivery_state_build_string_from_mask
mm_sms_storage_build_string_from_mask
mm_sms_storage_get_string
mm_modem_location_source_get_string
mm_modem_contacts_storage_build_string_from_mask
mm_bearer_ip_family_build_string_from_mask
mm_bearer_ip_method_build_string_from_mask
mm_modem_cdma_registration_state_build_string_from_mask
mm_modem_cdma_activation_state_build_string_from_mask
mm_modem_cdma_rm_protocol_build_string_from_mask
mm_modem_3gpp_registration_state_build_string_from_mask
mm_modem_3gpp_facility_get_string
mm_modem_3gpp_network_availability_build_string_from_mask
mm_modem_3gpp_ussd_session_state_build_string_from_mask
mm_firmware_image_type_build_string_from_mask
<SUBSECTION Standard>
MM_TYPE_BEARER_IP_FAMILY
MM_TYPE_BEARER_IP_METHOD
@@ -1004,6 +1004,7 @@ mm_sms_storage_get_type
<SECTION>
<FILE>mm-errors-types</FILE>
<SUBSECTION Private>
mm_cdma_activation_error_quark
mm_connection_error_quark
mm_core_error_quark
@@ -98,3 +98,26 @@ mm_sms_properties_get_type
mm_sms_state_get_type
mm_sms_storage_get_type
mm_unlock_retries_get_type
mm_bearer_ip_family_get_type
mm_bearer_ip_method_get_type
mm_firmware_image_type_get_type
mm_modem_3gpp_facility_get_type
mm_modem_3gpp_network_availability_get_type
mm_modem_3gpp_registration_state_get_type
mm_modem_3gpp_ussd_session_state_get_type
mm_modem_access_technology_get_type
mm_modem_band_get_type
mm_modem_capability_get_type
mm_modem_cdma_activation_state_get_type
mm_modem_cdma_registration_state_get_type
mm_modem_cdma_rm_protocol_get_type
mm_modem_contacts_storage_get_type
mm_modem_location_source_get_type
mm_modem_lock_get_type
mm_modem_mode_get_type
mm_modem_state_change_reason_get_type
mm_modem_state_get_type
mm_sms_delivery_state_get_type
mm_sms_pdu_type_get_type
mm_sms_state_get_type
mm_sms_storage_get_type