view plugins/events.c @ 4359:5fb47ec9bfe4

[gaim-migrate @ 4625] Wow, okay, where to begin with this one ;) I rewrote the whole conversation backend. It is now core/UI split. Here's how it works.. Every conversation is represented by a gaim_conversation structure. This branches out into gaim_im and gaim_chat structures. Every conversation lives in (well, normally, but it doesn't have to) a gaim_window structure. This is a _CORE_ representation of a window. There can be multiple gaim_window structures around. The gaim_window and gaim_conversation structures have UI-specific operation structures associated with them. At the moment, the only UI is GTK+, and this will be for some time. Don't start thinking you can write a QT UI now. It's just not going to happen. Everything that is done on a conversation is done through the core API. This API does core processing and then calls the UI operations for the rendering and anything else. Now, what does this give the user? - Multiple windows. - Multiple tabs per window. - Draggable tabs. - Send As menu is moved to the menubar. - Menubar for chats. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. For developers: - Fully documented API - Core/UI split - Variable checking and mostly sane handling of incorrect variables. - Logical structure to conversations, both core and UI. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. - Oh yeah, and the beginning of a stock icon system. Now, there are things that aren't there yet. You will see tabs even if you have them turned off. This will be fixed in time. Also, the preferences will change to work with the new structure. I'm starting school in 2 days, so it may not be done immediately, but hopefully in the next week. Enjoy! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 20 Jan 2003 09:10:23 +0000
parents cd938f18f3f8
children 4596276f5b12
line wrap: on
line source

/* tester.c
 *
 * test every callback, print to stdout
 *
 * by EW
 *
 * GPL and all that jazz
 *
 */

#define GAIM_PLUGINS
#include "gaim.h"

static void evt_signon(struct gaim_connection *gc, void *data)
{
	printf("event_signon\n");
}

static void evt_signoff(struct gaim_connection *gc, void *data)
{
	printf("event_signoff\n");
}

static void evt_away(struct gaim_connection *gc, char *state, char *message, void *data)
{
	printf("event_away: %s %s %s\n", gc->username, state, message);
}

static void evt_back(void *data)
{
	printf("event_back\n");
}

static void evt_im_recv(struct gaim_connection *gc, char **who, char **what, void *data)
{
	printf("event_im_recv: %s %s\n", *who, *what);
}

static void evt_im_send(struct gaim_connection *gc, char *who, char **what, void *data)
{
	printf("event_im_send: %s %s\n", who, *what);
}

static void evt_buddy_signon(struct gaim_connection *gc, char *who, void *data)
{
	printf("event_buddy_signon: %s\n", who);
}

static void evt_buddy_signoff(struct gaim_connection *gc, char *who, void *data)
{
	printf("event_buddy_signoff: %s\n", who);
}

static void evt_buddy_away(struct gaim_connection *gc, char *who, void *data)
{
	printf("event_buddy_away: %s\n", who);
}

static void evt_buddy_back(struct gaim_connection *gc, char *who, void *data)
{
	printf("event_buddy_back: %s\n", who);
}

static void evt_chat_invited(struct gaim_connection *gc, char *who, char *room, char *message, void *data)
{
	printf("event_chat_invited: %s %s %s\n", who, room, message);
}

static void evt_chat_join(struct gaim_connection *gc, char *room, void *data)
{
	printf("event_chat_join: %s\n", room);
}

static void evt_chat_leave(struct gaim_connection *gc, char *room, void *data)
{
	printf("event_chat_leave: %s\n", room);
}

static void evt_chat_buddy_join(struct gaim_connection *gc, char *room, char *who, void *data)
{
	printf("event_chat_buddy_join: %s %s\n", room, who);
}

static void evt_chat_buddy_leave(struct gaim_connection *gc, char *room, char *who, void *data)
{
	printf("event_chat_buddy_leave: %s %s\n", room, who);
}

static void evt_chat_recv(struct gaim_connection *gc, char *room, char *who, char *text, void *data)
{
	printf("event_chat_recv: %s %s %s\n", room, who, text);
}

static void evt_chat_send(struct gaim_connection *gc, char *room, char **what, void *data)
{
	printf("event_chat_send: %s %s\n", room, *what);
}

static void evt_warned(struct gaim_connection *gc, char *who, int level, void *data)
{
	printf("event_warned: %s %d\n", who, level);
}

static void evt_error(int error, void *data)
{
	printf("event_error: %d\n", error);
}

static void evt_quit(void *data)
{
	printf("event_quit\n");
}

static void evt_new_conversation(char *who, void *data)
{
	printf("event_new_conversation: %s\n", who);
}

char *gaim_plugin_init(GModule *h)
{
	gaim_signal_connect(h, event_signon,           evt_signon, NULL);
	gaim_signal_connect(h, event_signoff,          evt_signoff, NULL);
	gaim_signal_connect(h, event_away,             evt_away, NULL);
	gaim_signal_connect(h, event_back,             evt_back, NULL);
	gaim_signal_connect(h, event_im_recv,          evt_im_recv, NULL);
	gaim_signal_connect(h, event_im_send,          evt_im_send, NULL);
	gaim_signal_connect(h, event_buddy_signon,     evt_buddy_signon, NULL);
	gaim_signal_connect(h, event_buddy_signoff,    evt_buddy_signoff, NULL);
	gaim_signal_connect(h, event_buddy_away,       evt_buddy_away, NULL);
	gaim_signal_connect(h, event_buddy_back,       evt_buddy_back, NULL);
	gaim_signal_connect(h, event_chat_invited,     evt_chat_invited, NULL);
	gaim_signal_connect(h, event_chat_join,        evt_chat_join, NULL);
	gaim_signal_connect(h, event_chat_leave,       evt_chat_leave, NULL);
	gaim_signal_connect(h, event_chat_buddy_join,  evt_chat_buddy_join, NULL);
	gaim_signal_connect(h, event_chat_buddy_leave, evt_chat_buddy_leave, NULL);
	gaim_signal_connect(h, event_chat_recv,        evt_chat_recv, NULL);
	gaim_signal_connect(h, event_chat_send,        evt_chat_send, NULL);
	gaim_signal_connect(h, event_warned,           evt_warned, NULL);
	gaim_signal_connect(h, event_error,            evt_error, NULL);
	gaim_signal_connect(h, event_quit,             evt_quit, NULL);
	gaim_signal_connect(h, event_new_conversation, evt_new_conversation, NULL);
	return NULL;
}

struct gaim_plugin_description desc; 
struct gaim_plugin_description *gaim_plugin_desc() {
	desc.api_version = PLUGIN_API_VERSION;
	desc.name = g_strdup("Event Tester");
	desc.version = g_strdup(VERSION);
	desc.description = g_strdup("Test to see that all plugin events are working properly.");
	desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
	desc.url = g_strdup(WEBSITE);
	return &desc;
}

char *name()
{
	return "Event Test";
}

char *description()
{
	return "Test to see that all events are working properly.";
}