Added missing "Since:" annotations for g_input_stream_read_bytes() APIs.
[platform/upstream/glib.git] / gio / gicon.c
index bc3f2a5..b5080da 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: Alexander Larsson <alexl@redhat.com>
  */
@@ -195,23 +193,18 @@ g_icon_to_string_tokenized (GIcon *icon, GString *s)
  * The encoding of the returned string is proprietary to #GIcon except
  * in the following two cases
  *
- * <itemizedlist>
- * <listitem><para>
- *     If @icon is a #GFileIcon, the returned string is a native path
- *     (such as <literal>/path/to/my icon.png</literal>) without escaping
- *     if the #GFile for @icon is a native file.  If the file is not
- *     native, the returned string is the result of g_file_get_uri()
- *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
- * </para></listitem>
- * <listitem><para>
- *    If @icon is a #GThemedIcon with exactly one name, the encoding is
- *    simply the name (such as <literal>network-server</literal>).
- * </para></listitem>
- * </itemizedlist>
+ * - If @icon is a #GFileIcon, the returned string is a native path
+ *   (such as `/path/to/my icon.png`) without escaping
+ *   if the #GFile for @icon is a native file.  If the file is not
+ *   native, the returned string is the result of g_file_get_uri()
+ *   (such as `sftp://path/to/my%20icon.png`).
+ * 
+ * - If @icon is a #GThemedIcon with exactly one name, the encoding is
+ *    simply the name (such as `network-server`).
  *
  * Virtual: to_tokens
- * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
- * be serialized. Use g_free() to free.
+ * Returns: (nullable): An allocated NUL-terminated UTF8 string or
+ * %NULL if @icon can't be serialized. Use g_free() to free.
  *
  * Since: 2.20
  */
@@ -546,6 +539,8 @@ g_icon_deserialize_emblemed (GVariant *value)
 
       g_object_unref (main_icon);
     }
+  else
+    icon = NULL;
 
   g_variant_iter_free (emblems);
   g_variant_unref (icon_data);
@@ -553,6 +548,16 @@ g_icon_deserialize_emblemed (GVariant *value)
   return icon;
 }
 
+/**
+ * g_icon_deserialize:
+ * @value: a #GVariant created with g_icon_serialize()
+ *
+ * Deserializes a #GIcon previously serialized using g_icon_serialize().
+ *
+ * Returns: (transfer full): a #GIcon, or %NULL when deserialization fails.
+ *
+ * Since: 2.38
+ */
 GIcon *
 g_icon_deserialize (GVariant *value)
 {
@@ -630,6 +635,20 @@ g_icon_deserialize (GVariant *value)
   return icon;
 }
 
+/**
+ * g_icon_serialize:
+ * @icon: a #GIcon
+ *
+ * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
+ * back by calling g_icon_deserialize() on the returned value.
+ * As serialization will avoid using raw icon data when possible, it only
+ * makes sense to transfer the #GVariant between processes on the same machine,
+ * (as opposed to over the network), and within the same file system namespace.
+ *
+ * Returns: (transfer full): a #GVariant, or %NULL when serialization fails.
+ *
+ * Since: 2.38
+ */
 GVariant *
 g_icon_serialize (GIcon *icon)
 {
@@ -640,7 +659,7 @@ g_icon_serialize (GIcon *icon)
 
   if (!iface->serialize)
     {
-      g_critical ("g_icon_serialize() on icon type `%s' is not implemented", G_OBJECT_TYPE_NAME (icon));
+      g_critical ("g_icon_serialize() on icon type '%s' is not implemented", G_OBJECT_TYPE_NAME (icon));
       return NULL;
     }
 
@@ -652,8 +671,8 @@ g_icon_serialize (GIcon *icon)
 
       if (!g_variant_is_of_type (result, G_VARIANT_TYPE ("(sv)")))
         {
-          g_critical ("g_icon_serialize() on icon type `%s' returned GVariant of type `%s' but it must return "
-                      "one with type `(sv)'", G_OBJECT_TYPE_NAME (icon), g_variant_get_type_string (result));
+          g_critical ("g_icon_serialize() on icon type '%s' returned GVariant of type '%s' but it must return "
+                      "one with type '(sv)'", G_OBJECT_TYPE_NAME (icon), g_variant_get_type_string (result));
           g_variant_unref (result);
           result = NULL;
         }