[gtksourceview] Add nullable annotations



commit 4a67b42fe6b70963415c0c63da7cb4d22d6be0e9
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Aug 16 10:13:14 2015 +0200

    Add nullable annotations

 gtksourceview/gtksourcebuffer.c             |    7 +++--
 gtksourceview/gtksourcecompletion.c         |    2 +-
 gtksourceview/gtksourcecompletionproposal.c |    5 ++-
 gtksourceview/gtksourcefileloader.c         |    8 +++---
 gtksourceview/gtksourcegutter.c             |    2 +-
 gtksourceview/gtksourcelanguage.c           |   36 ++++++++++++++------------
 gtksourceview/gtksourcelanguagemanager.c    |   10 +++---
 gtksourceview/gtksourcestyleschememanager.c |    6 ++--
 8 files changed, 40 insertions(+), 36 deletions(-)
---
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index c6c7bf0..2a5cc49 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -1619,7 +1619,8 @@ gtk_source_buffer_set_language (GtkSourceBuffer   *buffer,
  * see gtk_source_buffer_set_language().  The returned object should not be
  * unreferenced by the user.
  *
- * Returns: (transfer none): the #GtkSourceLanguage associated with the buffer, or %NULL.
+ * Returns: (nullable) (transfer none): the #GtkSourceLanguage associated
+ * with the buffer, or %NULL.
  */
 GtkSourceLanguage *
 gtk_source_buffer_get_language (GtkSourceBuffer *buffer)
@@ -1738,8 +1739,8 @@ gtk_source_buffer_set_style_scheme (GtkSourceBuffer      *buffer,
  * see gtk_source_buffer_set_style_scheme().
  * The returned object should not be unreferenced by the user.
  *
- * Returns: (transfer none): the #GtkSourceStyleScheme associated
- * with the buffer, or %NULL.
+ * Returns: (nullable) (transfer none): the #GtkSourceStyleScheme
+ * associated with the buffer, or %NULL.
  */
 GtkSourceStyleScheme *
 gtk_source_buffer_get_style_scheme (GtkSourceBuffer *buffer)
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 65fd3e8..76c7b50 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -2949,7 +2949,7 @@ gtk_source_completion_get_info_window (GtkSourceCompletion *completion)
  * The #GtkSourceView associated with @completion, or %NULL if the view has been
  * destroyed.
  *
- * Returns: (type GtkSource.View) (transfer none):
+ * Returns: (type GtkSource.View) (nullable) (transfer none):
  * The #GtkSourceView associated with @completion, or %NULL.
  */
 GtkSourceView *
diff --git a/gtksourceview/gtksourcecompletionproposal.c b/gtksourceview/gtksourcecompletionproposal.c
index cb09ef8..b79f55c 100644
--- a/gtksourceview/gtksourcecompletionproposal.c
+++ b/gtksourceview/gtksourcecompletionproposal.c
@@ -266,8 +266,9 @@ gtk_source_completion_proposal_get_gicon (GtkSourceCompletionProposal *proposal)
  * used to present the user with extra, detailed information about the
  * selected proposal. The returned string must be freed with g_free().
  *
- * Returns: a new string containing extra information of @proposal or %NULL if
- *          no extra information is associated to @proposal.
+ * Returns: (nullable) (transfer full): a newly-allocated string containing
+ * extra information of @proposal or %NULL if no extra information is associated
+ * to @proposal.
  */
 gchar *
 gtk_source_completion_proposal_get_info (GtkSourceCompletionProposal *proposal)
diff --git a/gtksourceview/gtksourcefileloader.c b/gtksourceview/gtksourcefileloader.c
index a65889b..5c6af72 100644
--- a/gtksourceview/gtksourcefileloader.c
+++ b/gtksourceview/gtksourcefileloader.c
@@ -955,8 +955,8 @@ gtk_source_file_loader_get_file (GtkSourceFileLoader *loader)
  * gtk_source_file_loader_get_location:
  * @loader: a #GtkSourceFileLoader.
  *
- * Returns: (transfer none): the #GFile to load, or %NULL if an input stream is
- *   used.
+ * Returns: (nullable) (transfer none): the #GFile to load, or %NULL
+ * if an input stream is used.
  * Since: 3.14
  */
 GFile *
@@ -971,8 +971,8 @@ gtk_source_file_loader_get_location (GtkSourceFileLoader *loader)
  * gtk_source_file_loader_get_input_stream:
  * @loader: a #GtkSourceFileLoader.
  *
- * Returns: (transfer none): the #GInputStream to load, or %NULL if a #GFile is
- *   used.
+ * Returns: (nullabe) (transfer none): the #GInputStream to load, or %NULL
+ * if a #GFile is used.
  * Since: 3.14
  */
 GInputStream *
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index 9b8d2cc..e16272a 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -1713,7 +1713,7 @@ gtk_source_gutter_get_padding (GtkSourceGutter *gutter,
  *
  * Finds the #GtkSourceGutterRenderer at (x, y).
  *
- * Returns: (transfer none): the renderer at (x, y) or %NULL.
+ * Returns: (nullable) (transfer none): the renderer at (x, y) or %NULL.
  */
 /* FIXME: to insert a renderer in a gutter, only one position is needed. Here to
  * retrieve a renderer, two positions are needed? Document why.
diff --git a/gtksourceview/gtksourcelanguage.c b/gtksourceview/gtksourcelanguage.c
index 68d0df2..bda8ee6 100644
--- a/gtksourceview/gtksourcelanguage.c
+++ b/gtksourceview/gtksourcelanguage.c
@@ -548,8 +548,9 @@ gtk_source_language_get_hidden (GtkSourceLanguage *language)
  * @language: a #GtkSourceLanguage.
  * @name: metadata property name.
  *
- * Returns: value of property @name stored in the metadata of @language
- * or %NULL if language doesn't contain that metadata property.
+ * Returns: (nullable) (transfer none): value of property @name stored in
+ * the metadata of @language or %NULL if language does not contain the
+ * specified metadata property.
  * The returned string is owned by @language and should not be freed
  * or modified.
  **/
@@ -572,9 +573,9 @@ gtk_source_language_get_metadata (GtkSourceLanguage *language,
  * retrieve the "mimetypes" metadata property and split it into an
  * array.
  *
- * Returns: (array zero-terminated=1) (transfer full): a newly-allocated
- * %NULL terminated array containing the mime types or %NULL if no
- * mime types are found.
+ * Returns: (nullable) (array zero-terminated=1) (transfer full):
+ * a newly-allocated %NULL terminated array containing the mime types
+ * or %NULL if no mime types are found.
  * The returned array must be freed with g_strfreev().
  **/
 gchar **
@@ -599,8 +600,9 @@ gtk_source_language_get_mime_types (GtkSourceLanguage *language)
  * an utility wrapper around gtk_source_language_get_metadata() to
  * retrieve the "globs" metadata property and split it into an array.
  *
- * Returns: (array zero-terminated=1) (transfer full): a newly-allocated
- * %NULL terminated array containing the globs or %NULL if no globs are found.
+ * Returns: (nullable) (array zero-terminated=1) (transfer full):
+ * a newly-allocated %NULL terminated array containing the globs or %NULL
+ * if no globs are found.
  * The returned array must be freed with g_strfreev().
  **/
 gchar **
@@ -833,9 +835,9 @@ force_styles (GtkSourceLanguage *language)
  *
  * Returns the ids of the styles defined by this @language.
  *
- * Returns: (array zero-terminated=1) (transfer full): a  %NULL terminated
- * array containing ids of the styles defined by this @language or
- * %NULL if no style is defined.
+ * Returns: (nullable) (array zero-terminated=1) (transfer full):
+ * a newly-allocated %NULL terminated array containing ids of the
+ * styles defined by this @language or %NULL if no style is defined.
  * The returned array must be freed with g_strfreev().
 */
 gchar **
@@ -872,10 +874,10 @@ get_style_info (GtkSourceLanguage *language, const char *style_id)
  *
  * Returns the name of the style with ID @style_id defined by this @language.
  *
- * Returns: the name of the style with ID @style_id defined by this @language or
- * %NULL if the style has no name or there is no style with ID @style_id defined
- * by this @language. The returned string is owned by the @language and must
- * not be modified.
+ * Returns: (nullable) (transfer none): the name of the style with ID @style_id
+ * defined by this @language or %NULL if the style has no name or there is no
+ * style with ID @style_id defined by this @language.
+ * The returned string is owned by the @language and must not be modified.
  */
 const gchar *
 gtk_source_language_get_style_name (GtkSourceLanguage *language,
@@ -900,9 +902,9 @@ gtk_source_language_get_style_name (GtkSourceLanguage *language,
  * Returns the ID of the style to use if the specified @style_id
  * is not present in the current style scheme.
  *
- * Returns: the ID of the style to use if the specified @style_id
- * is not present in the current style scheme or %NULL if the style has
- * no fallback defined.
+ * Returns: (nullable) (transfer none): the ID of the style to use if the
+ * specified @style_id is not present in the current style scheme or %NULL
+ * if the style has no fallback defined.
  * The returned string is owned by the @language and must not be modified.
  *
  * Since: 3.4
diff --git a/gtksourceview/gtksourcelanguagemanager.c b/gtksourceview/gtksourcelanguagemanager.c
index 0481e5f..e5abb82 100644
--- a/gtksourceview/gtksourcelanguagemanager.c
+++ b/gtksourceview/gtksourcelanguagemanager.c
@@ -404,11 +404,11 @@ ensure_languages (GtkSourceLanguageManager *lm)
  *
  * Returns the ids of the available languages.
  *
- * Returns: (nullable) (transfer none): a %NULL-terminated array of
- * string containing the ids of the available languages or %NULL if no
- * language is available.  The array is sorted alphabetically
- * according to the language name.  The array is owned by @lm and must
- * not be modified.
+ * Returns: (nullable) (array zero-terminated=1) (transfer none):
+ * a %NULL-terminated array of strings containing the ids of the available
+ * languages or %NULL if no language is available.
+ * The array is sorted alphabetically according to the language name.
+ * The array is owned by @lm and must not be modified.
  */
 const gchar * const *
 gtk_source_language_manager_get_language_ids (GtkSourceLanguageManager *lm)
diff --git a/gtksourceview/gtksourcestyleschememanager.c b/gtksourceview/gtksourcestyleschememanager.c
index 68f4c0c..81c64b8 100644
--- a/gtksourceview/gtksourcestyleschememanager.c
+++ b/gtksourceview/gtksourcestyleschememanager.c
@@ -541,9 +541,9 @@ gtk_source_style_scheme_manager_force_rescan (GtkSourceStyleSchemeManager *manag
  *
  * Returns the ids of the available style schemes.
  *
- * Returns: (array zero-terminated=1) (transfer none): a %NULL-terminated array
- * of string containing the ids of the available style schemes or %NULL if no
- * style scheme is available.
+ * Returns: (nullable) (array zero-terminated=1) (transfer none):
+ * a %NULL-terminated array of strings containing the ids of the available
+ * style schemes or %NULL if no style scheme is available.
  * The array is sorted alphabetically according to the scheme name.
  * The array is owned by the @manager and must not be modified.
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]