Clean up lots of warnings.
This commit is contained in:
parent
83f6529c18
commit
fb513c854d
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
Mon Jan 09 10:15:57 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||
|
||||
* libnotify/Makefile.in:
|
||||
* libnotify/notify.c:
|
||||
* libnotify/notifynotification.c:
|
||||
* tests/test-default-action.c:
|
||||
* tests/test-image.c:
|
||||
* tests/test-multi-actions.c:
|
||||
* tests/test-replace-widget.c:
|
||||
* tests/test-xy-stress.c:
|
||||
- Clean up lots of warnings.
|
||||
|
||||
========================= 0.3.0 =========================
|
||||
|
||||
Tue Dec 13 2005 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* Release 0.3.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -15,6 +15,8 @@
|
|||
@SET_MAKE@
|
||||
|
||||
|
||||
SOURCES = $(libnotify_la_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
|
|
@ -46,6 +46,7 @@ static gchar *_app_name = NULL;
|
|||
# define format_func
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static void format_func
|
||||
print_error (char *message, ...)
|
||||
{
|
||||
|
@ -59,6 +60,7 @@ print_error (char *message, ...)
|
|||
fprintf (stderr, "%s(%d): libnotify: %s",
|
||||
(getenv ("_") ? getenv ("_") : ""), getpid (), buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
notify_init (const char *app_name)
|
||||
|
|
|
@ -474,11 +474,9 @@ _notify_notification_show_internal (NotifyNotification *notification,
|
|||
NotifyNotificationPrivate *priv;
|
||||
GError *tmp_error;
|
||||
gchar **action_array;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
|
||||
priv = notification->priv;
|
||||
|
||||
tmp_error = NULL;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE 1
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus.h>
|
||||
|
@ -59,7 +59,8 @@ main()
|
|||
|
||||
n = notify_notification_new ("Matt is online", "", NULL, NULL);
|
||||
notify_notification_set_timeout (n, NOTIFY_TIMEOUT_NEVER);
|
||||
notify_notification_add_action (n, "default", "Do Default Action", callback);
|
||||
notify_notification_add_action (n, "default", "Do Default Action",
|
||||
(NotifyActionCallback)callback);
|
||||
notify_notification_set_category (n, "presence.online");
|
||||
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE 1
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -42,26 +42,29 @@
|
|||
GMainLoop *loop;
|
||||
NotifyNotification *n;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char file[PATH_MAX];
|
||||
int size;
|
||||
char *uri;
|
||||
GdkPixbuf *icon;
|
||||
gchar *buf;
|
||||
gsize buf_size;
|
||||
GtkWidget *helper;
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
|
||||
if (!notify_init("Images Test")) exit(1);
|
||||
if (!notify_init("Images Test"))
|
||||
exit(1);
|
||||
|
||||
n = notify_notification_new ("Icon Test", "Testing stock icon", "stock_help", NULL);
|
||||
n = notify_notification_new("Icon Test", "Testing stock icon",
|
||||
"stock_help", NULL);
|
||||
|
||||
notify_notification_set_hint_int32(n, "x", 300);
|
||||
notify_notification_set_hint_int32(n, "y", 24);
|
||||
|
||||
notify_notification_set_timeout(n, NOTIFY_TIMEOUT_NEVER);
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
|
||||
if (!notify_notification_show(n, NULL))
|
||||
{
|
||||
fprintf(stderr, "failed to send notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -76,38 +79,41 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
notify_notification_update(n, "Alert!", "Testing URI icons", uri);
|
||||
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
if (!notify_notification_show(n, NULL))
|
||||
{
|
||||
fprintf(stderr, "failed to send notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_usleep(5000000); // 5 seconds
|
||||
|
||||
notify_notification_update (n, "Raw image test", "Testing sending raw pixbufs", NULL);
|
||||
notify_notification_update(n, "Raw image test",
|
||||
"Testing sending raw pixbufs", NULL);
|
||||
|
||||
/* This is just a hack to get a stock icon's pixbuf
|
||||
in a realworld app if you were sending bitmapped data
|
||||
you would know the file location and open it up with
|
||||
a method that could generate a bmp for you*/
|
||||
/*
|
||||
* This is just a hack to get a stock icon's pixbuf in a realworld app
|
||||
* if you were sending bitmapped data you would know the file location
|
||||
* and open it up with a method that could generate a bmp for you
|
||||
*/
|
||||
helper = gtk_button_new();
|
||||
icon = gtk_widget_render_icon(helper,
|
||||
GTK_STOCK_DIALOG_QUESTION,
|
||||
GTK_ICON_SIZE_DIALOG,
|
||||
"");
|
||||
|
||||
notify_notification_set_icon_data_from_pixbuf(n, icon);
|
||||
|
||||
notify_notification_set_icon_data_from_pixbuf (n,
|
||||
icon);
|
||||
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
if (!notify_notification_show(n, NULL))
|
||||
{
|
||||
fprintf(stderr, "failed to send notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
gtk_widget_destroy(helper);
|
||||
g_object_unref ((GObject *)icon);
|
||||
g_object_unref(G_OBJECT(icon));
|
||||
|
||||
g_usleep(5000000); // 5 seconds
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -23,22 +23,22 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE 1
|
||||
#define DBUS_API_SUBJECT_TO_CHANGE
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
|
||||
GMainLoop *loop;
|
||||
static GMainLoop *loop;
|
||||
|
||||
static void help_callback(NotifyNotification *n, const char *action)
|
||||
static void
|
||||
help_callback(NotifyNotification *n, const char *action)
|
||||
{
|
||||
assert( action != NULL );
|
||||
assert( strcmp (action, "help") == 0 );
|
||||
g_assert(action != NULL);
|
||||
g_assert(strcmp(action, "help") == 0);
|
||||
|
||||
printf("You clicked Help\n");
|
||||
|
||||
|
@ -47,10 +47,11 @@ static void help_callback(NotifyNotification *n, const char *action)
|
|||
g_main_loop_quit(loop);
|
||||
}
|
||||
|
||||
static void ignore_callback(NotifyNotification *n, const char *action)
|
||||
static void
|
||||
ignore_callback(NotifyNotification *n, const char *action)
|
||||
{
|
||||
assert( action != NULL );
|
||||
assert( strcmp (action, "ignore") == 0 );
|
||||
g_assert(action != NULL);
|
||||
g_assert(strcmp(action, "ignore") == 0);
|
||||
|
||||
printf("You clicked Ignore\n");
|
||||
|
||||
|
@ -59,11 +60,11 @@ static void ignore_callback(NotifyNotification *n, const char *action)
|
|||
g_main_loop_quit(loop);
|
||||
}
|
||||
|
||||
|
||||
static void empty_callback(NotifyNotification *n, const char *action)
|
||||
static void
|
||||
empty_callback(NotifyNotification *n, const char *action)
|
||||
{
|
||||
assert( action != NULL );
|
||||
assert( strcmp (action, "empty") == 0 );
|
||||
g_assert(action != NULL);
|
||||
g_assert(strcmp(action, "empty") == 0);
|
||||
|
||||
printf("You clicked Empty Trash\n");
|
||||
|
||||
|
@ -73,12 +74,16 @@ static void empty_callback(NotifyNotification *n, const char *action)
|
|||
}
|
||||
|
||||
|
||||
int main() {
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
NotifyNotification *n;
|
||||
DBusConnection *conn;
|
||||
|
||||
if (!notify_init("Multi Action Test")) exit(1);
|
||||
if (!notify_init("Multi Action Test"))
|
||||
exit(1);
|
||||
|
||||
DBusConnection *conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
|
||||
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
|
||||
loop = g_main_loop_new(NULL, FALSE);
|
||||
|
||||
dbus_connection_setup_with_g_main(conn, NULL);
|
||||
|
@ -88,12 +93,16 @@ int main() {
|
|||
"emptying the trash can.",
|
||||
NULL, NULL);
|
||||
notify_notification_set_timeout(n, NOTIFY_TIMEOUT_NEVER);
|
||||
notify_notification_add_action (n, "help", "Help", help_callback);
|
||||
notify_notification_add_action (n, "ignore", "Ignore", ignore_callback);
|
||||
notify_notification_add_action (n, "empty", "Empty Trash", empty_callback);
|
||||
notify_notification_add_action(n, "help", "Help",
|
||||
(NotifyActionCallback)help_callback);
|
||||
notify_notification_add_action(n, "ignore", "Ignore",
|
||||
(NotifyActionCallback)ignore_callback);
|
||||
notify_notification_add_action(n, "empty", "Empty Trash",
|
||||
(NotifyActionCallback)empty_callback);
|
||||
notify_notification_set_category(n, "device");
|
||||
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
if (!notify_notification_show(n, NULL))
|
||||
{
|
||||
fprintf(stderr, "failed to send notification\n");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
static int count = 0;
|
||||
|
||||
void on_exposed (GtkWidget *widget, GdkEventExpose *ev, void *user_data) {
|
||||
static void
|
||||
on_exposed(GtkWidget *widget, GdkEventExpose *ev, void *user_data)
|
||||
{
|
||||
NotifyNotification *n = NOTIFY_NOTIFICATION(user_data);
|
||||
|
||||
g_signal_handlers_disconnect_by_func(widget, on_exposed, user_data);
|
||||
|
@ -15,29 +16,27 @@ void on_exposed (GtkWidget *widget, GdkEventExpose *ev, void *user_data) {
|
|||
notify_notification_show(n, NULL);
|
||||
}
|
||||
|
||||
void on_clicked (GtkButton *button, void *user_data) {
|
||||
GError *error;
|
||||
static void
|
||||
on_clicked(GtkButton *button, void *user_data)
|
||||
{
|
||||
gchar *buf;
|
||||
NotifyNotification *n = NOTIFY_NOTIFICATION(user_data);
|
||||
|
||||
count++;
|
||||
buf = g_strdup_printf("You clicked the button %i times", count);
|
||||
|
||||
notify_notification_update (n, "Widget Attachment Test",
|
||||
buf, NULL);
|
||||
notify_notification_update(n, "Widget Attachment Test", buf, NULL);
|
||||
g_free(buf);
|
||||
|
||||
notify_notification_show(n, NULL);
|
||||
g_free (buf);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
NotifyNotification *n;
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
|
||||
GError *error;
|
||||
error = NULL;
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
notify_init("Replace Test");
|
||||
|
||||
|
@ -47,16 +46,19 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
gtk_widget_show_all(window);
|
||||
|
||||
|
||||
n = notify_notification_new ("Widget Attachment Test", "Button has not been clicked yet",
|
||||
n = notify_notification_new("Widget Attachment Test",
|
||||
"Button has not been clicked yet",
|
||||
NULL, //no icon
|
||||
button); //attach to button
|
||||
|
||||
|
||||
notify_notification_set_timeout(n, 0); //don't timeout
|
||||
|
||||
g_signal_connect (button, "clicked", (GCallback *)on_clicked, n);
|
||||
g_signal_connect_after (button, "expose-event", (GCallback *)on_exposed, n);
|
||||
g_signal_connect(G_OBJECT(button), "clicked",
|
||||
G_CALLBACK(on_clicked), n);
|
||||
g_signal_connect_after(G_OBJECT(button), "expose-event",
|
||||
G_CALLBACK(on_exposed), n);
|
||||
|
||||
gtk_main();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,40 +26,39 @@
|
|||
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
|
||||
static void
|
||||
_handle_closed (GObject *o)
|
||||
_handle_closed(GObject *obj)
|
||||
{
|
||||
g_message("closing");
|
||||
g_object_unref (o);
|
||||
g_object_unref(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_notification(int x, int y)
|
||||
{
|
||||
static char buffer[BUFSIZ];
|
||||
char *buffer;
|
||||
NotifyNotification *n;
|
||||
|
||||
g_snprintf(buffer, sizeof(buffer),
|
||||
"This notification should point to %d, %d.", x, y);
|
||||
buffer = g_strdup_printf("This notification should point to %d, %d.",
|
||||
x, y);
|
||||
|
||||
n = notify_notification_new ("X, Y Test",
|
||||
buffer,
|
||||
NULL, NULL);
|
||||
n = notify_notification_new("X, Y Test", buffer, NULL, NULL);
|
||||
g_free(buffer);
|
||||
|
||||
notify_notification_set_hint_int32(n, "x", x);
|
||||
notify_notification_set_hint_int32(n, "y", y);
|
||||
|
||||
g_signal_connect (n, "closed", _handle_closed, NULL);
|
||||
g_signal_connect(G_OBJECT(n), "closed",
|
||||
G_CALLBACK(_handle_closed), NULL);
|
||||
|
||||
if (!notify_notification_show (n, NULL)) {
|
||||
if (!notify_notification_show(n, NULL))
|
||||
fprintf(stderr, "failed to send notification\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_popup_random_bubble (void)
|
||||
_popup_random_bubble(gpointer unused)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkScreen *screen;
|
||||
|
@ -90,11 +89,12 @@ main(int argc, char **argv)
|
|||
notify_init("XY");
|
||||
|
||||
conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
|
||||
|
||||
dbus_connection_setup_with_g_main(conn, NULL);
|
||||
|
||||
g_timeout_add(1000, _popup_random_bubble, NULL);
|
||||
|
||||
loop = g_main_loop_new(NULL, FALSE);
|
||||
g_main_loop_run(loop);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue