Lines 42-57
Link Here
|
42 |
#include "nsNetUtil.h" |
42 |
#include "nsNetUtil.h" |
43 |
#include "nsIImageToPixbuf.h" |
43 |
#include "nsIImageToPixbuf.h" |
44 |
#include "nsIStringBundle.h" |
44 |
#include "nsIStringBundle.h" |
45 |
|
45 |
|
46 |
#include <gdk-pixbuf/gdk-pixbuf.h> |
46 |
#include <gdk-pixbuf/gdk-pixbuf.h> |
47 |
#include <libnotify/notify.h> |
47 |
#include <libnotify/notify.h> |
48 |
#include <gdk/gdk.h> |
48 |
#include <gdk/gdk.h> |
49 |
|
49 |
|
|
|
50 |
// Compatibility macro for <libnotify-0.7 |
51 |
#ifndef NOTIFY_CHECK_VERSION |
52 |
#define NOTIFY_CHECK_VERSION(x,y,z) 0 |
53 |
#endif |
54 |
|
50 |
static PRBool gHasActions = PR_FALSE; |
55 |
static PRBool gHasActions = PR_FALSE; |
51 |
|
56 |
|
52 |
static void notify_action_cb(NotifyNotification *notification, |
57 |
static void notify_action_cb(NotifyNotification *notification, |
53 |
gchar *action, gpointer user_data) |
58 |
gchar *action, gpointer user_data) |
54 |
{ |
59 |
{ |
55 |
nsAlertsIconListener* alert = static_cast<nsAlertsIconListener*> (user_data); |
60 |
nsAlertsIconListener* alert = static_cast<nsAlertsIconListener*> (user_data); |
56 |
alert->SendCallback(); |
61 |
alert->SendCallback(); |
57 |
} |
62 |
} |
Lines 199-215
nsAlertsIconListener::OnStopFrame(imgIRe
Link Here
|
199 |
return NS_OK; |
204 |
return NS_OK; |
200 |
} |
205 |
} |
201 |
|
206 |
|
202 |
nsresult |
207 |
nsresult |
203 |
nsAlertsIconListener::ShowAlert(GdkPixbuf* aPixbuf) |
208 |
nsAlertsIconListener::ShowAlert(GdkPixbuf* aPixbuf) |
204 |
{ |
209 |
{ |
205 |
NotifyNotification* notify = notify_notification_new(mAlertTitle.get(), |
210 |
NotifyNotification* notify = notify_notification_new(mAlertTitle.get(), |
206 |
mAlertText.get(), |
211 |
mAlertText.get(), |
207 |
NULL, NULL); |
212 |
NULL |
|
|
213 |
// >=libnotify-0.7.0 has no support for attaching to widgets |
214 |
#if !NOTIFY_CHECK_VERSION(0,7,0) |
215 |
, NULL |
216 |
#endif |
217 |
); |
218 |
|
208 |
if (!notify) |
219 |
if (!notify) |
209 |
return NS_ERROR_OUT_OF_MEMORY; |
220 |
return NS_ERROR_OUT_OF_MEMORY; |
210 |
|
221 |
|
211 |
if (aPixbuf) |
222 |
if (aPixbuf) |
212 |
notify_notification_set_icon_from_pixbuf(notify, aPixbuf); |
223 |
notify_notification_set_icon_from_pixbuf(notify, aPixbuf); |
213 |
|
224 |
|
214 |
NS_ADDREF(this); |
225 |
NS_ADDREF(this); |
215 |
if (mAlertHasAction) { |
226 |
if (mAlertHasAction) { |