midori/midori/compat.c

68 lines
1.5 KiB
C
Raw Normal View History

/*
Copyright (C) 2008-2009 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
See the file COPYING for the full license text.
*/
#include "compat.h"
2009-01-22 21:59:47 +00:00
#include <string.h>
#if !GTK_CHECK_VERSION (2, 14, 0)
gboolean
gtk_show_uri (GdkScreen* screen,
const gchar* uri,
guint32 timestamp,
GError** error)
{
g_return_val_if_fail (uri != NULL, FALSE);
return g_app_info_launch_default_for_uri (uri, NULL, NULL);
}
#endif
2008-06-08 17:45:33 +00:00
#if !GTK_CHECK_VERSION(2, 12, 0)
void
gtk_widget_set_has_tooltip (GtkWidget* widget,
gboolean has_tooltip)
{
/* Do nothing */
}
2008-06-08 17:45:33 +00:00
void
2008-07-06 14:12:27 +00:00
gtk_widget_set_tooltip_text (GtkWidget* widget,
const gchar* text)
2008-06-08 17:45:33 +00:00
{
if (text && *text)
{
static GtkTooltips* tooltips = NULL;
if (G_UNLIKELY (!tooltips))
tooltips = gtk_tooltips_new ();
gtk_tooltips_set_tip (tooltips, widget, text, NULL);
}
2008-06-08 17:45:33 +00:00
}
void
gtk_tool_item_set_tooltip_text (GtkToolItem* toolitem,
const gchar* text)
{
if (text && *text)
{
static GtkTooltips* tooltips = NULL;
if (G_UNLIKELY (!tooltips))
2008-08-27 23:15:30 +00:00
tooltips = gtk_tooltips_new ();
2008-06-08 17:45:33 +00:00
gtk_tool_item_set_tooltip (toolitem, tooltips, text, NULL);
}
}
#endif