Mercurial > pidgin
annotate plugins/gtk-signals-test.c @ 12540:b0ba132271a9
[gaim-migrate @ 14853]
this doesn't make it work, but it does make it more correct
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 17 Dec 2005 21:01:40 +0000 |
parents | 434181b96f44 |
children | 71299d63801d |
rev | line source |
---|---|
9609 | 1 /* |
2 * Signals test plugin. | |
3 * | |
4 * Copyright (C) 2003 Christian Hammond. | |
5 * | |
6 * This program is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation; either version 2 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, but | |
12 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
19 * 02111-1307, USA. | |
20 */ | |
21 #define GTK_SIGNAL_TEST_PLUGIN_ID "gtk-signals-test" | |
22 | |
23 #include <gtk/gtk.h> | |
24 | |
25 #include "internal.h" | |
26 #include "debug.h" | |
9954 | 27 #include "version.h" |
9609 | 28 |
29 #include "gtkaccount.h" | |
30 #include "gtkblist.h" | |
31 #include "gtkconv.h" | |
32 #include "gtkplugin.h" | |
33 | |
34 /************************************************************************** | |
35 * Account subsystem signal callbacks | |
36 **************************************************************************/ | |
37 static void | |
38 account_modified_cb(GaimAccount *account, void *data) { | |
39 gaim_debug_info("gtk-signal-test", "account modified cb\n"); | |
40 } | |
41 | |
42 /************************************************************************** | |
43 * Buddy List subsystem signal callbacks | |
44 **************************************************************************/ | |
45 static void | |
46 blist_created_cb(GaimBuddyList *blist, void *data) { | |
47 gaim_debug_info("gtk-signal-test", "buddy list created\n"); | |
48 } | |
49 | |
50 static void | |
51 blist_drawing_tooltip_cb(GaimBlistNode *node, char **text, void *data) { | |
52 gaim_debug_info("gtk-signal-test", "drawing tooltip cb\n"); | |
53 } | |
54 | |
55 /************************************************************************** | |
56 * Conversation subsystem signal callbacks | |
57 **************************************************************************/ | |
58 static void | |
11848
434181b96f44
[gaim-migrate @ 14139]
Gary Kramlich <grim@reaperworld.com>
parents:
11447
diff
changeset
|
59 conversation_dragging_cb(GaimGtkWindow *source, GaimGtkWindow *destination) { |
11447
ef6e94bdda08
[gaim-migrate @ 13686]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11256
diff
changeset
|
60 gaim_debug_info("gtk-signal-test", "conversation dragging cb\n"); |
9609 | 61 } |
62 | |
63 /************************************************************************** | |
64 * Plugin stuff | |
65 **************************************************************************/ | |
66 static gboolean | |
67 plugin_load(GaimPlugin *plugin) | |
68 { | |
69 void *accounts_handle = gaim_gtk_account_get_handle(); | |
70 void *blist_handle = gaim_gtk_blist_get_handle(); | |
71 void *conv_handle = gaim_gtk_conversations_get_handle(); | |
72 | |
73 /* Accounts subsystem signals */ | |
74 gaim_signal_connect(accounts_handle, "account-modified", | |
75 plugin, GAIM_CALLBACK(account_modified_cb), NULL); | |
76 | |
77 /* Buddy List subsystem signals */ | |
78 gaim_signal_connect(blist_handle, "gtkblist-created", | |
79 plugin, GAIM_CALLBACK(blist_created_cb), NULL); | |
80 gaim_signal_connect(blist_handle, "drawing-tooltip", | |
81 plugin, GAIM_CALLBACK(blist_drawing_tooltip_cb), NULL); | |
82 | |
83 /* Conversations subsystem signals */ | |
11447
ef6e94bdda08
[gaim-migrate @ 13686]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11256
diff
changeset
|
84 gaim_signal_connect(conv_handle, "conversation-dragging", |
ef6e94bdda08
[gaim-migrate @ 13686]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11256
diff
changeset
|
85 plugin, GAIM_CALLBACK(conversation_dragging_cb), NULL); |
9609 | 86 |
87 return TRUE; | |
88 } | |
89 | |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
90 static gboolean |
11256
bb0d7b719af2
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
91 plugin_unload(GaimPlugin *plugin) { |
bb0d7b719af2
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
92 return TRUE; |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
93 } |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
94 |
9609 | 95 static GaimPluginInfo info = |
96 { | |
9954 | 97 GAIM_PLUGIN_MAGIC, |
98 GAIM_MAJOR_VERSION, | |
99 GAIM_MINOR_VERSION, | |
9609 | 100 GAIM_PLUGIN_STANDARD, /**< type */ |
101 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ | |
102 0, /**< flags */ | |
103 NULL, /**< dependencies */ | |
104 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
105 | |
106 GTK_SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
107 N_("GTK Signals Test"), /**< name */ | |
108 VERSION, /**< version */ | |
109 /** summary */ | |
110 N_("Test to see that all ui signals are working properly."), | |
111 /** description */ | |
112 N_("Test to see that all ui signals are working properly."), | |
113 "Gary Kramlich <amc_grim@users.sf.net>", /**< author */ | |
114 GAIM_WEBSITE, /**< homepage */ | |
115 | |
116 plugin_load, /**< load */ | |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
117 plugin_unload, /**< unload */ |
9609 | 118 NULL, /**< destroy */ |
119 | |
120 NULL, /**< ui_info */ | |
121 NULL, /**< extra_info */ | |
122 NULL, | |
123 NULL | |
124 }; | |
125 | |
126 static void | |
127 init_plugin(GaimPlugin *plugin) | |
128 { | |
129 } | |
130 | |
131 GAIM_INIT_PLUGIN(gtksignalstest, init_plugin, info) |