+/**
+ * gtk_status_icon_set_has_tooltip:
+ * @status_icon: a #GtkStatusIcon
+ * @has_tooltip: whether or not @status_icon has a tooltip
+ *
+ * Sets the has-tooltip property on @status_icon to @has_tooltip.
+ * See #GtkStatusIcon:has-tooltip for more information.
+ *
+ * Since: 2.16
+ */
+void
+gtk_status_icon_set_has_tooltip (GtkStatusIcon *status_icon,
+ gboolean has_tooltip)
+{
+ GtkStatusIconPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ gtk_widget_set_has_tooltip (priv->tray_icon, has_tooltip);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (!has_tooltip && priv->tooltip_text)
+ gtk_status_icon_set_tooltip_text (status_icon, NULL);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ if (!has_tooltip && priv->tooltip_text)
+ gtk_status_icon_set_tooltip_text (status_icon, NULL);
+#endif
+}
+
+/**
+ * gtk_status_icon_get_has_tooltip:
+ * @status_icon: a #GtkStatusIcon
+ *
+ * Returns the current value of the has-tooltip property.
+ * See #GtkStatusIcon:has-tooltip for more information.
+ *
+ * Return value: current value of has-tooltip on @status_icon.
+ *
+ * Since: 2.16
+ */
+gboolean
+gtk_status_icon_get_has_tooltip (GtkStatusIcon *status_icon)
+{
+ GtkStatusIconPrivate *priv;
+ gboolean has_tooltip = FALSE;
+
+ g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), FALSE);
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ has_tooltip = gtk_widget_get_has_tooltip (priv->tray_icon);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ has_tooltip = (priv->tooltip_text != NULL);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ has_tooltip = (priv->tooltip_text != NULL);
+#endif
+
+ return has_tooltip;
+}
+
+/**
+ * gtk_status_icon_set_tooltip_text:
+ * @status_icon: a #GtkStatusIcon
+ * @text: the contents of the tooltip for @status_icon
+ *
+ * Sets @text as the contents of the tooltip.
+ *
+ * This function will take care of setting #GtkStatusIcon:has-tooltip to
+ * %TRUE and of the default handler for the #GtkStatusIcon::query-tooltip
+ * signal.
+ *
+ * See also the #GtkStatusIcon:tooltip-text property and
+ * gtk_tooltip_set_text().
+ *
+ * Since: 2.16
+ */
+void
+gtk_status_icon_set_tooltip_text (GtkStatusIcon *status_icon,
+ const gchar *text)
+{
+ GtkStatusIconPrivate *priv;
+
+ g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ gtk_widget_set_tooltip_text (priv->tray_icon, text);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (text == NULL)
+ priv->nid.uFlags &= ~NIF_TIP;
+ else
+ {
+ WCHAR *wcs = g_utf8_to_utf16 (text, -1, NULL, NULL, NULL);
+
+ priv->nid.uFlags |= NIF_TIP;
+ wcsncpy (priv->nid.szTip, wcs, G_N_ELEMENTS (priv->nid.szTip) - 1);
+ priv->nid.szTip[G_N_ELEMENTS (priv->nid.szTip) - 1] = 0;
+ g_free (wcs);
+ }
+ if (priv->nid.hWnd != NULL && priv->visible)
+ if (!Shell_NotifyIconW (NIM_MODIFY, &priv->nid))
+ g_warning (G_STRLOC ": Shell_NotifyIconW(NIM_MODIFY) failed");
+
+ g_free (priv->tooltip_text);
+ priv->tooltip_text = g_strdup (text);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ QUARTZ_POOL_ALLOC;
+ [priv->status_item setToolTip:text];
+ QUARTZ_POOL_RELEASE;
+
+ g_free (priv->tooltip_text);
+ priv->tooltip_text = g_strdup (text);
+#endif
+}
+
+/**
+ * gtk_status_icon_get_tooltip_text:
+ * @status_icon: a #GtkStatusIcon
+ *
+ * Gets the contents of the tooltip for @status_icon.
+ *
+ * Return value: the tooltip text, or %NULL. You should free the
+ * returned string with g_free() when done.
+ *
+ * Since: 2.16
+ */
+gchar *
+gtk_status_icon_get_tooltip_text (GtkStatusIcon *status_icon)
+{
+ GtkStatusIconPrivate *priv;
+ gchar *tooltip_text = NULL;
+
+ g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), NULL);
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ tooltip_text = gtk_widget_get_tooltip_text (priv->tray_icon);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (priv->tooltip_text)
+ tooltip_text = g_strdup (priv->tooltip_text);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ if (priv->tooltip_text)
+ tooltip_text = g_strdup (priv->tooltip_text);
+#endif
+
+ return tooltip_text;
+}
+
+/**
+ * gtk_status_icon_set_tooltip_markup:
+ * @status_icon: a #GtkStatusIcon
+ * @markup: (allow-none): the contents of the tooltip for @status_icon, or %NULL
+ *
+ * Sets @markup as the contents of the tooltip, which is marked up with
+ * the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
+ *
+ * This function will take care of setting #GtkStatusIcon:has-tooltip to %TRUE
+ * and of the default handler for the #GtkStatusIcon::query-tooltip signal.
+ *
+ * See also the #GtkStatusIcon:tooltip-markup property and
+ * gtk_tooltip_set_markup().
+ *
+ * Since: 2.16
+ */
+void
+gtk_status_icon_set_tooltip_markup (GtkStatusIcon *status_icon,
+ const gchar *markup)
+{
+ GtkStatusIconPrivate *priv;
+#ifndef GDK_WINDOWING_X11
+ gchar *text = NULL;
+#endif
+
+ g_return_if_fail (GTK_IS_STATUS_ICON (status_icon));
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ gtk_widget_set_tooltip_markup (priv->tray_icon, markup);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (markup)
+ pango_parse_markup (markup, -1, 0, NULL, &text, NULL, NULL);
+ gtk_status_icon_set_tooltip_text (status_icon, text);
+ g_free (text);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ if (markup)
+ pango_parse_markup (markup, -1, 0, NULL, &text, NULL, NULL);
+ gtk_status_icon_set_tooltip_text (status_icon, text);
+ g_free (text);
+#endif
+}
+
+/**
+ * gtk_status_icon_get_tooltip_markup:
+ * @status_icon: a #GtkStatusIcon
+ *
+ * Gets the contents of the tooltip for @status_icon.
+ *
+ * Return value: the tooltip text, or %NULL. You should free the
+ * returned string with g_free() when done.
+ *
+ * Since: 2.16
+ */
+gchar *
+gtk_status_icon_get_tooltip_markup (GtkStatusIcon *status_icon)
+{
+ GtkStatusIconPrivate *priv;
+ gchar *markup = NULL;
+
+ g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), NULL);
+
+ priv = status_icon->priv;
+
+#ifdef GDK_WINDOWING_X11
+ if (priv->tray_icon)
+ markup = gtk_widget_get_tooltip_markup (priv->tray_icon);
+#endif
+#ifdef GDK_WINDOWING_WIN32
+ if (priv->tooltip_text)
+ markup = g_markup_escape_text (priv->tooltip_text, -1);
+#endif
+#ifdef GDK_WINDOWING_QUARTZ
+ if (priv->tooltip_text)
+ markup = g_markup_escape_text (priv->tooltip_text, -1);
+#endif
+
+ return markup;
+}
+