diff src/account.c @ 6485:70d5122bc3ff

[gaim-migrate @ 6999] Removed the old event system and replaced it with a much better signal system. There will most likely be some bugs in this, but it seems to be working for now. Plugins can now generate their own signals, and other plugins can find those plugins and connect to them. This could give plugins a form of IPC. It's also useful for other things. It's rather flexible, except for the damn marshalling, but there's no way around that that I or the glib people can see. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 18 Aug 2003 01:03:43 +0000
parents 41e6d15f4687
children 800ef4a51096
line wrap: on
line diff
--- a/src/account.c	Sun Aug 17 17:55:46 2003 +0000
+++ b/src/account.c	Mon Aug 18 01:03:43 2003 +0000
@@ -5,7 +5,7 @@
  * gaim
  *
  * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
- * 
+ *
  * 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
@@ -25,6 +25,7 @@
 #include "debug.h"
 #include "prefs.h"
 #include "prpl.h"
+#include "signals.h"
 #include "server.h"
 #include "util.h"
 
@@ -1413,3 +1414,37 @@
 
 	return account;
 }
+
+void *
+gaim_accounts_get_handle(void)
+{
+	static int handle;
+
+	return &handle;
+}
+
+void
+gaim_accounts_init(void)
+{
+	void *handle = gaim_accounts_get_handle();
+
+	gaim_signal_register(handle, "account-connecting",
+						 gaim_marshal_VOID__POINTER);
+
+	gaim_signal_register(handle, "account-away",
+						 gaim_marshal_VOID__POINTER_POINTER_POINTER);
+
+	gaim_signal_register(handle, "account-setting-info",
+						 gaim_marshal_VOID__POINTER_POINTER);
+	gaim_signal_register(handle, "account-set-info",
+						 gaim_marshal_VOID__POINTER_POINTER);
+
+	gaim_signal_register(handle, "account-warned",
+						 gaim_marshal_VOID__POINTER_POINTER_UINT);
+}
+
+void
+gaim_accounts_uninit(void)
+{
+	gaim_signals_unregister_by_instance(gaim_accounts_get_handle());
+}