Skip to content
Permalink
Browse files

Move from our callbacks to libpurple signals

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
  • Loading branch information...
sardemff7 committed Feb 21, 2013
1 parent a7eee05 commit dccf0b52750a029ef9bef8059a7d5f61dbcec747
@@ -33,12 +33,8 @@ lib_LTLIBRARIES = \
libpurple-events.la

libpurple_events_la_SOURCES = \
include/purple-events-handler.h \
include/purple-events-context.h \
include/purple-events.h \
src/lib/utils.c \
src/lib/handler.c \
src/lib/context.c
src/lib/utils.c

libpurple_events_la_CFLAGS = \
$(AM_CFLAGS) \
@@ -60,15 +56,14 @@ plugin_LTLIBRARIES = \

purple_events_la_SOURCES = \
include/config.h \
include/purple-events-handler.h \
include/purple-events-context.h \
include/purple-events.h \
src/plugin/utils.h \
src/plugin/utils.c \
src/plugin/ui.h \
src/plugin/ui.c \
src/plugin/callbacks.h \
src/plugin/callbacks.c \
src/plugin/context.h \
src/plugin/events.h \
src/plugin/events.c

This file was deleted.

Oops, something went wrong.
@@ -27,68 +27,13 @@
G_BEGIN_DECLS


typedef enum
{
PURPLE_EVENTS_EVENT_SPECIAL_TYPE_NONE,
PURPLE_EVENTS_EVENT_SPECIAL_TYPE_TUNE,
} PurpleEventsEventSpecialType;

typedef enum
{
PURPLE_EVENTS_UTILS_ICON_FORMAT_SVG,
PURPLE_EVENTS_UTILS_ICON_FORMAT_PNG,
} PurpleEventsUtilsIconFormat;

typedef enum
{
PURPLE_EVENTS_MESSAGE_TYPE_NORMAL,
PURPLE_EVENTS_MESSAGE_TYPE_HIGHLIGHT
} PurpleEventsMessageType;

typedef void (*PurpleEventsSignedOnFunc)(PurplePlugin *plugin, PurpleBuddy *buddy);
typedef void (*PurpleEventsSignedOffFunc)(PurplePlugin *plugin, PurpleBuddy *buddy);

typedef void (*PurpleEventsAwayFunc)(PurplePlugin *plugin, PurpleBuddy *buddy, const gchar *message);
typedef void (*PurpleEventsBackFunc)(PurplePlugin *plugin, PurpleBuddy *buddy, const gchar *message);

typedef void (*PurpleEventsStatusFunc)(PurplePlugin *plugin, PurpleBuddy *buddy, const gchar *message);
typedef void (*PurpleEventsSpecialFunc)(PurplePlugin *plugin, PurpleBuddy *buddy, PurpleEventsEventSpecialType type, ...);

typedef void (*PurpleEventsIdleFunc)(PurplePlugin *plugin, PurpleBuddy *buddy);
typedef void (*PurpleEventsIdleBackFunc)(PurplePlugin *plugin, PurpleBuddy *buddy);

typedef void (*PurpleEventsImMessageFunc)(PurplePlugin *plugin, PurpleEventsMessageType type, PurpleBuddy *buddy, const gchar *sender, const gchar *message);
typedef void (*PurpleEventsChatMessageFunc)(PurplePlugin *plugin, PurpleEventsMessageType type, PurpleConversation *conv, PurpleBuddy *buddy, const gchar *sender, const gchar *message);

typedef void (*PurpleEventsEmailFunc)(PurplePlugin *plugin, const gchar *subject, const gchar *from, const gchar *to, const gchar *url);

typedef void (*PurpleEventsConversationGotFocusFunc)(PurplePlugin *plugin, PurpleConversation *conv);


typedef struct _PurpleEventsHandler PurpleEventsHandler;


const gchar *purple_events_get_plugin_id();
void purple_events_connect_handler(PurpleEventsHandler *handler);
void purple_events_disconnect_handler(PurpleEventsHandler *handler);


#define PURPLE_EVENTS_HANDLER_ADD_CALLBACK(event_name, EventName) void purple_events_handler_add_##event_name##_callback(PurpleEventsHandler *handler, PurpleEvents##EventName##Func callback)
PurpleEventsHandler *purple_events_handler_new(PurplePlugin *plugin);
void purple_events_handler_free(PurpleEventsHandler *handler);
void purple_events_handler_remove_event(PurpleEventsHandler *handler, gpointer attach, gpointer event);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(signed_on, SignedOn);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(signed_off, SignedOff);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(away, Away);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(back, Back);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(status, Status);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(idle, Idle);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(idle_back, IdleBack);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(im_message, ImMessage);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(chat_message, ChatMessage);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(email, Email);
PURPLE_EVENTS_HANDLER_ADD_CALLBACK(conversation_got_focus, ConversationGotFocus);

const gchar *purple_events_get_plugin_id(void);

const gchar *purple_events_utils_buddy_get_best_name(PurpleBuddy *buddy);
const gchar *purple_events_utils_buddy_get_protocol(PurpleBuddy *buddy);

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -26,6 +26,12 @@

#include <purple-events.h>

const gchar *
purple_events_get_plugin_id(void)
{
return PURPLE_EVENTS_PLUGIN_ID;
}

const gchar *
purple_events_utils_buddy_get_best_name(PurpleBuddy *buddy)
{
Oops, something went wrong.

0 comments on commit dccf0b5

Please sign in to comment.
You can’t perform that action at this time.