Depend on Gtk+ 2.10 for StatusIcon

This commit is contained in:
William Jon McCann 2010-01-09 13:04:32 -05:00
parent 8374438dcf
commit 732437ffc0
2 changed files with 2 additions and 22 deletions

View File

@ -83,7 +83,7 @@ AC_EXEEXT
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
REQ_DBUS_VERSION=0.76 REQ_DBUS_VERSION=0.76
REQ_GTK_VERSION=2.6 REQ_GTK_VERSION=2.10
REQ_GLIB_VERSION=2.6 REQ_GLIB_VERSION=2.6
pkg_modules="gtk+-2.0 >= $REQ_GTK_VERSION, glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION" pkg_modules="gtk+-2.0 >= $REQ_GTK_VERSION, glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION"
AC_SUBST(pkg_modules) AC_SUBST(pkg_modules)

View File

@ -28,9 +28,6 @@
#include <libnotify/internal.h> #include <libnotify/internal.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#if GTK_CHECK_VERSION(2, 9, 2)
# define HAVE_STATUS_ICON
#endif
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#define CHECK_DBUS_VERSION(major, minor) \ #define CHECK_DBUS_VERSION(major, minor) \
@ -83,9 +80,7 @@ struct _NotifyNotificationPrivate
GHashTable *hints; GHashTable *hints;
GtkWidget *attached_widget; GtkWidget *attached_widget;
#ifdef HAVE_STATUS_ICON
GtkStatusIcon *status_icon; GtkStatusIcon *status_icon;
#endif
gboolean has_nondefault_actions; gboolean has_nondefault_actions;
gboolean updates_pending; gboolean updates_pending;
@ -215,7 +210,6 @@ notify_notification_class_init(NotifyNotificationClass *klass)
G_PARAM_STATIC_NICK | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB)); G_PARAM_STATIC_BLURB));
#ifdef HAVE_STATUS_ICON
g_object_class_install_property(object_class, PROP_STATUS_ICON, g_object_class_install_property(object_class, PROP_STATUS_ICON,
g_param_spec_object("status-icon", g_param_spec_object("status-icon",
"Status Icon", "Status Icon",
@ -226,7 +220,6 @@ notify_notification_class_init(NotifyNotificationClass *klass)
G_PARAM_STATIC_NAME | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB)); G_PARAM_STATIC_BLURB));
#endif /* HAVE_STATUS_ICON */
g_object_class_install_property(object_class, PROP_CLOSED_REASON, g_object_class_install_property(object_class, PROP_CLOSED_REASON,
g_param_spec_int("closed-reason", "Closed Reason", g_param_spec_int("closed-reason", "Closed Reason",
@ -276,12 +269,10 @@ notify_notification_set_property(GObject *object,
g_value_get_object(value)); g_value_get_object(value));
break; break;
#ifdef HAVE_STATUS_ICON
case PROP_STATUS_ICON: case PROP_STATUS_ICON:
notify_notification_attach_to_status_icon(notification, notify_notification_attach_to_status_icon(notification,
g_value_get_object(value)); g_value_get_object(value));
break; break;
#endif
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@ -320,11 +311,9 @@ notify_notification_get_property(GObject *object,
g_value_set_object(value, priv->attached_widget); g_value_set_object(value, priv->attached_widget);
break; break;
#ifdef HAVE_STATUS_ICON
case PROP_STATUS_ICON: case PROP_STATUS_ICON:
g_value_set_object(value, priv->status_icon); g_value_set_object(value, priv->status_icon);
break; break;
#endif
case PROP_CLOSED_REASON: case PROP_CLOSED_REASON:
g_value_set_int(value, priv->closed_reason); g_value_set_int(value, priv->closed_reason);
@ -395,11 +384,9 @@ notify_notification_finalize(GObject *object)
if (priv->attached_widget != NULL) if (priv->attached_widget != NULL)
g_object_unref(G_OBJECT(priv->attached_widget)); g_object_unref(G_OBJECT(priv->attached_widget));
#ifdef HAVE_STATUS_ICON
if (priv->status_icon != NULL) if (priv->status_icon != NULL)
g_object_remove_weak_pointer(G_OBJECT(priv->status_icon), g_object_remove_weak_pointer(G_OBJECT(priv->status_icon),
(gpointer)&priv->status_icon); (gpointer)&priv->status_icon);
#endif
if (priv->signals_registered) if (priv->signals_registered)
{ {
@ -430,7 +417,6 @@ _notify_notification_update_applet_hints(NotifyNotification *n)
GdkScreen *screen = NULL; GdkScreen *screen = NULL;
gint x, y; gint x, y;
#ifdef HAVE_STATUS_ICON
if (priv->status_icon != NULL) if (priv->status_icon != NULL)
{ {
GdkRectangle rect; GdkRectangle rect;
@ -456,9 +442,7 @@ _notify_notification_update_applet_hints(NotifyNotification *n)
x = rect.x + rect.width / 2; x = rect.x + rect.width / 2;
y = rect.y + rect.height / 2; y = rect.y + rect.height / 2;
} }
else else if (priv->attached_widget != NULL)
#endif /* HAVE_STATUS_ICON */
if (priv->attached_widget != NULL)
{ {
GtkWidget *widget = priv->attached_widget; GtkWidget *widget = priv->attached_widget;
@ -542,7 +526,6 @@ notify_notification_new(const gchar *summary,
NULL); NULL);
} }
#ifdef HAVE_STATUS_ICON
/** /**
* notify_notification_new_with_status_icon: * notify_notification_new_with_status_icon:
* @summary: The required summary text. * @summary: The required summary text.
@ -574,7 +557,6 @@ notify_notification_new_with_status_icon(const gchar *summary,
"status-icon", status_icon, "status-icon", status_icon,
NULL); NULL);
} }
#endif /* HAVE_STATUS_ICON */
/** /**
* notify_notification_update: * notify_notification_update:
@ -654,7 +636,6 @@ notify_notification_attach_to_widget(NotifyNotification *notification,
g_object_notify(G_OBJECT(notification), "attach-widget"); g_object_notify(G_OBJECT(notification), "attach-widget");
} }
#ifdef HAVE_STATUS_ICON
/** /**
* notify_notification_attach_to_status_icon: * notify_notification_attach_to_status_icon:
* @notification: The notification. * @notification: The notification.
@ -696,7 +677,6 @@ notify_notification_attach_to_status_icon(NotifyNotification *notification,
g_object_notify(G_OBJECT(notification), "status-icon"); g_object_notify(G_OBJECT(notification), "status-icon");
} }
#endif /* HAVE_STATUS_ICON */
/** /**
* notify_notification_set_geometry_hints: * notify_notification_set_geometry_hints: