Fixed to compile.
This commit is contained in:
parent
22e87adf07
commit
8ee064f00a
|
@ -1,3 +1,10 @@
|
||||||
|
Sat Sep 25 12:59:26 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* tests/test-animation.c:
|
||||||
|
* tests/test-default-action.c:
|
||||||
|
- Fixed to compile.
|
||||||
|
|
||||||
Wed Sep 01 00:39:23 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
Wed Sep 01 00:39:23 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
* docs/ChangeLog:
|
* docs/ChangeLog:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** -*- mode: c-mode; tab-width: 4; indent-tabs-mode: t; -*-
|
/* -*- mode: c-mode; tab-width: 4; indent-tabs-mode: t; -*- */
|
||||||
*
|
/**
|
||||||
* @file libnotify/notify.c Notifications library
|
* @file libnotify/notify.c Notifications library
|
||||||
*
|
*
|
||||||
* @Copyright (C) 2004 Christian Hammond <chipx86@chipx86.com>
|
* @Copyright (C) 2004 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
|
@ -35,17 +35,17 @@ int frames = 10;
|
||||||
GdkPixbuf **generate_animation()
|
GdkPixbuf **generate_animation()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
GdkPixbuf *file = gdk_pixbuf_new_from_file("applet-critical.png");
|
GdkPixbuf *file = gdk_pixbuf_new_from_file("applet-critical.png", NULL);
|
||||||
double alpha = 1.0;
|
double alpha = 1.0;
|
||||||
|
|
||||||
GdkPixbuf **array = malloc(sizeof(GdkPixbuf *) * frames);
|
GdkPixbuf **array = g_malloc(sizeof(GdkPixbuf *) * frames);
|
||||||
|
|
||||||
for (i = 0; i < frames; i++)
|
for (i = 0; i < frames; i++)
|
||||||
{
|
{
|
||||||
GdkPixbuf *buf = gdk_pixbuf_copy(file);
|
GdkPixbuf *buf = gdk_pixbuf_copy(file);
|
||||||
|
|
||||||
alpha = sin(M_PI + ((M_PI / frames) * i)) + 1.0;
|
alpha = sin(M_PI + ((M_PI / frames) * i)) + 1.0;
|
||||||
|
|
||||||
gdk_pixbuf_composite(file, buf, 0, 0,
|
gdk_pixbuf_composite(file, buf, 0, 0,
|
||||||
gdk_pixbuf_get_width(buf),
|
gdk_pixbuf_get_width(buf),
|
||||||
gdk_pixbuf_get_height(buf),
|
gdk_pixbuf_get_height(buf),
|
||||||
|
@ -54,17 +54,21 @@ GdkPixbuf **generate_animation()
|
||||||
|
|
||||||
array[i] = buf;
|
array[i] = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
notify_init("Animations");
|
notify_init("Animations");
|
||||||
|
|
||||||
for (int i = 0; i < frames; i++)
|
for (i = 0; i < frames; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyHandle *n = notify_send_notification(NULL, // replaces nothing
|
NotifyHandle *n = notify_send_notification(NULL, // replaces nothing
|
||||||
NOTIFY_URGENCY_NORMAL,
|
NOTIFY_URGENCY_NORMAL,
|
||||||
"Summary", "Content",
|
"Summary", "Content",
|
||||||
|
|
|
@ -30,9 +30,10 @@
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
#include <dbus/dbus-glib.h>
|
#include <dbus/dbus-glib.h>
|
||||||
|
#include <dbus/dbus-glib-lowlevel.h>
|
||||||
|
|
||||||
GMainLoop *loop;
|
static GMainLoop *loop;
|
||||||
NotifyHandle *n;
|
static NotifyHandle *n;
|
||||||
|
|
||||||
static void callback(NotifyHandle *handle, guint32 uid, void *user_data)
|
static void callback(NotifyHandle *handle, guint32 uid, void *user_data)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +51,7 @@ int main() {
|
||||||
loop = g_main_loop_new(NULL, FALSE);
|
loop = g_main_loop_new(NULL, FALSE);
|
||||||
|
|
||||||
dbus_connection_setup_with_g_main(conn, NULL);
|
dbus_connection_setup_with_g_main(conn, NULL);
|
||||||
|
|
||||||
n = notify_send_notification(NULL, // replaces nothing
|
n = notify_send_notification(NULL, // replaces nothing
|
||||||
NOTIFY_URGENCY_NORMAL,
|
NOTIFY_URGENCY_NORMAL,
|
||||||
"Matt is online", NULL,
|
"Matt is online", NULL,
|
||||||
|
|
Loading…
Reference in New Issue