changeset 12900:778d08e87ad0

[gaim-migrate @ 15253] Make gtk_imhtml_get_current_format() set values to FALSE instead of leaving them unset. Also, enable passing NULL in case you're only interested in one or two types of formatting. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 17 Jan 2006 01:43:33 +0000
parents 83de40f1c0df
children 129a83f22349
files plugins/ChangeLog.API src/gtkimhtml.c src/gtkimhtml.h src/gtkimhtmltoolbar.c src/gtkprefs.c
diffstat 5 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Tue Jan 17 01:42:46 2006 +0000
+++ b/plugins/ChangeLog.API	Tue Jan 17 01:43:33 2006 +0000
@@ -88,6 +88,9 @@
 	* gaim_network_listen() and gaim_network_listen_range(): Added
 	  socket_type parameter to allow creation of UDP listening.
 	* GaimPrefCallback: val is now a gconstpointer instead of a gpointer
+	* gtk_imhtml_get_current_format(): the arguments are now set to TRUE or
+	  FALSE.  Previously they were set to TRUE or left alone.  Also, you
+	  may now pass NULL if you're not interested in a specific formatting.
 
 	Removed:
 	* gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute
--- a/src/gtkimhtml.c	Tue Jan 17 01:42:46 2006 +0000
+++ b/src/gtkimhtml.c	Tue Jan 17 01:43:33 2006 +0000
@@ -3912,12 +3912,12 @@
 void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold,
 								   gboolean *italic, gboolean *underline)
 {
-	if (imhtml->edit.bold)
-		(*bold) = TRUE;
-	if (imhtml->edit.italic)
-		(*italic) = TRUE;
-	if (imhtml->edit.underline)
-		(*underline) = TRUE;
+	if (bold != NULL)
+		(*bold) = imhtml->edit.bold;
+	if (italic != NULL)
+		(*italic) = imhtml->edit.italic;
+	if (underline != NULL)
+		(*underline) = imhtml->edit.underline;
 }
 
 char *
--- a/src/gtkimhtml.h	Tue Jan 17 01:42:46 2006 +0000
+++ b/src/gtkimhtml.h	Tue Jan 17 01:43:33 2006 +0000
@@ -523,13 +523,13 @@
 GtkIMHtmlButtons gtk_imhtml_get_format_functions(GtkIMHtml *imhtml);
 
 /**
- * Sets each boolean to TRUE if that formatting option is enabled at the
- * current position in a GTK+ IM/HTML.
+ * Sets each boolean to @c TRUE or @c FALSE to indicate if that formatting option
+ * is enabled at the current position in a GTK+ IM/HTML.
  *
  * @param imhtml    The GTK+ IM/HTML.
- * @param bold      A reference to a boolean for bold.
- * @param italic    A reference to a boolean for italic.
- * @param underline A reference to a boolean for underline.
+ * @param bold      The boolean to set for bold or @c NULL.
+ * @param italic    The boolean to set for italic or @c NULL.
+ * @param underline The boolean to set for underline or @c NULL.
  */
 void gtk_imhtml_get_current_format(GtkIMHtml *imhtml, gboolean *bold, gboolean *italic, gboolean *underline);
 
--- a/src/gtkimhtmltoolbar.c	Tue Jan 17 01:42:46 2006 +0000
+++ b/src/gtkimhtmltoolbar.c	Tue Jan 17 01:43:33 2006 +0000
@@ -793,7 +793,6 @@
 	char *tmp;
 	char *tmp2;
 
-	bold = italic = underline = FALSE;
 	gtk_imhtml_get_current_format(GTK_IMHTML(toolbar->imhtml),
 								  &bold, &italic, &underline);
 
@@ -1118,8 +1117,6 @@
 	buttons = gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml));
 	update_buttons_cb(GTK_IMHTML(imhtml), buttons, toolbar);
 
-	bold = italic = underline = FALSE;
-
 	gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), &bold, &italic, &underline);
 
 	update_buttons(toolbar);
--- a/src/gtkprefs.c	Tue Jan 17 01:42:46 2006 +0000
+++ b/src/gtkprefs.c	Tue Jan 17 01:43:33 2006 +0000
@@ -699,7 +699,6 @@
 {
 	gboolean bold, italic, uline;
 
-	bold = italic = uline = FALSE;
 	gtk_imhtml_get_current_format(GTK_IMHTML(imhtml),
 								  &bold, &italic, &uline);