Remove the ability to attach notifications to widgets or positions
This commit is contained in:
parent
3f14ad4c71
commit
27e05d0f95
|
@ -0,0 +1,43 @@
|
||||||
|
<!-- ##### ARG NotifyNotification:status-icon ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION notify_notification_attach_to_status_icon ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@notification:
|
||||||
|
@status_icon:
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION notify_notification_attach_to_widget ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@notification:
|
||||||
|
@attach:
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION notify_notification_new_with_status_icon ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@summary:
|
||||||
|
@body:
|
||||||
|
@icon:
|
||||||
|
@status_icon:
|
||||||
|
@Returns:
|
||||||
|
|
||||||
|
<!-- ##### FUNCTION notify_notification_set_geometry_hints ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@notification:
|
||||||
|
@screen:
|
||||||
|
@x:
|
||||||
|
@y:
|
||||||
|
|
|
@ -79,11 +79,6 @@ not be used directly. Use the accessor functions below.
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<!-- ##### ARG NotifyNotification:status-icon ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<!-- ##### ARG NotifyNotification:summary ##### -->
|
<!-- ##### ARG NotifyNotification:summary ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
@ -132,19 +127,6 @@ is much like G_CALLBACK().
|
||||||
@summary:
|
@summary:
|
||||||
@body:
|
@body:
|
||||||
@icon:
|
@icon:
|
||||||
@attach:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION notify_notification_new_with_status_icon ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@summary:
|
|
||||||
@body:
|
|
||||||
@icon:
|
|
||||||
@status_icon:
|
|
||||||
@Returns:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,35 +142,6 @@ is much like G_CALLBACK().
|
||||||
@Returns:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION notify_notification_attach_to_widget ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@notification:
|
|
||||||
@attach:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION notify_notification_attach_to_status_icon ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@notification:
|
|
||||||
@status_icon:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION notify_notification_set_geometry_hints ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@notification:
|
|
||||||
@screen:
|
|
||||||
@x:
|
|
||||||
@y:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION notify_notification_show ##### -->
|
<!-- ##### FUNCTION notify_notification_show ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
|
|
@ -79,8 +79,6 @@ struct _NotifyNotificationPrivate
|
||||||
GHashTable *action_map;
|
GHashTable *action_map;
|
||||||
GHashTable *hints;
|
GHashTable *hints;
|
||||||
|
|
||||||
GtkWidget *attached_widget;
|
|
||||||
|
|
||||||
gboolean has_nondefault_actions;
|
gboolean has_nondefault_actions;
|
||||||
gboolean updates_pending;
|
gboolean updates_pending;
|
||||||
gboolean signals_registered;
|
gboolean signals_registered;
|
||||||
|
@ -101,7 +99,6 @@ enum
|
||||||
PROP_SUMMARY,
|
PROP_SUMMARY,
|
||||||
PROP_BODY,
|
PROP_BODY,
|
||||||
PROP_ICON_NAME,
|
PROP_ICON_NAME,
|
||||||
PROP_ATTACH_WIDGET,
|
|
||||||
PROP_CLOSED_REASON
|
PROP_CLOSED_REASON
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,18 +210,6 @@ notify_notification_class_init (NotifyNotificationClass *klass)
|
||||||
| G_PARAM_STATIC_NICK
|
| G_PARAM_STATIC_NICK
|
||||||
| G_PARAM_STATIC_BLURB));
|
| G_PARAM_STATIC_BLURB));
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
|
||||||
PROP_ATTACH_WIDGET,
|
|
||||||
g_param_spec_object ("attach-widget",
|
|
||||||
"Attach Widget",
|
|
||||||
"The widget to attach the notification to",
|
|
||||||
GTK_TYPE_WIDGET,
|
|
||||||
G_PARAM_READWRITE
|
|
||||||
| G_PARAM_CONSTRUCT
|
|
||||||
| G_PARAM_STATIC_NAME
|
|
||||||
| G_PARAM_STATIC_NICK
|
|
||||||
| G_PARAM_STATIC_BLURB));
|
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_CLOSED_REASON,
|
PROP_CLOSED_REASON,
|
||||||
g_param_spec_int ("closed-reason",
|
g_param_spec_int ("closed-reason",
|
||||||
|
@ -274,11 +259,6 @@ notify_notification_set_property (GObject *object,
|
||||||
g_value_get_string (value));
|
g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ATTACH_WIDGET:
|
|
||||||
notify_notification_attach_to_widget (notification,
|
|
||||||
g_value_get_object (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -311,10 +291,6 @@ notify_notification_get_property (GObject *object,
|
||||||
g_value_set_string (value, priv->icon_name);
|
g_value_set_string (value, priv->icon_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_ATTACH_WIDGET:
|
|
||||||
g_value_set_object (value, priv->attached_widget);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_CLOSED_REASON:
|
case PROP_CLOSED_REASON:
|
||||||
g_value_set_int (value, priv->closed_reason);
|
g_value_set_int (value, priv->closed_reason);
|
||||||
break;
|
break;
|
||||||
|
@ -400,9 +376,6 @@ notify_notification_finalize (GObject *object)
|
||||||
if (priv->hints != NULL)
|
if (priv->hints != NULL)
|
||||||
g_hash_table_destroy (priv->hints);
|
g_hash_table_destroy (priv->hints);
|
||||||
|
|
||||||
if (priv->attached_widget != NULL)
|
|
||||||
g_object_unref (G_OBJECT (priv->attached_widget));
|
|
||||||
|
|
||||||
proxy = _notify_get_g_proxy ();
|
proxy = _notify_get_g_proxy ();
|
||||||
if (proxy != NULL && priv->signals_registered) {
|
if (proxy != NULL && priv->signals_registered) {
|
||||||
g_signal_handlers_disconnect_by_func (proxy,
|
g_signal_handlers_disconnect_by_func (proxy,
|
||||||
|
@ -424,42 +397,11 @@ notify_notification_finalize (GObject *object)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_notify_notification_update_applet_hints (NotifyNotification *n)
|
|
||||||
{
|
|
||||||
NotifyNotificationPrivate *priv = n->priv;
|
|
||||||
GdkScreen *screen = NULL;
|
|
||||||
gint x, y;
|
|
||||||
|
|
||||||
if (priv->attached_widget != NULL) {
|
|
||||||
GtkWidget *widget = priv->attached_widget;
|
|
||||||
GtkAllocation allocation;
|
|
||||||
|
|
||||||
screen = gtk_widget_get_screen (widget);
|
|
||||||
|
|
||||||
gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
|
||||||
|
|
||||||
if (!gtk_widget_get_has_window (widget)) {
|
|
||||||
x += allocation.x;
|
|
||||||
y += allocation.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
x += allocation.width / 2;
|
|
||||||
y += allocation.height / 2;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notify_notification_set_geometry_hints (n, screen, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify_notification_new:
|
* notify_notification_new:
|
||||||
* @summary: The required summary text.
|
* @summary: The required summary text.
|
||||||
* @body: The optional body text.
|
* @body: The optional body text.
|
||||||
* @icon: The optional icon theme icon name or filename.
|
* @icon: The optional icon theme icon name or filename.
|
||||||
* @attach: The optional widget to attach to.
|
|
||||||
*
|
*
|
||||||
* Creates a new #NotifyNotification. The summary text is required, but
|
* Creates a new #NotifyNotification. The summary text is required, but
|
||||||
* all other parameters are optional.
|
* all other parameters are optional.
|
||||||
|
@ -469,16 +411,12 @@ _notify_notification_update_applet_hints (NotifyNotification *n)
|
||||||
NotifyNotification *
|
NotifyNotification *
|
||||||
notify_notification_new (const char *summary,
|
notify_notification_new (const char *summary,
|
||||||
const char *body,
|
const char *body,
|
||||||
const char *icon,
|
const char *icon)
|
||||||
GtkWidget *attach)
|
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (attach == NULL || GTK_IS_WIDGET (attach), NULL);
|
|
||||||
|
|
||||||
return g_object_new (NOTIFY_TYPE_NOTIFICATION,
|
return g_object_new (NOTIFY_TYPE_NOTIFICATION,
|
||||||
"summary", summary,
|
"summary", summary,
|
||||||
"body", body,
|
"body", body,
|
||||||
"icon-name", icon,
|
"icon-name", icon,
|
||||||
"attach-widget", attach,
|
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,69 +468,6 @@ notify_notification_update (NotifyNotification *notification,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* notify_notification_attach_to_widget:
|
|
||||||
* @notification: The notification.
|
|
||||||
* @attach: The widget to attach to, or %NULL.
|
|
||||||
*
|
|
||||||
* Attaches the notification to a widget. This will set hints on the
|
|
||||||
* notification requesting that the notification point to the widget's
|
|
||||||
* location. If @attach is %NULL, the widget will be unset.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
notify_notification_attach_to_widget (NotifyNotification *notification,
|
|
||||||
GtkWidget *attach)
|
|
||||||
{
|
|
||||||
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
|
||||||
|
|
||||||
if (notification->priv->attached_widget == attach)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (notification->priv->attached_widget != NULL)
|
|
||||||
g_object_unref (notification->priv->attached_widget);
|
|
||||||
|
|
||||||
notification->priv->attached_widget =
|
|
||||||
(attach != NULL ? g_object_ref (attach) : NULL);
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (notification), "attach-widget");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* notify_notification_set_geometry_hints:
|
|
||||||
* @notification: The notification.
|
|
||||||
* @screen: The #GdkScreen the notification should appear on.
|
|
||||||
* @x: The X coordinate to point to.
|
|
||||||
* @y: The Y coordinate to point to.
|
|
||||||
*
|
|
||||||
* Sets the geometry hints on the notification. This sets the screen
|
|
||||||
* the notification should appear on and the X, Y coordinates it should
|
|
||||||
* point to, if the particular notification supports X, Y hints.
|
|
||||||
*
|
|
||||||
* Since: 0.4.1
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
notify_notification_set_geometry_hints (NotifyNotification *notification,
|
|
||||||
GdkScreen *screen,
|
|
||||||
gint x,
|
|
||||||
gint y)
|
|
||||||
{
|
|
||||||
char *display_name;
|
|
||||||
|
|
||||||
g_return_if_fail (notification != NULL);
|
|
||||||
g_return_if_fail (NOTIFY_IS_NOTIFICATION (notification));
|
|
||||||
g_return_if_fail (screen != NULL);
|
|
||||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
|
||||||
|
|
||||||
notify_notification_set_hint_int32 (notification, "x", x);
|
|
||||||
notify_notification_set_hint_int32 (notification, "y", y);
|
|
||||||
|
|
||||||
display_name = gdk_screen_make_display_name (screen);
|
|
||||||
notify_notification_set_hint_string (notification,
|
|
||||||
"xdisplay",
|
|
||||||
display_name);
|
|
||||||
g_free (display_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_close_signal_handler (DBusGProxy *proxy,
|
_close_signal_handler (DBusGProxy *proxy,
|
||||||
guint32 id,
|
guint32 id,
|
||||||
|
@ -703,9 +578,6 @@ notify_notification_show (NotifyNotification *notification,
|
||||||
priv->signals_registered = TRUE;
|
priv->signals_registered = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If attached to a widget, modify x and y in hints */
|
|
||||||
_notify_notification_update_applet_hints (notification);
|
|
||||||
|
|
||||||
action_array = _gslist_to_string_array (priv->actions);
|
action_array = _gslist_to_string_array (priv->actions);
|
||||||
|
|
||||||
/* TODO: make this nonblocking */
|
/* TODO: make this nonblocking */
|
||||||
|
|
|
@ -78,22 +78,13 @@ GType notify_notification_get_type (void);
|
||||||
|
|
||||||
NotifyNotification *notify_notification_new (const char *summary,
|
NotifyNotification *notify_notification_new (const char *summary,
|
||||||
const char *body,
|
const char *body,
|
||||||
const char *icon,
|
const char *icon);
|
||||||
GtkWidget *attach);
|
|
||||||
|
|
||||||
gboolean notify_notification_update (NotifyNotification *notification,
|
gboolean notify_notification_update (NotifyNotification *notification,
|
||||||
const char *summary,
|
const char *summary,
|
||||||
const char *body,
|
const char *body,
|
||||||
const char *icon);
|
const char *icon);
|
||||||
|
|
||||||
void notify_notification_attach_to_widget (NotifyNotification *notification,
|
|
||||||
GtkWidget *attach);
|
|
||||||
|
|
||||||
void notify_notification_set_geometry_hints (NotifyNotification *notification,
|
|
||||||
GdkScreen *screen,
|
|
||||||
gint x,
|
|
||||||
gint y);
|
|
||||||
|
|
||||||
gboolean notify_notification_show (NotifyNotification *notification,
|
gboolean notify_notification_show (NotifyNotification *notification,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ main ()
|
||||||
/* Long summary */
|
/* Long summary */
|
||||||
n = notify_notification_new ("Summary that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
n = notify_notification_new ("Summary that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
||||||
"Content",
|
"Content",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
|
@ -48,7 +47,6 @@ main ()
|
||||||
/* Long message */
|
/* Long message */
|
||||||
n = notify_notification_new ("Summary",
|
n = notify_notification_new ("Summary",
|
||||||
"Content that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
"Content that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
|
@ -61,7 +59,6 @@ main ()
|
||||||
|
|
||||||
/* Summary only */
|
/* Summary only */
|
||||||
n = notify_notification_new ("Summary only there is no message content",
|
n = notify_notification_new ("Summary only there is no message content",
|
||||||
NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, NOTIFY_EXPIRES_NEVER);
|
notify_notification_set_timeout (n, NOTIFY_EXPIRES_NEVER);
|
||||||
|
|
|
@ -64,7 +64,7 @@ main ()
|
||||||
|
|
||||||
dbus_connection_setup_with_g_main (conn, NULL);
|
dbus_connection_setup_with_g_main (conn, NULL);
|
||||||
|
|
||||||
n = notify_notification_new ("Matt is online", "", NULL, NULL);
|
n = notify_notification_new ("Matt is online", "", NULL);
|
||||||
notify_notification_set_timeout (n, NOTIFY_EXPIRES_DEFAULT);
|
notify_notification_set_timeout (n, NOTIFY_EXPIRES_DEFAULT);
|
||||||
notify_notification_add_action (n,
|
notify_notification_add_action (n,
|
||||||
"default",
|
"default",
|
||||||
|
|
|
@ -33,7 +33,7 @@ main ()
|
||||||
|
|
||||||
notify_init ("Error Handling");
|
notify_init ("Error Handling");
|
||||||
|
|
||||||
n = notify_notification_new ("Summary", "Content", NULL, NULL);
|
n = notify_notification_new ("Summary", "Content", NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
/* TODO: Create an error condition */
|
/* TODO: Create an error condition */
|
||||||
|
|
|
@ -34,7 +34,6 @@ main ()
|
||||||
/* Long summary */
|
/* Long summary */
|
||||||
n = notify_notification_new ("Summary that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
n = notify_notification_new ("Summary that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
||||||
"Content",
|
"Content",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
|
@ -48,7 +47,6 @@ main ()
|
||||||
/* Long message */
|
/* Long message */
|
||||||
n = notify_notification_new ("Summary",
|
n = notify_notification_new ("Summary",
|
||||||
"Content that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
"Content that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
|
@ -61,7 +59,6 @@ main ()
|
||||||
|
|
||||||
/* Summary only */
|
/* Summary only */
|
||||||
n = notify_notification_new ("Summary only there is no message content",
|
n = notify_notification_new ("Summary only there is no message content",
|
||||||
NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
|
@ -59,8 +59,7 @@ main (int argc, char *argv[])
|
||||||
/* Stock icon */
|
/* Stock icon */
|
||||||
n = notify_notification_new ("Icon Test",
|
n = notify_notification_new ("Icon Test",
|
||||||
"Testing stock icon",
|
"Testing stock icon",
|
||||||
"appointment-new",
|
"appointment-new");
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (!notify_notification_show (n, NULL)) {
|
if (!notify_notification_show (n, NULL)) {
|
||||||
fprintf (stderr, "failed to send notification\n");
|
fprintf (stderr, "failed to send notification\n");
|
||||||
|
@ -80,8 +79,7 @@ main (int argc, char *argv[])
|
||||||
/* URIs */
|
/* URIs */
|
||||||
n = notify_notification_new ("Alert!",
|
n = notify_notification_new ("Alert!",
|
||||||
"Testing URI icons",
|
"Testing URI icons",
|
||||||
uri,
|
uri);
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (!notify_notification_show (n, NULL)) {
|
if (!notify_notification_show (n, NULL)) {
|
||||||
fprintf (stderr, "failed to send notification\n");
|
fprintf (stderr, "failed to send notification\n");
|
||||||
|
@ -93,7 +91,6 @@ main (int argc, char *argv[])
|
||||||
/* Raw image */
|
/* Raw image */
|
||||||
n = notify_notification_new ("Raw image test",
|
n = notify_notification_new ("Raw image test",
|
||||||
"Testing sending raw pixbufs",
|
"Testing sending raw pixbufs",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -34,7 +34,6 @@ main ()
|
||||||
n = notify_notification_new ("Summary",
|
n = notify_notification_new ("Summary",
|
||||||
"Some <b>bold</b>, <u>underlined</u>, <i>italic</i>, "
|
"Some <b>bold</b>, <u>underlined</u>, <i>italic</i>, "
|
||||||
"<a href='http://www.google.com'>linked</a> text",
|
"<a href='http://www.google.com'>linked</a> text",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000); //3 seconds
|
notify_notification_set_timeout (n, 3000); //3 seconds
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,6 @@ main (int argc, char **argv)
|
||||||
n = notify_notification_new ("Low disk space",
|
n = notify_notification_new ("Low disk space",
|
||||||
"You can free up some disk space by "
|
"You can free up some disk space by "
|
||||||
"emptying the trash can.",
|
"emptying the trash can.",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_urgency (n, NOTIFY_URGENCY_CRITICAL);
|
notify_notification_set_urgency (n, NOTIFY_URGENCY_CRITICAL);
|
||||||
notify_notification_set_timeout (n, NOTIFY_EXPIRES_DEFAULT);
|
notify_notification_set_timeout (n, NOTIFY_EXPIRES_DEFAULT);
|
||||||
|
|
|
@ -67,8 +67,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
n = notify_notification_new ("Software Updates Available",
|
n = notify_notification_new ("Software Updates Available",
|
||||||
"Important updates for your apps are now available.",
|
"Important updates for your apps are now available.",
|
||||||
"software-update-available",
|
"software-update-available");
|
||||||
NULL);
|
|
||||||
notify_notification_add_action (n,
|
notify_notification_add_action (n,
|
||||||
"install",
|
"install",
|
||||||
"Install now",
|
"Install now",
|
||||||
|
|
|
@ -74,8 +74,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
n = notify_notification_new ("Widget Attachment Test",
|
n = notify_notification_new ("Widget Attachment Test",
|
||||||
"Button has not been clicked yet",
|
"Button has not been clicked yet",
|
||||||
NULL, //no icon
|
NULL); //no icon
|
||||||
button); //attach to button
|
|
||||||
|
|
||||||
notify_notification_set_timeout (n, 0); //don't timeout
|
notify_notification_set_timeout (n, 0); //don't timeout
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,7 @@ main ()
|
||||||
|
|
||||||
n = notify_notification_new ("Summary",
|
n = notify_notification_new ("Summary",
|
||||||
"First message",
|
"First message",
|
||||||
NULL, //no icon
|
NULL); //no icon
|
||||||
NULL); //don't attach to widget
|
|
||||||
|
|
||||||
|
|
||||||
notify_notification_set_timeout (n, 0); //don't timeout
|
notify_notification_set_timeout (n, 0); //don't timeout
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ main ()
|
||||||
|
|
||||||
n = notify_notification_new ("اختبار",
|
n = notify_notification_new ("اختبار",
|
||||||
"يوفر ويكي عربآيز مناخا للنقاش وتبادل الخبرات والمعرفة حول اللغة العربية ولسانياتها ومايتعلّق بدعمها والإرتقاء بها في الحوسبة عموماً والبرمجيات الحرة على وجه الخصوص. هذا الويكي عبارة عن بيئة تعاونية تشاركية مفتوحة للجميع بدون قيود، لغتنا الجميلة بانتظار مساهمتك فلا تبخل عليها ",
|
"يوفر ويكي عربآيز مناخا للنقاش وتبادل الخبرات والمعرفة حول اللغة العربية ولسانياتها ومايتعلّق بدعمها والإرتقاء بها في الحوسبة عموماً والبرمجيات الحرة على وجه الخصوص. هذا الويكي عبارة عن بيئة تعاونية تشاركية مفتوحة للجميع بدون قيود، لغتنا الجميلة بانتظار مساهمتك فلا تبخل عليها ",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n, 3000);
|
notify_notification_set_timeout (n, 3000);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ main ()
|
||||||
|
|
||||||
n1 = notify_notification_new ("Notification 1",
|
n1 = notify_notification_new ("Notification 1",
|
||||||
"Notification number 1!",
|
"Notification number 1!",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n1, 7000);
|
notify_notification_set_timeout (n1, 7000);
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ main ()
|
||||||
|
|
||||||
n2 = notify_notification_new ("Notification 2",
|
n2 = notify_notification_new ("Notification 2",
|
||||||
"Notification number 2!",
|
"Notification number 2!",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n2, 7000);
|
notify_notification_set_timeout (n2, 7000);
|
||||||
|
|
||||||
|
@ -58,7 +56,6 @@ main ()
|
||||||
|
|
||||||
n3 = notify_notification_new ("Notification 3",
|
n3 = notify_notification_new ("Notification 3",
|
||||||
"Notification number 3!",
|
"Notification number 3!",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_timeout (n3, 7000);
|
notify_notification_set_timeout (n3, 7000);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
n = notify_notification_new ("Low Urgency",
|
n = notify_notification_new ("Low Urgency",
|
||||||
"Joe signed online.",
|
"Joe signed online.",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_urgency (n, NOTIFY_URGENCY_LOW);
|
notify_notification_set_urgency (n, NOTIFY_URGENCY_LOW);
|
||||||
if (!notify_notification_show (n, NULL)) {
|
if (!notify_notification_show (n, NULL)) {
|
||||||
|
@ -45,7 +44,6 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
n = notify_notification_new ("Normal Urgency",
|
n = notify_notification_new ("Normal Urgency",
|
||||||
"You have a meeting in 10 minutes.",
|
"You have a meeting in 10 minutes.",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_urgency (n, NOTIFY_URGENCY_NORMAL);
|
notify_notification_set_urgency (n, NOTIFY_URGENCY_NORMAL);
|
||||||
if (!notify_notification_show (n, NULL)) {
|
if (!notify_notification_show (n, NULL)) {
|
||||||
|
@ -57,9 +55,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
|
|
||||||
n = notify_notification_new ("Critical Urgency",
|
n = notify_notification_new ("Critical Urgency",
|
||||||
"This message will self-destruct in 10 "
|
"This message will self-destruct in 10 seconds.",
|
||||||
"seconds.",
|
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
notify_notification_set_urgency (n, NOTIFY_URGENCY_CRITICAL);
|
notify_notification_set_urgency (n, NOTIFY_URGENCY_CRITICAL);
|
||||||
notify_notification_set_timeout (n, 10000); // 10 seconds
|
notify_notification_set_timeout (n, 10000); // 10 seconds
|
||||||
|
|
|
@ -56,7 +56,6 @@ main (int argc, char **argv)
|
||||||
n = notify_notification_new ("System update available",
|
n = notify_notification_new ("System update available",
|
||||||
"New system updates are available. It is "
|
"New system updates are available. It is "
|
||||||
"recommended that you install the updates.",
|
"recommended that you install the updates.",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
notify_notification_set_hint_int32 (n, "x", 600);
|
notify_notification_set_hint_int32 (n, "x", 600);
|
||||||
|
|
|
@ -42,7 +42,7 @@ emit_notification (int x, int y)
|
||||||
x,
|
x,
|
||||||
y);
|
y);
|
||||||
|
|
||||||
n = notify_notification_new ("X, Y Test", buffer, NULL, NULL);
|
n = notify_notification_new ("X, Y Test", buffer, NULL);
|
||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
|
|
||||||
notify_notification_set_hint_int32 (n, "x", x);
|
notify_notification_set_hint_int32 (n, "x", x);
|
||||||
|
|
|
@ -33,7 +33,6 @@ main ()
|
||||||
|
|
||||||
n = notify_notification_new ("X, Y Test",
|
n = notify_notification_new ("X, Y Test",
|
||||||
"This notification should point to 150, 10",
|
"This notification should point to 150, 10",
|
||||||
NULL,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
notify_notification_set_hint_int32 (n, "x", 150);
|
notify_notification_set_hint_int32 (n, "x", 150);
|
||||||
|
|
|
@ -221,8 +221,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
notify = notify_notification_new (summary,
|
notify = notify_notification_new (summary,
|
||||||
body,
|
body,
|
||||||
icon_str,
|
icon_str);
|
||||||
NULL);
|
|
||||||
notify_notification_set_category (notify, type);
|
notify_notification_set_category (notify, type);
|
||||||
notify_notification_set_urgency (notify, urgency);
|
notify_notification_set_urgency (notify, urgency);
|
||||||
notify_notification_set_timeout (notify, expire_timeout);
|
notify_notification_set_timeout (notify, expire_timeout);
|
||||||
|
|
Loading…
Reference in New Issue