From 3dac8b3d66d51149d837db9a9488004b0b0d5502 Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Fri, 20 Jan 2006 06:08:58 +0000 Subject: [PATCH] Do some rearranging of the files in libnotify, and include things properly so people can actually use the library without fudging with include paths. --- ChangeLog | 15 ++++++++++ libnotify/Makefile.am | 5 ++-- libnotify/internal.h | 28 +++++++++++++++++++ .../{notifynotification.c => notification.c} | 6 ++-- .../{notifynotification.h => notification.h} | 17 +++++++++-- libnotify/notify.c | 3 +- libnotify/notify.h | 3 +- libnotify/notifycommon.h | 23 --------------- 8 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 libnotify/internal.h rename libnotify/{notifynotification.c => notification.c} (99%) rename libnotify/{notifynotification.h => notification.h} (94%) delete mode 100644 libnotify/notifycommon.h diff --git a/ChangeLog b/ChangeLog index 5c5e370..0abc632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Thu Jan 19 22:07:41 PST 2006 Christian Hammond + + A libnotify/internal.h: + A libnotify/notification.c: + A libnotify/notification.h: + D libnotify/notifycommon.h: + D libnotify/notifynotification.c: + D libnotify/notifynotification.h: + * libnotify/Makefile.am: + * libnotify/notify.c: + * libnotify/notify.h: + - Do some rearranging of the files in libnotify, and include things + properly so people can actually use the library without fudging with + include paths. + Thu Jan 19 21:56:29 PST 2006 Christian Hammond * libnotify/Makefile.am: diff --git a/libnotify/Makefile.am b/libnotify/Makefile.am index 08a5734..bc97745 100644 --- a/libnotify/Makefile.am +++ b/libnotify/Makefile.am @@ -7,15 +7,14 @@ lib_LTLIBRARIES = libnotify.la notifyinc_HEADERS = \ notify.h \ - notifynotification.h \ - notifycommon.h + notification.h noinst_HEADERS = \ notify-marshal.h libnotify_la_SOURCES = \ notify.c \ - notifynotification.c \ + notification.c \ notify-marshal.c libnotify_la_LIBADD = \ diff --git a/libnotify/internal.h b/libnotify/internal.h new file mode 100644 index 0000000..2aa1155 --- /dev/null +++ b/libnotify/internal.h @@ -0,0 +1,28 @@ +/** + * @file libnotify/internal.h Internal definitions + * + * @Copyright (C) 2006 Christian Hammond + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef _LIBNOTIFY_INTERNAL_H_ +#define _LIBNOTIFY_INTERNAL_H_ + +#define NOTIFY_DBUS_NAME "org.freedesktop.Notifications" +#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications" +#define NOTIFY_DBUS_CORE_OBJECT "/org/freedesktop/Notifications" + +#endif /* _LIBNOTIFY_INTERNAL_H_ */ diff --git a/libnotify/notifynotification.c b/libnotify/notification.c similarity index 99% rename from libnotify/notifynotification.c rename to libnotify/notification.c index da877a0..b358018 100644 --- a/libnotify/notifynotification.c +++ b/libnotify/notification.c @@ -23,9 +23,9 @@ #include #include -#include "notify.h" -#include "notifynotification.h" -#include "notify-marshal.h" +#include +#include +#include static void notify_notification_class_init(NotifyNotificationClass *klass); static void notify_notification_init(NotifyNotification *sp); diff --git a/libnotify/notifynotification.h b/libnotify/notification.h similarity index 94% rename from libnotify/notifynotification.h rename to libnotify/notification.h index 3a8f486..1ca9e03 100644 --- a/libnotify/notifynotification.h +++ b/libnotify/notification.h @@ -26,10 +26,11 @@ #include #include -#include "notifycommon.h" - G_BEGIN_DECLS +#define NOTIFY_TIMEOUT_DEFAULT -1 +#define NOTIFY_TIMEOUT_NEVER 0 + #define NOTIFY_TYPE_NOTIFICATION (notify_notification_get_type ()) #define NOTIFY_NOTIFICATION(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), NOTIFY_TYPE_NOTIFICATION, \ @@ -45,6 +46,7 @@ G_BEGIN_DECLS (G_TYPE_INSTANCE_GET_CLASS ((o), NOTIFY_TYPE_NOTIFICATION, \ NotifyNotificationClass)) + typedef struct _NotifyNotification NotifyNotification; typedef struct _NotifyNotificationClass NotifyNotificationClass; typedef struct _NotifyNotificationPrivate NotifyNotificationPrivate; @@ -63,6 +65,17 @@ struct _NotifyNotificationClass void (*closed)(NotifyNotification *notification); }; +/** + * Notification urgency levels. + */ +typedef enum +{ + NOTIFY_URGENCY_LOW, /**< Low urgency. */ + NOTIFY_URGENCY_NORMAL, /**< Normal urgency. */ + NOTIFY_URGENCY_CRITICAL, /**< Critical urgency. */ + +} NotifyUrgency; + typedef void (*NotifyActionCallback)(NotifyNotification *, gchar *); GType notify_notification_get_type(); diff --git a/libnotify/notify.c b/libnotify/notify.c index b1c0197..bf38129 100644 --- a/libnotify/notify.c +++ b/libnotify/notify.c @@ -28,13 +28,14 @@ # define DBUS_API_SUBJECT_TO_CHANGE 1 #endif -#include "notify.h" #include #include #include #include #include #include +#include +#include static gboolean _initted = FALSE; static gchar *_app_name = NULL; diff --git a/libnotify/notify.h b/libnotify/notify.h index 4237100..dcb8ae6 100644 --- a/libnotify/notify.h +++ b/libnotify/notify.h @@ -24,8 +24,7 @@ #include #include -#include "notifycommon.h" -#include "notifynotification.h" +#include /**************************************************************************/ /** @name libnotify Base API */ diff --git a/libnotify/notifycommon.h b/libnotify/notifycommon.h deleted file mode 100644 index e67fbb0..0000000 --- a/libnotify/notifycommon.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _LIBNOTIFY_NOTIFY_COMMON_H_ -#define _LIBNOTIFY_NOTIFY_COMMON_H_ -#include - -#define NOTIFY_TIMEOUT_DEFAULT -1 -#define NOTIFY_TIMEOUT_NEVER 0 - -#define NOTIFY_DBUS_NAME "org.freedesktop.Notifications" -#define NOTIFY_DBUS_CORE_INTERFACE "org.freedesktop.Notifications" -#define NOTIFY_DBUS_CORE_OBJECT "/org/freedesktop/Notifications" - -/** - * Notification urgency levels. - */ -typedef enum -{ - NOTIFY_URGENCY_LOW, /**< Low urgency. */ - NOTIFY_URGENCY_NORMAL, /**< Normal urgency. */ - NOTIFY_URGENCY_CRITICAL, /**< Critical urgency. */ - -} NotifyUrgency; - -#endif /* _LIBNOTIFY_NOTIFY_H_ */