Smileys: fill comments for old files

Sat, 05 Apr 2014 03:12:23 +0200

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Sat, 05 Apr 2014 03:12:23 +0200
changeset 35766
f29bb25cfbd8
parent 35765
e5fb5dd15044
child 35767
be121567724d

Smileys: fill comments for old files

libpurple/conversation.h file | annotate | diff | comparison | revisions
libpurple/imgstore.h file | annotate | diff | comparison | revisions
libpurple/trie.h file | annotate | diff | comparison | revisions
libpurple/util.h file | annotate | diff | comparison | revisions
pidgin/gtkutils.h file | annotate | diff | comparison | revisions
pidgin/gtkwebview.h file | annotate | diff | comparison | revisions
--- a/libpurple/conversation.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/libpurple/conversation.h	Sat Apr 05 03:12:23 2014 +0200
@@ -675,15 +675,46 @@
 gssize
 purple_conversation_get_max_message_size(PurpleConversation *conv);
 
+/**
+ * purple_conversation_add_remote_smiley:
+ * @conv: The conversation that receives new smiley.
+ * @shortcut: The shortcut for the new smiley.
+ *
+ * Adds new smiley to the list of remote smileys for this conversation.
+ * The smiley have to be written and closed, when data is ready.
+ *
+ * Returns: (transfer none): New smiley, or %NULL if it's already being
+ *          retrieved (or possibly, in case of error).
+ */
 PurpleRemoteSmiley *
 purple_conversation_add_remote_smiley(PurpleConversation *conv,
 	const gchar *shortcut);
 
-/* use it only, if you cannot store purple_conversation_add_remote_smiley output or control its ref */
+/**
+ * purple_conversation_get_remote_smiley:
+ * @conv: The conversation.
+ * @shortcut: The shortcut.
+ *
+ * Lookups for the remote smiley previously added to this conversation.
+ *
+ * You may use this function when you receive the smiley data, but it's
+ * better just to store and use the reference returned by
+ * #purple_conversation_add_remote_smiley.
+ *
+ * Returns: (transfer none): The smiley, or %NULL if it doesn't exists.
+ */
 PurpleRemoteSmiley *
 purple_conversation_get_remote_smiley(PurpleConversation *conv,
 	const gchar *shortcut);
 
+/**
+ * purple_conversation_get_remote_smileys:
+ * @conv: The conversation.
+ *
+ * Get all remote smileys previously added to this conversation.
+ *
+ * Returns: (transfer none): The list of remote smileys.
+ */
 PurpleSmileyList *
 purple_conversation_get_remote_smileys(PurpleConversation *conv);
 
--- a/libpurple/imgstore.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/libpurple/imgstore.h	Sat Apr 05 03:12:23 2014 +0200
@@ -47,8 +47,9 @@
 typedef struct _PurpleStoredImage PurpleStoredImage;
 
 #define PURPLE_TYPE_STORED_IMAGE (purple_imgstore_get_type())
+
+/* TODO: make it a real GObject */
 #if 0
-/* TODO */
 #define PURPLE_IS_STORED_IMAGE(image) (G_TYPE_CHECK_INSTANCE_TYPE((image), PURPLE_TYPE_STORED_IMAGE))
 #else
 #define PURPLE_IS_STORED_IMAGE(image) ((image) != NULL)
@@ -148,6 +149,15 @@
  */
 int purple_imgstore_new_with_id(gpointer data, size_t size, const char *filename);
 
+/**
+ * purple_imgstore_add_with_id:
+ * @image: The image.
+ *
+ * Adds previously created #PurpleStoredImage to the local store with newly
+ * generated id. If it was already in the store, an old id will be returned.
+ *
+ * Returns: ID for the image.
+ */
 int
 purple_imgstore_add_with_id(PurpleStoredImage *image);
 
--- a/libpurple/trie.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/libpurple/trie.h	Sat Apr 05 03:12:23 2014 +0200
@@ -138,6 +138,12 @@
 void
 purple_trie_remove(PurpleTrie *trie, const gchar *word);
 
+/**
+ * purple_trie_get_size:
+ * @trie: The trie.
+ *
+ * Returns: The number of elements stored in this trie.
+ */
 guint
 purple_trie_get_size(PurpleTrie *trie);
 
@@ -177,6 +183,20 @@
 purple_trie_multi_replace(const GSList *tries, const gchar *src,
 	PurpleTrieReplaceCb replace_cb, gpointer user_data);
 
+/**
+ * purple_trie_find:
+ * @trie: The trie.
+ * @src: The source string.
+ * @find_cb: The callback for found entries (may be %NULL).
+ * @user_data: Custom data to be passed to @find_cb.
+ *
+ * Processes @src string and finds all occuriences of words added to @trie.
+ * It's O(strlen(src)), if find_cb runs in O(1).
+ *
+ * The word is counted as found if it's found and the callback returns %TRUE.
+ *
+ * Returns: The number of found words.
+ */
 gulong
 purple_trie_find(PurpleTrie *trie, const gchar *src,
 	PurpleTrieFindCb find_cb, gpointer user_data);
--- a/libpurple/util.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/libpurple/util.h	Sat Apr 05 03:12:23 2014 +0200
@@ -1056,7 +1056,18 @@
  */
 gboolean purple_str_has_prefix(const char *s, const char *p);
 
-gboolean purple_str_has_caseprefix(const gchar *s, const gchar *p);
+/**
+ * purple_str_has_caseprefix:
+ * @s: The string to check.
+ * @p: The prefix in question.
+ *
+ * Compares two strings to see if the first contains the second as
+ * a proper case-insensitive prefix.
+ *
+ * Returns: %TRUE if @p is a prefix of @s, otherwise %FALSE.
+ */
+gboolean
+purple_str_has_caseprefix(const gchar *s, const gchar *p);
 
 /**
  * purple_str_has_suffix:
--- a/pidgin/gtkutils.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/pidgin/gtkutils.h	Sat Apr 05 03:12:23 2014 +0200
@@ -944,6 +944,22 @@
  */
 GdkPixbuf *pidgin_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, gboolean preserve_aspect_ratio);
 
+/**
+ * pidgin_pixbuf_scale_down:
+ * @src: The source image.
+ * @max_width: Maximum width in px.
+ * @max_height: Maximum height in px.
+ * @interp_type: Interpolation method.
+ * @preserve_ratio: %TRUE to preserve image's aspect ratio.
+ *
+ * Scales the image to the desired dimensions. If image is smaller, it will be
+ * returned without modifications.
+ *
+ * If new image is created, @src reference cound will be decreased and new image
+ * with a ref count of 1 will be returned.
+ *
+ * Returns: The image with proper sizing. %NULL in case of error.
+ */
 GdkPixbuf *
 pidgin_pixbuf_scale_down(GdkPixbuf *src, guint max_width, guint max_height,
 	GdkInterpType interp_type, gboolean preserve_ratio);
--- a/pidgin/gtkwebview.h	Sat Apr 05 02:40:00 2014 +0200
+++ b/pidgin/gtkwebview.h	Sat Apr 05 03:12:23 2014 +0200
@@ -605,6 +605,13 @@
  */
 void pidgin_webview_activate_toolbar(PidginWebView *webview, PidginWebViewAction action);
 
+/**
+ * pidgin_webview_switch_active_conversation:
+ * @webview: The PidginWebView
+ * @conv: The conversation.
+ *
+ * Updates the webview for a new active #PurpleConversation.
+ */
 void
 pidgin_webview_switch_active_conversation(PidginWebView *webview,
 	PurpleConversation *conv);

mercurial