All its code was related to notifications.
#include <libempathy/empathy-utils.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+#include <libempathy-gtk/empathy-conf.h>
+
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
return g_hash_table_lookup (priv->capabilities, capa) != NULL;
}
+
+GdkPixbuf *
+empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
+ const char *icon_name)
+{
+ GdkPixbuf *pixbuf = NULL;
+
+ if (contact != NULL)
+ pixbuf = empathy_pixbuf_avatar_from_contact_scaled (contact, 48, 48);
+
+ if (pixbuf == NULL)
+ pixbuf = empathy_pixbuf_from_icon_name_sized (icon_name, 48);
+
+ return pixbuf;
+}
+
+gboolean
+empathy_notification_is_enabled (void)
+{
+ EmpathyConf *conf;
+ gboolean res;
+
+ conf = empathy_conf_get ();
+ res = FALSE;
+
+ empathy_conf_get_bool (conf, EMPATHY_PREFS_NOTIFICATIONS_ENABLED, &res);
+
+ if (!res)
+ return FALSE;
+
+ if (!empathy_check_available_state ())
+ {
+ empathy_conf_get_bool (conf, EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY,
+ &res);
+
+ if (res)
+ return FALSE;
+ }
+
+ return TRUE;
+}
#define EMPATHY_IS_NOTIFY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_NOTIFY_MANAGER))
#define EMPATHY_NOTIFY_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_NOTIFY_MANAGER, EmpathyNotifyManagerClass))
+/* FIXME: this should *really* belong to libnotify. */
+typedef enum {
+ EMPATHY_NOTIFICATION_CLOSED_INVALID = 0,
+ EMPATHY_NOTIFICATION_CLOSED_EXPIRED = 1,
+ EMPATHY_NOTIFICATION_CLOSED_DISMISSED = 2,
+ EMPATHY_NOTIFICATION_CLOSED_PROGRAMMATICALY = 3,
+ EMPATHY_NOTIFICATION_CLOSED_RESERVED = 4
+} EmpathyNotificationClosedReason;
+
typedef struct _EmpathyNotifyManager EmpathyNotifyManager;
typedef struct _EmpathyNotifyManagerClass EmpathyNotifyManagerClass;
gboolean empathy_notify_manager_has_capability (EmpathyNotifyManager *self,
const gchar *capa);
+gboolean empathy_notification_is_enabled (void);
+GdkPixbuf * empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
+ const char *icon_name);
+
+
G_END_DECLS
#endif /* __EMPATHY_NOTIFY_MANAGER_H__ */
empathy-import-utils.c empathy-import-utils.h \
empathy-import-widget.c empathy-import-widget.h \
empathy-main-window.c empathy-main-window.h \
- empathy-misc.c empathy-misc.h \
empathy-new-chatroom-dialog.c empathy-new-chatroom-dialog.h \
empathy-preferences.c empathy-preferences.h \
empathy-sidebar.c empathy-sidebar.h \
#include <libempathy-gtk/empathy-smiley-manager.h>
#include <libempathy-gtk/empathy-sound.h>
#include <libempathy-gtk/empathy-ui-utils.h>
+#include <libempathy-gtk/empathy-notify-manager.h>
#include "empathy-chat-window.h"
#include "empathy-about-dialog.h"
-#include "empathy-misc.h"
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
#include <libempathy/empathy-debug.h>
+++ /dev/null
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2009 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301 USA
- *
- * Author: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
- *
- */
-
-#include "empathy-misc.h"
-
-#include <libempathy/empathy-utils.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
-#include <libempathy-gtk/empathy-conf.h>
-
-/* public methods */
-
-GdkPixbuf *
-empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
- const char *icon_name)
-{
- GdkPixbuf *pixbuf = NULL;
-
- if (contact != NULL) {
- pixbuf = empathy_pixbuf_avatar_from_contact_scaled (contact,
- 48, 48);
- }
-
- if (!pixbuf) {
- pixbuf = empathy_pixbuf_from_icon_name_sized
- (icon_name, 48);
- }
-
- return pixbuf;
-}
-
-gboolean
-empathy_notification_is_enabled (void)
-{
- EmpathyConf *conf;
- gboolean res;
-
- conf = empathy_conf_get ();
- res = FALSE;
-
- empathy_conf_get_bool (conf, EMPATHY_PREFS_NOTIFICATIONS_ENABLED, &res);
-
- if (!res) {
- return FALSE;
- }
-
- if (!empathy_check_available_state ()) {
- empathy_conf_get_bool (conf,
- EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY,
- &res);
- if (res) {
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2009 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301 USA
- *
- * Author: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
- *
- */
-
-#ifndef __EMPATHY_MISC_H__
-#define __EMPATHY_MISC_H__
-
-#include <glib.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include <libempathy/empathy-contact.h>
-
-G_BEGIN_DECLS
-
-/* FIXME: this should *really* belong to libnotify. */
-typedef enum {
- EMPATHY_NOTIFICATION_CLOSED_INVALID = 0,
- EMPATHY_NOTIFICATION_CLOSED_EXPIRED = 1,
- EMPATHY_NOTIFICATION_CLOSED_DISMISSED = 2,
- EMPATHY_NOTIFICATION_CLOSED_PROGRAMMATICALY = 3,
- EMPATHY_NOTIFICATION_CLOSED_RESERVED = 4
-} EmpathyNotificationClosedReason;
-
-gboolean empathy_notification_is_enabled (void);
-GdkPixbuf * empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact,
- const char *icon_name);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_MISC_H__ */
#include "empathy-status-icon.h"
#include "empathy-preferences.h"
#include "empathy-event-manager.h"
-#include "empathy-misc.h"
#define DEBUG_FLAG EMPATHY_DEBUG_DISPATCHER
#include <libempathy/empathy-debug.h>