diff options
-rw-r--r-- | build-aux/mm-enums-template.c | 40 | ||||
-rw-r--r-- | build-aux/mm-enums-template.h | 10 | ||||
-rw-r--r-- | docs/reference/libmm-glib/libmm-glib-docs.xml | 5 | ||||
-rw-r--r-- | docs/reference/libmm-glib/libmm-glib-sections.txt | 71 | ||||
-rw-r--r-- | docs/reference/libmm-glib/libmm-glib.types | 23 |
5 files changed, 94 insertions, 55 deletions
diff --git a/build-aux/mm-enums-template.c b/build-aux/mm-enums-template.c index 7f12c2c5..15f3a813 100644 --- a/build-aux/mm-enums-template.c +++ b/build-aux/mm-enums-template.c @@ -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 */ - -/* 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 +#endif /* __MM_IS_ENUM_ */ + +/** + * @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 ***/ diff --git a/build-aux/mm-enums-template.h b/build-aux/mm-enums-template.h index 13db2a6d..652c53dc 100644 --- a/build-aux/mm-enums-template.h +++ b/build-aux/mm-enums-template.h @@ -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 diff --git a/docs/reference/libmm-glib/libmm-glib-docs.xml b/docs/reference/libmm-glib/libmm-glib-docs.xml index 019ac204..431fcd04 100644 --- a/docs/reference/libmm-glib/libmm-glib-docs.xml +++ b/docs/reference/libmm-glib/libmm-glib-docs.xml @@ -52,6 +52,11 @@ <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"/> </chapter> diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt index a9a3d946..7fff592a 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -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_bearer_ip_family_get_string +mm_modem_capability_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_band_get_string +mm_modem_3gpp_registration_state_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_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_activation_state_get_string 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_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_lock_get_string -mm_modem_mode_build_string_from_mask -mm_modem_mode_get_string 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 diff --git a/docs/reference/libmm-glib/libmm-glib.types b/docs/reference/libmm-glib/libmm-glib.types index b85c805c..bb78f909 100644 --- a/docs/reference/libmm-glib/libmm-glib.types +++ b/docs/reference/libmm-glib/libmm-glib.types @@ -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
\ No newline at end of file |