Fixed the coding style.
This commit is contained in:
parent
3b0e8d2986
commit
fd53ececa2
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Thu Jan 19 21:55:08 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
|
* libnotify/dbus-compat.h:
|
||||||
|
* libnotify/notify.c:
|
||||||
|
* libnotify/notifycommon.h:
|
||||||
|
* libnotify/notify.h:
|
||||||
|
* libnotify/notifynotification.c:
|
||||||
|
* libnotify/notifynotification.h:
|
||||||
|
- Fixed the coding style.
|
||||||
|
|
||||||
Thu Jan 19 01:34:57 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
Thu Jan 19 01:34:57 PST 2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
|
|
||||||
* tools/notify-send.c:
|
* tools/notify-send.c:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file libnotify/dbus-compat.h Private D-BUS Compatibility API
|
* @file libnotify/dbus-compat.h Private D-BUS Compatibility API
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/* -*- 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-2006 Christian Hammond <chipx86@chipx86.com>
|
||||||
* @Copyright (C) 2004 Mike Hearn <mike@navi.cx>
|
* @Copyright (C) 2004-2006 Mike Hearn <mike@navi.cx>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -50,65 +49,65 @@ static DBusGProxy *_proxy = NULL;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void format_func
|
static void format_func
|
||||||
print_error (char *message, ...)
|
print_error(char *message, ...)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start (args, message);
|
va_start(args, message);
|
||||||
vsnprintf (buf, sizeof (buf), message, args);
|
vsnprintf(buf, sizeof(buf), message, args);
|
||||||
va_end (args);
|
va_end(args);
|
||||||
|
|
||||||
fprintf (stderr, "%s(%d): libnotify: %s",
|
fprintf(stderr, "%s(%d): libnotify: %s",
|
||||||
(getenv ("_") ? getenv ("_") : ""), getpid (), buf);
|
(getenv("_") ? getenv("_") : ""), getpid(), buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
notify_init (const char *app_name)
|
notify_init(const char *app_name)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (app_name != NULL, FALSE);
|
g_return_val_if_fail(app_name != NULL, FALSE);
|
||||||
g_return_val_if_fail (*app_name != '\0', FALSE);
|
g_return_val_if_fail(*app_name != '\0', FALSE);
|
||||||
|
|
||||||
if (_initted)
|
if (_initted)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
_app_name = g_strdup (app_name);
|
_app_name = g_strdup(app_name);
|
||||||
|
|
||||||
g_type_init ();
|
g_type_init();
|
||||||
|
|
||||||
#ifdef HAVE_ATEXIT
|
#ifdef HAVE_ATEXIT
|
||||||
atexit (notify_uninit);
|
atexit(notify_uninit);
|
||||||
#endif /* HAVE_ATEXIT */
|
#endif /* HAVE_ATEXIT */
|
||||||
|
|
||||||
_initted = TRUE;
|
_initted = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
notify_get_app_name (void)
|
notify_get_app_name(void)
|
||||||
{
|
{
|
||||||
return _app_name;
|
return _app_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
notify_uninit (void)
|
notify_uninit(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_app_name != NULL)
|
if (_app_name != NULL)
|
||||||
{
|
{
|
||||||
g_free (_app_name);
|
g_free(_app_name);
|
||||||
_app_name = NULL;
|
_app_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: keep track of all notifications and destroy them here? */
|
/* TODO: keep track of all notifications and destroy them here? */
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
notify_is_initted (void)
|
notify_is_initted(void)
|
||||||
{
|
{
|
||||||
return _initted;
|
return _initted;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DBusGProxy *
|
static DBusGProxy *
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
/* -*- mode: c-mode; tab-width: 4; indent-tabs-mode: t; -*- */
|
|
||||||
/**
|
/**
|
||||||
* @file libnotify/notify.h Notifications library
|
* @file libnotify/notify.h Notifications library
|
||||||
*
|
*
|
||||||
* @Copyright (C) 2004 Christian Hammond
|
* @Copyright (C) 2004-2006 Christian Hammond
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIBNOTIFY_NOTIFY_H_
|
#ifndef _LIBNOTIFY_NOTIFY_H_
|
||||||
#define _LIBNOTIFY_NOTIFY_H_
|
#define _LIBNOTIFY_NOTIFY_H_
|
||||||
|
|
||||||
|
@ -58,6 +56,11 @@ void notify_uninit(void);
|
||||||
*/
|
*/
|
||||||
gboolean notify_is_initted(void);
|
gboolean notify_is_initted(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the application set when notify_init() was called.
|
||||||
|
*
|
||||||
|
* @return The name of the application.
|
||||||
|
*/
|
||||||
const gchar *notify_get_app_name(void);
|
const gchar *notify_get_app_name(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,8 +82,10 @@ GList *notify_get_server_caps(void);
|
||||||
*
|
*
|
||||||
* @return TRUE if the call succeeded, or FALSE if there were errors.
|
* @return TRUE if the call succeeded, or FALSE if there were errors.
|
||||||
*/
|
*/
|
||||||
gboolean notify_get_server_info(char **ret_name, char **ret_vendor,
|
gboolean notify_get_server_info(char **ret_name,
|
||||||
char **ret_version, char **ret_spec_version);
|
char **ret_vendor,
|
||||||
|
char **ret_version,
|
||||||
|
char **ret_spec_version);
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#define NOTIFY_TIMEOUT_DEFAULT -1
|
#define NOTIFY_TIMEOUT_DEFAULT -1
|
||||||
#define NOTIFY_TIMEOUT_NEVER 0
|
#define NOTIFY_TIMEOUT_NEVER 0
|
||||||
|
|
||||||
#define NOTIFY_DBUS_NAME "org.freedesktop.Notifications"
|
#define NOTIFY_DBUS_NAME "org.freedesktop.Notifications"
|
||||||
#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications"
|
#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications"
|
||||||
|
@ -14,8 +14,8 @@
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
NOTIFY_URGENCY_LOW, /**< Low urgency. */
|
NOTIFY_URGENCY_LOW, /**< Low urgency. */
|
||||||
NOTIFY_URGENCY_NORMAL, /**< Normal urgency. */
|
NOTIFY_URGENCY_NORMAL, /**< Normal urgency. */
|
||||||
NOTIFY_URGENCY_CRITICAL, /**< Critical urgency. */
|
NOTIFY_URGENCY_CRITICAL, /**< Critical urgency. */
|
||||||
|
|
||||||
} NotifyUrgency;
|
} NotifyUrgency;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,23 +1,26 @@
|
||||||
/*
|
/**
|
||||||
* This program is free software; you can redistribute it and/or
|
* @file libnotify/notifynotification.h Notification object
|
||||||
|
*
|
||||||
|
* @Copyright (C) 2006 Christian Hammond
|
||||||
|
* @Copyright (C) 2006 John Palmieri
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with main.c; if not, write to:
|
* License along with this library; if not, write to the
|
||||||
* The Free Software Foundation, Inc.,
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
* 59 Temple Place - Suite 330,
|
* Boston, MA 02111-1307, USA.
|
||||||
* Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
#ifndef _NOTIFY_NOTIFICATION_H_
|
||||||
#ifndef NOTIFY_NOTIFICATION_H
|
#define _NOTIFY_NOTIFICATION_H_
|
||||||
#define NOTIFY_NOTIFICATION_H
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
@ -27,100 +30,111 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define NOTIFY_TYPE_NOTIFICATION (notify_notification_get_type ())
|
#define NOTIFY_TYPE_NOTIFICATION (notify_notification_get_type ())
|
||||||
#define NOTIFY_NOTIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NOTIFY_TYPE_NOTIFICATION, NotifyNotification))
|
#define NOTIFY_NOTIFICATION(o) \
|
||||||
#define NOTIFY_NOTIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NOTIFY_TYPE_NOTIFICATION, NotifyNotificationClass))
|
(G_TYPE_CHECK_INSTANCE_CAST ((o), NOTIFY_TYPE_NOTIFICATION, \
|
||||||
#define NOTIFY_IS_NOTIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NOTIFY_TYPE_NOTIFICATION))
|
NotifyNotification))
|
||||||
#define NOTIFY_IS_NOTIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NOTIFY_TYPE_NOTIFICATION))
|
#define NOTIFY_NOTIFICATION_CLASS(k) \
|
||||||
#define NOTIFY_NOTIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NOTIFY_TYPE_NOTIFICATION, NotifyNotificationClass))
|
(G_TYPE_CHECK_CLASS_CAST((k), NOTIFY_TYPE_NOTIFICATION, \
|
||||||
|
NotifyNotificationClass))
|
||||||
|
#define NOTIFY_IS_NOTIFICATION(o) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE ((o), NOTIFY_TYPE_NOTIFICATION))
|
||||||
|
#define NOTIFY_IS_NOTIFICATION_CLASS(k) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE ((k), NOTIFY_TYPE_NOTIFICATION))
|
||||||
|
#define NOTIFY_NOTIFICATION_GET_CLASS(o) \
|
||||||
|
(G_TYPE_INSTANCE_GET_CLASS ((o), NOTIFY_TYPE_NOTIFICATION, \
|
||||||
|
NotifyNotificationClass))
|
||||||
|
|
||||||
typedef struct NotifyNotificationPrivate NotifyNotificationPrivate;
|
typedef struct _NotifyNotification NotifyNotification;
|
||||||
|
typedef struct _NotifyNotificationClass NotifyNotificationClass;
|
||||||
|
typedef struct _NotifyNotificationPrivate NotifyNotificationPrivate;
|
||||||
|
|
||||||
typedef struct {
|
struct _NotifyNotification
|
||||||
|
{
|
||||||
GObject parent;
|
GObject parent;
|
||||||
NotifyNotificationPrivate *priv;
|
NotifyNotificationPrivate *priv;
|
||||||
} NotifyNotification;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct _NotifyNotificationClass
|
||||||
|
{
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
/* Add Signal Functions Here */
|
|
||||||
void (*closed) (void);
|
|
||||||
} NotifyNotificationClass;
|
|
||||||
|
|
||||||
typedef void (*NotifyActionCallback )(NotifyNotification *, gchar *);
|
/* Signals */
|
||||||
|
void (*closed)(NotifyNotification *notification);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (*NotifyActionCallback)(NotifyNotification *, gchar *);
|
||||||
|
|
||||||
GType notify_notification_get_type();
|
GType notify_notification_get_type();
|
||||||
NotifyNotification *notify_notification_new (const gchar *summary,
|
|
||||||
const gchar *message,
|
|
||||||
const gchar *icon,
|
|
||||||
GtkWidget *attach);
|
|
||||||
|
|
||||||
gboolean notify_notification_update (NotifyNotification *notification,
|
NotifyNotification *notify_notification_new(const gchar *summary,
|
||||||
const gchar *summary,
|
const gchar *message,
|
||||||
const gchar *message,
|
const gchar *icon,
|
||||||
const gchar *icon);
|
GtkWidget *attach);
|
||||||
|
|
||||||
void notify_notification_attach_to_widget (NotifyNotification *notification,
|
gboolean notify_notification_update(NotifyNotification *notification,
|
||||||
GtkWidget *attach);
|
const gchar *summary,
|
||||||
|
const gchar *message,
|
||||||
|
const gchar *icon);
|
||||||
|
|
||||||
gboolean notify_notification_set_user_data (NotifyNotification *notification,
|
void notify_notification_attach_to_widget(NotifyNotification* notification,
|
||||||
void *user_data,
|
GtkWidget *attach);
|
||||||
GFreeFunc free_func);
|
|
||||||
|
|
||||||
gpointer notify_notification_get_user_data (NotifyNotification *notification);
|
gboolean notify_notification_set_user_data(NotifyNotification *notification,
|
||||||
|
void *user_data,
|
||||||
|
GFreeFunc free_func);
|
||||||
|
|
||||||
gboolean notify_notification_show (NotifyNotification *notification,
|
gpointer notify_notification_get_user_data(NotifyNotification *notification);
|
||||||
GError **error);
|
|
||||||
|
|
||||||
gboolean notify_notification_show_and_forget (NotifyNotification *notification,
|
gboolean notify_notification_show(NotifyNotification *notification,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void notify_notification_set_timeout (NotifyNotification *notification,
|
gboolean notify_notification_show_and_forget(NotifyNotification *notification,
|
||||||
gint timeout);
|
GError **error);
|
||||||
|
|
||||||
gboolean notify_notification_set_category (NotifyNotification *notification,
|
void notify_notification_set_timeout(NotifyNotification *notification,
|
||||||
const char *category);
|
gint timeout);
|
||||||
|
|
||||||
gboolean notify_notification_set_urgency (NotifyNotification *notification,
|
gboolean notify_notification_set_category(NotifyNotification *notification,
|
||||||
NotifyUrgency l);
|
const char *category);
|
||||||
|
|
||||||
gboolean notify_notification_set_icon_data_from_pixbuf (NotifyNotification *notification,
|
gboolean notify_notification_set_urgency(NotifyNotification *notification,
|
||||||
GdkPixbuf *icon);
|
NotifyUrgency l);
|
||||||
|
|
||||||
|
gboolean notify_notification_set_icon_data_from_pixbuf(
|
||||||
gboolean notify_notification_set_hint_int32 (NotifyNotification *notification,
|
NotifyNotification *notification, GdkPixbuf *icon);
|
||||||
const gchar *key,
|
|
||||||
gint value);
|
|
||||||
|
|
||||||
gboolean notify_notification_set_hint_double (NotifyNotification *notification,
|
gboolean notify_notification_set_hint_int32(NotifyNotification *notification,
|
||||||
const gchar *key,
|
const gchar *key, gint value);
|
||||||
gdouble value);
|
|
||||||
|
|
||||||
gboolean notify_notification_set_hint_string (NotifyNotification *notification,
|
|
||||||
const gchar *key,
|
|
||||||
const gchar *value);
|
|
||||||
|
|
||||||
gboolean notify_notification_set_hint_byte (NotifyNotification *notification,
|
|
||||||
const gchar *key,
|
|
||||||
guchar value);
|
|
||||||
|
|
||||||
gboolean notify_notification_set_hint_byte_array (
|
gboolean notify_notification_set_hint_double(NotifyNotification *notification,
|
||||||
NotifyNotification *notification,
|
const gchar *key,
|
||||||
const gchar *key,
|
gdouble value);
|
||||||
const guchar *value,
|
|
||||||
gsize len);
|
|
||||||
|
|
||||||
void notify_notification_clear_hints (NotifyNotification *notification);
|
gboolean notify_notification_set_hint_string(NotifyNotification *notification,
|
||||||
|
const gchar *key,
|
||||||
|
const gchar *value);
|
||||||
|
|
||||||
gboolean notify_notification_add_action (NotifyNotification *notification,
|
gboolean notify_notification_set_hint_byte(NotifyNotification *notification,
|
||||||
const char *action,
|
const gchar *key,
|
||||||
const char *label,
|
guchar value);
|
||||||
NotifyActionCallback callback);
|
|
||||||
|
gboolean notify_notification_set_hint_byte_array(
|
||||||
|
NotifyNotification *notification, const gchar *key,
|
||||||
|
const guchar *value, gsize len);
|
||||||
|
|
||||||
|
void notify_notification_clear_hints(NotifyNotification *notification);
|
||||||
|
|
||||||
|
gboolean notify_notification_add_action(NotifyNotification *notification,
|
||||||
|
const char *action,
|
||||||
|
const char *label,
|
||||||
|
NotifyActionCallback callback);
|
||||||
|
|
||||||
|
void notify_notification_clear_actions(NotifyNotification *notification);
|
||||||
|
gboolean notify_notification_close(NotifyNotification *notification,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
NotifyNotification *notify_notification_ref(NotifyNotification *notification);
|
||||||
|
void notify_notification_unref(NotifyNotification *notification);
|
||||||
|
|
||||||
void notify_notification_clear_actions (NotifyNotification *notification);
|
|
||||||
gboolean notify_notification_close (NotifyNotification *notification,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
NotifyNotification *notify_notification_ref (NotifyNotification *notification);
|
|
||||||
void notify_notification_unref (NotifyNotification *notification);
|
|
||||||
#endif /* NOTIFY_NOTIFICATION_H */
|
#endif /* NOTIFY_NOTIFICATION_H */
|
||||||
|
|
Loading…
Reference in New Issue