comparison src/core.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 8f94cce8faa5
children 800ef4a51096
comparison
equal deleted inserted replaced
6484:5ced8e111473 6485:70d5122bc3ff
29 #include "plugin.h" 29 #include "plugin.h"
30 #include "pounce.h" 30 #include "pounce.h"
31 #include "prefs.h" 31 #include "prefs.h"
32 #include "privacy.h" 32 #include "privacy.h"
33 #include "proxy.h" 33 #include "proxy.h"
34 #include "signals.h"
34 #include "sound.h" 35 #include "sound.h"
35 36
36 struct GaimCore 37 struct GaimCore
37 { 38 {
38 char *ui; 39 char *ui;
58 core->ui = g_strdup(ui); 59 core->ui = g_strdup(ui);
59 core->reserved = NULL; 60 core->reserved = NULL;
60 61
61 ops = gaim_get_core_ui_ops(); 62 ops = gaim_get_core_ui_ops();
62 63
64 /* The signals subsystem is important and should be first. */
65 gaim_signals_init();
66
67 gaim_signal_register(core, "quitting", gaim_marshal_VOID);
68
63 /* Initialize all static protocols. */ 69 /* Initialize all static protocols. */
64 static_proto_init(); 70 static_proto_init();
65 71
66 gaim_prefs_init(); 72 gaim_prefs_init();
67 73
71 77
72 if (ops->debug_ui_init != NULL) 78 if (ops->debug_ui_init != NULL)
73 ops->debug_ui_init(); 79 ops->debug_ui_init();
74 } 80 }
75 81
76 gaim_conversation_init(); 82 gaim_accounts_init();
83 gaim_connections_init();
84 gaim_conversations_init();
85 gaim_blist_init();
77 gaim_privacy_init(); 86 gaim_privacy_init();
78 gaim_pounces_init(); 87 gaim_pounces_init();
79 gaim_proxy_init(); 88 gaim_proxy_init();
80 gaim_sound_init(); 89 gaim_sound_init();
81 gaim_xfers_init(); 90 gaim_xfers_init();
98 107
99 if (ops != NULL && ops->quit != NULL) 108 if (ops != NULL && ops->quit != NULL)
100 ops->quit(); 109 ops->quit();
101 110
102 /* The self destruct sequence has been initiated */ 111 /* The self destruct sequence has been initiated */
103 gaim_event_broadcast(event_quit); 112 gaim_signal_emit(gaim_get_core(), "quitting");
104 113
105 /* Transmission ends */ 114 /* Transmission ends */
106 gaim_connections_disconnect_all(); 115 gaim_connections_disconnect_all();
107 116
108 /* Record what we have before we blow it away... */ 117 /* Record what we have before we blow it away... */
109 gaim_prefs_sync(); 118 gaim_prefs_sync();
110 gaim_accounts_sync(); 119 gaim_accounts_sync();
111 120
112 gaim_debug(GAIM_DEBUG_INFO, "main", "Unloading all plugins\n"); 121 gaim_debug(GAIM_DEBUG_INFO, "main", "Unloading all plugins\n");
113 gaim_plugins_destroy_all(); 122 gaim_plugins_destroy_all();
123
124 gaim_blist_uninit();
125 gaim_conversations_uninit();
126 gaim_connections_uninit();
127 gaim_accounts_uninit();
128
129 gaim_signals_uninit();
114 130
115 if (core->ui != NULL) { 131 if (core->ui != NULL) {
116 g_free(core->ui); 132 g_free(core->ui);
117 core->ui = NULL; 133 core->ui = NULL;
118 } 134 }