### Iterating children with gweather_location_next_child Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.next_child.html Example usage of gweather_location_next_child in a while loop to iterate over all children of a location. The child variable is initialized to NULL and each call returns the next child, with the reference taken by the function. ```c g_autoptr (GWeatherLocation) child = NULL; while ((child = gweather_location_next_child (location, child))) { // Do something with child } ``` -------------------------------- ### gweather_location_next_child Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.next_child.html Iterates over the children of a location. Pass NULL to get the first child, and any child to get the next one. The reference to child is taken, and the caller owns the returned data. ```APIDOC ## gweather_location_next_child ### Description Allows iterating all children of a location. Pass `NULL` to get the first child, and any child to get the next one. Note that the reference to `child` is taken, meaning iterating all children is as simple as: ``` g_autoptr (GWeatherLocation) child = NULL; while ((child = gweather_location_next_child (location, child))) { // Do something with child } ``` ### Declaration ```c GWeatherLocation* gweather_location_next_child ( GWeatherLocation* loc, GWeatherLocation* child ) ``` ### Parameters - `child` (GWeatherLocation) - The next child. The argument can be `NULL`. The instance takes ownership of the data, and is responsible for freeing it. ### Return Value - Type: `GWeatherLocation` - The next child, if one exists. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The return value can be `NULL`. ``` -------------------------------- ### gweather_location_get_english_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets the location's name. ```APIDOC ## gweather_location_get_english_name ### Description Gets the location’s name. ### Method Instance method ### Parameters None. ### Returns The English name of the location. ``` -------------------------------- ### gweather_info_get_dew: Get dew point string Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_dew.html Returns the dew point as a newly-allocated string. The caller owns the returned data and must free it, and the value is a NUL terminated UTF-8 string. No description is available for this function. ```c char* gweather_info_get_dew ( GWeatherInfo* info ) ``` -------------------------------- ### Replacing GWeatherTimezone with GTimeZone: new code Source: https://gnome.pages.gitlab.gnome.org/libgweather/migrating-3to4.html New code using GTimeZone and g_time_zone_find_interval() to get offsets relative to the current time. Hoist the 'now' computation outside loops to ensure consistent intervals. ```c GTimeZone *tz_a = gweather_location_get_timezone (location_a); GTimeZone *tz_b = gweather_location_get_timezone (location_b); // Find the interval relative to the current time; if you are performing // the offset comparison in a loop, for instance to sort a list of time // zones, you may want to hoist the computation of the "now" outside the // loop, to ensure that the intervals are all relative to the same time g_autoptr (GDateTime) dt = g_date_time_new_now_local (); gint64 now = g_date_time_to_unix (dt); int interval_a = g_time_zone_find_interval (tz_a, G_TIME_TYPE_STANDARD, now); int interval_b = g_time_zone_find_interval (tz_b, G_TIME_TYPE_STANDARD, now); // Retrieve the offset for the given interval int offset_a = g_time_zone_get_offset (tz_a, interval_a); int offset_b = g_time_zone_get_offset (tz_b, interval_b); ``` -------------------------------- ### gweather_location_get_level Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets loc's level, from GWEATHER_LOCATION_WORLD to GWEATHER_LOCATION_WEATHER_STATION. ```APIDOC ## gweather_location_get_level ### Description Gets `loc`‘s level, from `GWEATHER_LOCATION_WORLD`, to `GWEATHER_LOCATION_WEATHER_STATION`. ### Method Instance method ### Parameters None. ### Returns The level of the location. ``` -------------------------------- ### gweather_info_new (GWeatherLocation* location) Source: https://gnome.pages.gitlab.gnome.org/libgweather/ctor.Info.new.html Builds a new GWeatherInfo that will provide weather information about the given location. It accepts a GWeatherLocation, which can be NULL, and returns a new GWeatherInfo instance owned by the caller. ```APIDOC ## gweather_info_new ### Description Builds a new `GWeatherInfo` that will provide weather information about the given location. In order to retrieve the weather information, you will need to enable the desired providers and then call `gweather_info_update()`. If you want to be notified of the completion of the weather information update, you should connect to the `GWeatherInfo::updated` signal before updating the `GWeatherInfo` instance. ### Syntax ```c GWeatherInfo* gweather_info_new ( GWeatherLocation* location ); ``` ### Parameters - **location** (GWeatherLocation*) - The desired location. The argument can be `NULL`. The data is owned by the caller of the function. ### Return Value - **GWeatherInfo*** - A new weather information instance. The caller of the function takes ownership of the data, and is responsible for freeing it. ``` -------------------------------- ### Iterating child locations: get_children() vs next_child() Source: https://gnome.pages.gitlab.gnome.org/libgweather/migrating-3to4.html Shows the old and new ways to iterate over child locations. The new method gweather_location_next_child() consumes the reference of the iterated child; use g_object_ref() if you need to keep a reference. ```c /* Iterating using get_children() */ GWeatherLocation **children = gweather_location_get_children (location); for (guint i = 0; children[i] != NULL; i++) { GWeatherLocation *iter = children[i]; // ... } /* Iterating using next_child() */ g_autoptr (GWeatherLocation) iter = NULL; while ((iter = gweather_location_next_child (location, iter)) != NULL) { // ... } ``` -------------------------------- ### gweather_location_get_coords Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets loc's coordinates. ```APIDOC ## gweather_location_get_coords ### Description Gets `loc`‘s coordinates. ### Method Instance method ### Parameters - **lat** (double*) - Required - Return location for latitude. - **lon** (double*) - Required - Return location for longitude. ### Returns TRUE if coordinates are available, FALSE otherwise. ``` -------------------------------- ### gweather_conditions_to_string_full Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Conditions.to_string_full.html Documentation for the gweather_conditions_to_string_full function, which converts weather conditions to a string. ```APIDOC ## gweather_conditions_to_string_full ### Description Converts a GWeatherConditions object to a string representation using the specified format options. ### Declaration ```c const char* gweather_conditions_to_string_full ( GWeatherConditions* conditions, GWeatherFormatOptions options ) ``` ### Parameters - **conditions** (GWeatherConditions*) - The conditions object to convert. - **options** (GWeatherFormatOptions) - Format options controlling the output. ### Return Value - **const char*** - A NUL-terminated UTF-8 string. The returned data is owned by the instance. ``` -------------------------------- ### char* gweather_info_get_conditions (GWeatherInfo* info) Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_conditions.html Retrieves the current weather conditions as a string. The returned string is owned by the caller and must be freed. ```APIDOC ## char* gweather_info_get_conditions (GWeatherInfo* info) ### Description No description available. ### Method GET ### Endpoint Not applicable (C library function) ### Parameters #### Parameters - **info** (GWeatherInfo*) - Required - The GWeatherInfo object to query. ### Return Value - **char*** - No description available. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The value is a NUL terminated UTF-8 string. ### Example ```c char* conditions = gweather_info_get_conditions(info); // use conditions... g_free(conditions); ``` ``` -------------------------------- ### gweather_location_get_parent Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_parent.html Gets the parent of a GWeatherLocation object. ```APIDOC ## gweather_location_get_parent ### Description Gets the location's parent. ### Declaration ```c GWeatherLocation* gweather_location_get_parent ( GWeatherLocation* loc ) ``` ### Parameters - **loc** (GWeatherLocation*) - The location whose parent is to be retrieved. ### Return Value - **GWeatherLocation*** - The location's parent. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The return value can be `NULL`. ``` -------------------------------- ### gweather_info_get_temp_summary Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_temp_summary.html Documentation for the gweather_info_get_temp_summary function, which returns a temperature summary string. ```APIDOC ## gweather_info_get_temp_summary ### Description No description available. ### Declaration ```c char* gweather_info_get_temp_summary ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object. ### Return Value - **Type:** `char*` - No description available. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_location_get_timezone Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets the timezone associated with loc, if known. ```APIDOC ## gweather_location_get_timezone ### Description Gets the timezone associated with `loc`, if known. ### Method Instance method ### Parameters None. ### Returns The timezone, or NULL if unknown. ``` -------------------------------- ### gweather_info_next_sun_event Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the next sun event (sunrise or sunset). ```APIDOC ## gweather_info_next_sun_event ### Description No description available. ### Method Instance method ### Signature `gboolean gweather_info_next_sun_event (GWeatherInfo *info, GWeatherTime *result);` ``` -------------------------------- ### gweather_location_get_english_sort_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets the location's name, in a representation useful for comparisons. ```APIDOC ## gweather_location_get_english_sort_name ### Description Gets the location’s name, in a representation useful for comparisons. ### Method Instance method ### Parameters None. ### Returns The English sort name. ``` -------------------------------- ### gweather_info_get_sunrise Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_sunrise.html This code snippet documents the gweather_info_get_sunrise function, which returns a string representing the sunrise time for a given GWeatherInfo object. ```APIDOC ## gweather_info_get_sunrise ### Description No description available. ### Method Function ### Signature ```c char* gweather_info_get_sunrise (GWeatherInfo* info) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object. ### Return Value - **char*** - No description available. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_location_get_country Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets the ISO 3166 country code of the given location. ```APIDOC ## gweather_location_get_country ### Description Gets the ISO 3166 country code of the given location. ### Method Instance method ### Parameters None. ### Returns The country code, or NULL if not available. ``` -------------------------------- ### gweather_location_get_sort_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Gets the location's name, localized into the current language, in a representation useful for comparisons. ```APIDOC ## gweather_location_get_sort_name ### Description Gets the location’s name, localized into the current language, in a representation useful for comparisons. ### Method Instance method ### Parameters None. ### Returns The localized sort name. ``` -------------------------------- ### GWeatherInfo:contact-info Source: https://gnome.pages.gitlab.gnome.org/libgweather/property.Info.contact-info.html Property documentation for GWeatherInfo:contact-info, including getter and setter methods. ```APIDOC ## Property: GWeatherInfo:contact-info ### Description An email address or any other contact form URL. Weather providers require this information. ### Declaration ``` property contact-info: utf8 [ read, write ] ``` ### Type `gchar*` ### Default Value `NULL` ### Accessor Methods - **Getter**: `gweather_info_get_contact_info()` - **Setter**: `gweather_info_set_contact_info()` ### Flags - **Readable**: yes - **Writable**: yes - **Construct**: no - **Construct only**: no ``` -------------------------------- ### gweather_info_get_weather_summary Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_weather_summary.html Returns a summary for current weather conditions. The caller takes ownership of the returned string and must free it. ```APIDOC ## gweather_info_get_weather_summary ### Description Returns a summary for current weather conditions. The caller takes ownership of the returned data and is responsible for freeing it. ### Declaration ```c char* gweather_info_get_weather_summary ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object. ### Return Value - **char*** - A summary for current weather conditions. The value is a NUL terminated UTF-8 string. The caller of the method takes ownership of the returned data, and is responsible for freeing it. ``` -------------------------------- ### gweather_location_get_sort_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_sort_name.html Gets the location's sort name, which is the name normalized and case-folded for comparison purposes. ```APIDOC ## gweather_location_get_sort_name ### Description Gets the location's name, localized into the current language, in a representation useful for comparisons. The "sort name" is the location's name after having `g_utf8_normalize()` (with `G_NORMALIZE_ALL`) and `g_utf8_casefold()` called on it. You can use this to sort locations, or to compare user input against a location name. ### Declaration ```c const char* gweather_location_get_sort_name ( GWeatherLocation* loc ) ``` ### Parameters #### loc (GWeatherLocation*) - Required - The location whose sort name is to be retrieved. ### Return Value - **Type**: `const char*` - The sort name of the location. The returned data is owned by the instance. The return value can be `NULL`. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### GWeatherFormatOptions Source: https://gnome.pages.gitlab.gnome.org/libgweather/flags.FormatOptions.html Flags enumeration for format options used by gweather_*_to_string_full() functions. ```APIDOC ## GWeatherFormatOptions ### Description Format options to influence the text returned by the `gweather_*_to_string_full()` functions. ### Members - **GWEATHER_FORMAT_OPTION_DEFAULT** (0) - The default string format. Available since: 4.0 - **GWEATHER_FORMAT_OPTION_SENTENCE_CAPITALIZATION** (1) - Capitalize as if the string was starting a sentence. Available since: 4.0 - **GWEATHER_FORMAT_OPTION_NO_CAPITALIZATION** (2) - Capitalize as if the string was appearing within a sentence. Available since: 4.0 ``` -------------------------------- ### gweather_location_get_timezone Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_timezone.html Gets the timezone associated with a GWeatherLocation, if known. Returns a GTimeZone pointer owned by the instance, or NULL if unknown. ```APIDOC ## gweather_location_get_timezone ### Description Gets the timezone associated with `loc`, if known. ### Method GWeatherLocationget_timezone ### Parameters #### Parameters - **loc** (GWeatherLocation*) - Required - The location whose timezone is to be retrieved. ### Return Value - **GTimeZone*** - The location's timezone. The returned data is owned by the instance. The return value can be `NULL`. ### Example ```c GTimeZone* tz = gweather_location_get_timezone(loc); ``` ``` -------------------------------- ### gweather_info_get_sunset Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_sunset.html Gets the sunset time associated with the GWeatherInfo. Returns a NUL-terminated UTF-8 string that the caller must free. ```APIDOC ## gweather_info_get_sunset(GWeatherInfo* info) ### Description Gets the sunset time for the specified GWeatherInfo object. The returned string is a NUL-terminated UTF-8 string representing the sunset time. ### Method Function ### Endpoint GWeatherInfo.get_sunset ### Parameters #### Parameters - **info** (GWeatherInfo*) - Required - A pointer to the GWeatherInfo object. ### Return Value - **char*** - A NUL-terminated UTF-8 string containing the sunset time. The caller is responsible for freeing the returned data. ### Ownership The caller of the method takes ownership of the returned data, and is responsible for freeing it. ``` -------------------------------- ### gweather_info_get_forecast_list Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_forecast_list.html This function returns a list of GWeatherInfo objects representing the forecast for the given GWeatherInfo. The returned list is owned by the info object and remains valid as long as the info object exists. ```APIDOC ## gweather_info_get_forecast_list ### Description No description available. ### Declaration ```c GSList* gweather_info_get_forecast_list ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object for which to retrieve the forecast list. ### Return Value - **Type:** A list of `GWeatherInfo*` - List of GWeatherInfo* objects for the forecast. The list is owned by the 'info' object thus is alive as long as the 'info'. The 'update' property is the date/time when the forecast info is used for. - The returned data is owned by the instance. ``` -------------------------------- ### gweather_location_get_timezones Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_timezones.html Gets an array of all timezones associated with any location under the given location. The returned array is NULL-terminated and must be freed with gweather_location_free_timezones(). ```APIDOC ## gweather_location_get_timezones ### Description Gets an array of all timezones associated with any location under `loc`. Use `gweather_location_free_timezones()` to free this array. ### Declaration ```c GTimeZone** gweather_location_get_timezones ( GWeatherLocation* loc ) ``` ### Parameters - **loc** (GWeatherLocation*) - The location for which to get timezones. ### Return Value - **Type:** An array of `GTimeZone*` - The timezones associated with the location. - The array is `NULL`-terminated. - The caller of the method takes ownership of the returned data, and is responsible for freeing it. ``` -------------------------------- ### GWeatherFilterFunc Source: https://gnome.pages.gitlab.gnome.org/libgweather/callback.FilterFunc.html Documentation for the GWeatherFilterFunc callback function type. ```APIDOC ## GWeatherFilterFunc ### Description A filter function for locations. It is used to determine whether a location should be considered during a search. ### Declaration ```c gboolean (* GWeatherFilterFunc) ( GWeatherLocation* location, gpointer user_data ) ``` ### Parameters - **location** (GWeatherLocation*) - The location to check. The data is owned by the caller of the function. - **user_data** (gpointer) - Data passed to `gweather_location_find_nearest_city_full()`. The argument can be `NULL`. The data is owned by the caller of the function. ### Return Value - **gboolean** - `FALSE` if the location should be skipped, and `TRUE` otherwise. ``` -------------------------------- ### gweather_location_get_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_name.html Gets the location's name, localized into the current language. The returned string is owned by the instance and may be NULL. ```APIDOC ## gweather_location_get_name ### Description Gets the location's name, localized into the current language. ### Declaration ```c const char* gweather_location_get_name ( GWeatherLocation* loc ) ``` ### Parameters - **loc** (GWeatherLocation*) - The location whose name to get. ### Return Value - **Type:** `const char*` - The location's name. The returned data is owned by the instance. The return value can be `NULL`. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_info_get_conditions Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the current weather conditions. ```APIDOC ## gweather_info_get_conditions ### Description No description available. ### Method Instance method ### Signature `GWeatherConditions gweather_info_get_conditions (GWeatherInfo *info);` ``` -------------------------------- ### gweather_info_get_visibility Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the visibility. ```APIDOC ## gweather_info_get_visibility ### Description No description available. ### Method Instance method ### Signature `double gweather_info_get_visibility (GWeatherInfo *info);` ``` -------------------------------- ### gweather_location_get_timezone_str Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_timezone_str.html Gets the timezone associated with the given GWeatherLocation object, if known, as a string. The returned string is owned by the instance and may be NULL. ```APIDOC ## gweather_location_get_timezone_str ### Description Gets the timezone associated with `loc`, if known, as a string. ### Declaration ```c const char* gweather_location_get_timezone_str ( GWeatherLocation* loc ) ``` ### Parameters - **loc** (GWeatherLocation*) - The location for which to get the timezone. ### Return Value - **Type:** const char* - The location's timezone as a string. - The returned data is owned by the instance. - The return value can be NULL. - The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_temperature_unit_to_real Source: https://gnome.pages.gitlab.gnome.org/libgweather/enum.TemperatureUnit.html Resolves a GWeatherTemperatureUnit into a real temperature unit, potentially considering locale defaults. ```APIDOC ## gweather_temperature_unit_to_real ### Description Resolves `unit` into a real temperature unit, potentially considering locale defaults. ### Parameters - **unit** (GWeatherTemperatureUnit) - The temperature unit to resolve. ### Returns A real temperature unit, potentially considering locale defaults. ``` -------------------------------- ### gweather_info_get_value_conditions Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_value_conditions.html Fills out phenomenon and qualifier with current weather conditions. Returns TRUE if the output arguments are valid, FALSE otherwise. ```APIDOC ## gweather_info_get_value_conditions ### Description Fills out `phenomenon` and `qualifier` with current weather conditions. ### Method Function ### Signature ```c gboolean gweather_info_get_value_conditions ( GWeatherInfo* info, GWeatherConditionPhenomenon* phenomenon, GWeatherConditionQualifier* qualifier ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object to query. - **phenomenon** (GWeatherConditionPhenomenon*) - A location for a `GWeatherConditionPhenomenon`. The argument will be set by the function. The caller of the method takes ownership of the returned data, and is responsible for freeing it. - **qualifier** (GWeatherConditionQualifier*) - A location for a `GWeatherConditionQualifier`. The argument will be set by the function. The caller of the method takes ownership of the returned data, and is responsible for freeing it. ### Return Value - **gboolean** - TRUE if out arguments are valid, FALSE otherwise. ``` -------------------------------- ### gweather_info_get_pressure Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the atmospheric pressure. ```APIDOC ## gweather_info_get_pressure ### Description No description available. ### Method Instance method ### Signature `double gweather_info_get_pressure (GWeatherInfo *info);` ``` -------------------------------- ### gweather_location_get_english_sort_name Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.get_english_sort_name.html Gets the location's name in a representation useful for comparisons. The sort name is the location's name after having g_utf8_normalize() (with G_NORMALIZE_ALL) and g_utf8_casefold() called on it. You can use this to sort locations, or to compare user input against a location name. ```APIDOC ## gweather_location_get_english_sort_name ### Description Gets the location's name, in a representation useful for comparisons. The “sort name” is the location’s name after having `g_utf8_normalize()` (with `G_NORMALIZE_ALL`) and `g_utf8_casefold()` called on it. You can use this to sort locations, or to comparing user input against a location name. ### Declaration ```c const char* gweather_location_get_english_sort_name ( GWeatherLocation* loc ) ``` ### Parameters - **loc** (GWeatherLocation*) - The location to get the sort name for. ### Return Value - **Type:** `const char*` - The sort name of the location. The returned data is owned by the instance. The return value can be `NULL`. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_info_get_contact_info Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_contact_info.html Retrieves the contact information of the application fetching the weather. The returned string is owned by the instance and is a NUL terminated UTF-8 string. ```APIDOC ## gweather_info_get_contact_info ### Description Get the contact information of the application fetching the weather. This corresponds to the `GWeather.Info:contact-info` property. ### Method GET ### Endpoint `gweather_info_get_contact_info` ### Parameters #### Path Parameters - **info** (GWeatherInfo*) - Required - The GWeatherInfo instance to query. ### Return Value - **const char*** - The contact information. The returned data is owned by the instance. The value is a NUL terminated UTF-8 string. ### Response Example ```c const char* contact_info = gweather_info_get_contact_info(info); ``` ``` -------------------------------- ### GWeatherLocation.next_child declaration Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.next_child.html The function declaration for gweather_location_next_child, showing the parameters and return type. ```c GWeatherLocation* gweather_location_next_child ( GWeatherLocation* loc, GWeatherLocation* child ) ``` -------------------------------- ### gweather_info_get_enabled_providers Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Returns the bitmask of enabled weather providers. ```APIDOC ## gweather_info_get_enabled_providers ### Description Gets the bitmask of enabled `GWeatherProvider` weather providers. ### Method Instance method ### Signature `GWeatherProvider gweather_info_get_enabled_providers (GWeatherInfo *info);` ``` -------------------------------- ### GWeatherInfo:enabled-providers Source: https://gnome.pages.gitlab.gnome.org/libgweather/property.Info.enabled-providers.html Describes the enabled-providers property, including getter and setter methods. ```APIDOC ## GWeatherInfo:enabled-providers ### Description The enabled weather providers. ### Declaration property enabled-providers: GWeather.Provider [ read, write ] ### Type GWeather.Provider ### Default Value GWEATHER_PROVIDER_NONE ### Getter Method gweather_info_get_enabled_providers() ### Setter Method gweather_info_set_enabled_providers() ### Flags - Readable: yes - Writable: yes - Construct: no - Construct only: no ``` -------------------------------- ### gweather_info_get_attribution Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_attribution.html Retrieves the attribution text required by the weather service. The returned string is owned by the instance and must not be freed. ```APIDOC ## gweather_info_get_attribution ### Description Some weather services require the application showing the data to include an attribution text, possibly including links to the service website. This must be shown prominently together with the data. ### Method Function ### Signature ```c const char* gweather_info_get_attribution ( GWeatherInfo* info ) ``` ### Parameters #### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object to query. ### Return Value - **Type**: `const char*` - **Description**: The required attribution text, in Pango markup form, or `NULL` if not required. The returned data is owned by the instance. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_info_is_daytime Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.is_daytime.html Documentation for the gweather_info_is_daytime function, which checks if it is daytime at a given location and time. ```APIDOC ## gweather_info_is_daytime ### Description Determines whether it is daytime (sun is visible) at the location and time referred to by the GWeatherInfo object. It accounts for midnight sun and polar night for locations within the Arctic and Antarctic circles. ### Method Function ### Signature ```c gboolean gweather_info_is_daytime (GWeatherInfo* info) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object representing the location and time. ### Return Value - **gboolean** - TRUE if it is daytime, FALSE otherwise. ``` -------------------------------- ### gweather_location_detect_nearest_city Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Initializes geocode reversing to find place for (lat, lon) coordinates. ```APIDOC ## gweather_location_detect_nearest_city ### Description Initializes geocode reversing to find place for (`lat`, `lon`) coordinates. ### Method Instance method ### Parameters - **lat** (double) - Required - Latitude. - **lon** (double) - Required - Longitude. - **callback** (GAsyncReadyCallback) - Required - Callback to call when the operation completes. - **user_data** (gpointer) - Optional - User data passed to the callback. ### Returns Nothing. ``` -------------------------------- ### gweather_sky_to_string_full Source: https://gnome.pages.gitlab.gnome.org/libgweather/enum.Sky.html Converts a GWeatherSky enumeration value to a full string representation. No description is available in the source. ```APIDOC ## gweather_sky_to_string_full ### Description Converts a GWeatherSky enumeration value to a full string representation. No description is available in the source. ### Parameters - **sky** (GWeatherSky) - The sky enumeration value to convert. ### Returns - **string** - A full string representation of the sky value. ### Example ```c GWeatherSky sky = GWEATHER_SKY_OVERCAST; const char *str = gweather_sky_to_string_full(sky); ``` ``` -------------------------------- ### gweather_info_set_enabled_providers Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.set_enabled_providers.html Sets the enabled providers for fetching the weather. Note that it is up to the application developer to make sure that the terms of use for each service are respected. Online providers will not be enabled if the application ID is not set to a valid value. ```APIDOC ## gweather_info_set_enabled_providers ### Description Sets the enabled providers for fetching the weather. Note that it is up to the application developer to make sure that the terms of use for each service are respected. Online providers will not be enabled if the application ID is not set to a valid value. Sets the `GWeather.Info:enabled-providers` property. ### Declaration ``` void gweather_info_set_enabled_providers ( GWeatherInfo* info, GWeatherProvider providers ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object. - **providers** (GWeatherProvider) - A bitmask of GWeatherProvider. ``` -------------------------------- ### gweather_info_abort Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.abort.html This function aborts a pending GWeatherInfo operation. It takes a single GWeatherInfo pointer as an argument and returns void. ```APIDOC ## GWeatherInfo.abort ### Description No description available. ### Declaration ```c void gweather_info_abort ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object to abort. ``` -------------------------------- ### GWeatherPressureUnit Source: https://gnome.pages.gitlab.gnome.org/libgweather/enum.PressureUnit.html Enumeration of pressure units used in GWeather. ```APIDOC ## GWeatherPressureUnit ### Description The measure unit to use for atmospheric pressure values, when retrieved by gweather_info_get_value_pressure(). ### Members - **GWEATHER_PRESSURE_UNIT_INVALID** (integer) - Invalid unit. Value: 0. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_DEFAULT** (integer) - The user preferred pressure unit. Value: 1. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_KPA** (integer) - KiloPascal (* 10^3 Pa). Value: 2. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_HPA** (integer) - HectoPascal (* 10^2 Pa); also known as millibars, but formatted differently. Value: 3. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_MB** (integer) - Millibars; same as GWEATHER_PRESSURE_UNIT_HPA. Value: 4. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_MM_HG** (integer) - Millimeters of mercury. Value: 5. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_INCH_HG** (integer) - Inches of mercury. Value: 6. Available since: 4.0. - **GWEATHER_PRESSURE_UNIT_ATM** (integer) - Atmospheres. Value: 7. Available since: 4.0. ``` -------------------------------- ### gweather_location_detect_nearest_city_finish Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Location.html Fetches the location from the result of an asynchronous nearest city detection. ```APIDOC ## gweather_location_detect_nearest_city_finish ### Description Fetches the location from `result`. ### Method Function ### Parameters - **result** (GAsyncResult) - Required - The asynchronous result from gweather_location_detect_nearest_city(). ### Returns The detected GWeatherLocation. ``` -------------------------------- ### gweather_info_get_temp_min Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_temp_min.html Returns the minimum temperature for the weather info. The returned string is owned by the caller and must be freed. ```APIDOC ## gweather_info_get_temp_min ### Description Returns the minimum temperature for the weather info. The returned string is owned by the caller and must be freed. ### Method Function ### Signature ```c char* gweather_info_get_temp_min (GWeatherInfo* info) ``` ### Parameters - **info** (GWeatherInfo*) - The weather info object. ### Return Value - **char*** - The minimum temperature as a NUL terminated UTF-8 string. The caller takes ownership of the returned data and is responsible for freeing it. ``` -------------------------------- ### gweather_info_get_value_conditions Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the current weather conditions as phenomenon and qualifier. ```APIDOC ## gweather_info_get_value_conditions ### Description Fills out `phenomenon` and `qualifier` with current weather conditions. ### Method Instance method ### Signature `gboolean gweather_info_get_value_conditions (GWeatherInfo *info, GWeatherPhenomenon *phenomenon, GWeatherQualifier *qualifier);` ``` -------------------------------- ### gweather_info_get_value_temp_max Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_value_temp_max.html Documentation for the gweather_info_get_value_temp_max function, which retrieves the maximum temperature in a specified unit. ```APIDOC ## gweather_info_get_value_temp_max ### Description Retrieves the maximum temperature value for a given weather info object, converting it to the desired unit. The function sets the provided `value` parameter and returns a boolean indicating whether the value is valid. ### Method Function call ### Signature ```c gboolean gweather_info_get_value_temp_max ( GWeatherInfo* info, GWeatherTemperatureUnit unit, double* value ) ``` ### Parameters - **info** (GWeatherInfo*) - The weather info object. - **unit** (GWeatherTemperatureUnit) - The desired unit, as a `GWeatherTemperatureUnit`. - **value** (double*) - The maximum temperature value. The argument will be set by the function. ### Return Value - **gboolean** - TRUE if `value` is valid, FALSE otherwise. ``` -------------------------------- ### gweather_info_get_value_sunrise Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves the sunrise time value. ```APIDOC ## gweather_info_get_value_sunrise ### Description No description available. ### Method Instance method ### Signature `gboolean gweather_info_get_value_sunrise (GWeatherInfo *info, GWeatherTime *value);` ``` -------------------------------- ### gweather_info_get_value_sunset Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_value_sunset.html Documentation for the gweather_info_get_value_sunset function, which retrieves the sunset time. ```APIDOC ## gweather_info_get_value_sunset ### Description Retrieves the time of sunset for the given weather information. The function sets the provided `value` parameter to the sunset time if available. ### Method Function ### Signature ```c gboolean gweather_info_get_value_sunset ( GWeatherInfo* info, time_t* value ) ``` ### Parameters - **info** (GWeatherInfo*) - The weather information object. - **value** (time_t*) - The time of sunset. The argument will be set by the function. ### Return Value - **gboolean** - TRUE if `value` is valid, FALSE otherwise. ``` -------------------------------- ### gweather_info_store_cache Source: https://gnome.pages.gitlab.gnome.org/libgweather/type_func.Info.store_cache.html Function to store cached network data to disk. ```APIDOC ## GWeatherInfo store_cache ### Description Ensures that any data cached from the network is stored to disk. Calling this is not necessary, as the cache will be saved when the last reference to a `GWeatherInfo` will be dropped. On the other hand, it must be called if there is any chance that the application will be closed without unreffing all objects, such as when using a language binding that employs a GC. ### Declaration ```c void gweather_info_store_cache ( void ) ``` ### Parameters None. ### Return Value None. ``` -------------------------------- ### gweather_info_get_dew Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_dew.html This code snippet documents the gweather_info_get_dew function, which returns a string value. The function takes a GWeatherInfo pointer and returns a char* that the caller must free. ```APIDOC ## gweather_info_get_dew ### Description No description available. ### Declaration ```c char* gweather_info_get_dew ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object. ### Return Value - **char*** - No description available. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The value is a NUL terminated UTF-8 string. ``` -------------------------------- ### gweather_info_update Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.update.html Requests a reload of weather conditions and forecast data from enabled network services. The result is delivered asynchronously via the GWeatherInfo::updated signal. ```APIDOC ## gweather_info_update ### Description Requests a reload of weather conditions and forecast data from enabled network services. This call does no synchronous IO: rather, the result is delivered by emitting the `GWeatherInfo::updated` signal. Note that if no network services are enabled, the signal will not be emitted. See `GWeatherInfo:enabled-providers` for details. ### Method void ### Signature void gweather_info_update (GWeatherInfo* info) ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object to update. ### Return Value None (void). ### Remarks This function performs no synchronous I/O. The result is delivered asynchronously via the `GWeatherInfo::updated` signal. If no network services are enabled, the signal will not be emitted. ``` -------------------------------- ### gweather_speed_unit_to_string Source: https://gnome.pages.gitlab.gnome.org/libgweather/enum.SpeedUnit.html Creates a human-readable, localized representation of the given speed unit. ```APIDOC ## gweather_speed_unit_to_string ### Description Creates a human-readable, localized representation of `unit`. ### Parameters - **unit** (GWeatherSpeedUnit) - Required - The speed unit to convert to a string. ### Returns A string containing the localized representation of the unit. ``` -------------------------------- ### gweather_info_get_upcoming_moonphases Source: https://gnome.pages.gitlab.gnome.org/libgweather/class.Info.html Retrieves a list of upcoming moon phases. ```APIDOC ## gweather_info_get_upcoming_moonphases ### Description No description available. ### Method Instance method ### Signature `GSList * gweather_info_get_upcoming_moonphases (GWeatherInfo *info, guint count);` ``` -------------------------------- ### gweather_info_get_value_visibility Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_value_visibility.html Retrieves the forecasted visibility in the specified unit. The value is stored in the provided pointer and the function returns TRUE if the value is valid, FALSE otherwise. ```APIDOC ## gweather_info_get_value_visibility ### Description Retrieves the forecasted visibility from a GWeatherInfo object, expressed in the desired unit. The function sets the value pointed to by `value` and returns TRUE if the value is valid, FALSE otherwise. ### Method Function call ### Signature gboolean gweather_info_get_value_visibility (GWeatherInfo* info, GWeatherDistanceUnit unit, double* value) ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object from which to retrieve visibility. - **unit** (GWeatherDistanceUnit) - The desired unit for the visibility value. - **value** (double*) - A pointer to a double where the forecasted visibility will be stored. ### Return Value - **gboolean** - TRUE if the value is valid, FALSE otherwise. ``` -------------------------------- ### gweather_conditions_to_string Source: https://gnome.pages.gitlab.gnome.org/libgweather/struct.Conditions.html Converts the GWeatherConditions struct to a string representation. No detailed description is available in the source. ```APIDOC ## gweather_conditions_to_string ### Description No description available. ### Method Instance method ### Parameters None documented. ### Returns String representation of the conditions. ``` -------------------------------- ### char* gweather_info_get_apparent (GWeatherInfo* info) Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Info.get_apparent.html GWeatherInfo.get_apparent returns the apparent temperature (e.g., wind chill or heat index) as a NUL-terminated UTF-8 string. The caller must free the returned string. ```APIDOC ## char* gweather_info_get_apparent (GWeatherInfo* info) ### Description Returns the apparent temperature (wind chill or heat index) for the given GWeatherInfo object. No description is available in the source, but the return value is a NUL-terminated UTF-8 string that the caller takes ownership of and must free. ### Method gweather_info_get_apparent ### Signature ```c char* gweather_info_get_apparent ( GWeatherInfo* info ) ``` ### Parameters - **info** (GWeatherInfo*) - The GWeatherInfo object for which to retrieve the apparent temperature. ### Return Value - **char*** - A NUL-terminated UTF-8 string representing the apparent temperature. The caller takes ownership of the returned data and is responsible for freeing it. ``` -------------------------------- ### gweather_location_find_by_station_code Source: https://gnome.pages.gitlab.gnome.org/libgweather/method.Location.find_by_station_code.html Documentation for the gweather_location_find_by_station_code function, which retrieves a weather station location by its METAR code. ```APIDOC ## gweather_location_find_by_station_code ### Description Retrieves the weather station identifier by `station_code`. Note that multiple instances of the same weather station can exist in the database, and this function will return any of them, so this is not usually what you want. See `gweather_location_deserialize()` to recover a stored location. ### Method Function ### Signature ```c GWeatherLocation* gweather_location_find_by_station_code ( GWeatherLocation* world, const char* station_code ) ``` ### Parameters - **world** (`GWeatherLocation*`) - Required - The world location to search within. - **station_code** (`const char*`) - Required - A 4 letter METAR code. The data is owned by the caller of the method. The value is a NUL terminated UTF-8 string. ### Return Value - **GWeatherLocation** - A weather station level location for the given station code, or `NULL` if none exists in the database. The caller of the method takes ownership of the returned data, and is responsible for freeing it. The return value can be `NULL`. ```