Sun, 20 Oct 2013 15:11:49 +0530
Changed dox files to xml files for gtk-doc, and included them in the top-level XMLs.
The contents of the xml files mostly still need to be refactored.
| 15231 | 1 | /* |
| 2 | * Markerline - Draw a line to indicate new messages in a conversation. | |
| 3 | * Copyright (C) 2006 | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or | |
| 6 | * modify it under the terms of the GNU General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2 of the | |
| 8 | * License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, but | |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
18 | * 02111-1301, USA. |
| 15231 | 19 | */ |
| 20 | #include "internal.h" | |
| 21 | ||
| 22 | #define PLUGIN_ID "gtk-plugin_pack-markerline" | |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
23 | #define PLUGIN_NAME N_("Markerline") |
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
24 | #define PLUGIN_CATEGORY N_("User interface") |
|
25633
feee0c7e503f
Fix some more mis-identified plugins, like 3b3526a0...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24604
diff
changeset
|
25 | #define PLUGIN_STATIC_NAME Markerline |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
26 | #define PLUGIN_SUMMARY N_("Draw a line to indicate new messages in a conversation.") |
|
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
27 | #define PLUGIN_DESCRIPTION N_("Draw a line to indicate new messages in a conversation.") |
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
28 | #define PLUGIN_AUTHORS {"Sadrul H Chowdhury <sadrul@users.sourceforge.net>", NULL} |
| 15231 | 29 | |
| 30 | /* System headers */ | |
| 31 | #include <gdk/gdk.h> | |
| 32 | #include <glib.h> | |
| 33 | #include <gtk/gtk.h> | |
| 34 | ||
| 15884 | 35 | /* Purple headers */ |
| 15231 | 36 | #include <gtkconv.h> |
| 37 | #include <gtkplugin.h> | |
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
38 | #include <gtkwebview.h> |
| 15231 | 39 | #include <version.h> |
| 40 | ||
| 41 | #define PREF_PREFIX "/plugins/gtk/" PLUGIN_ID | |
| 42 | #define PREF_IMS PREF_PREFIX "/ims" | |
| 43 | #define PREF_CHATS PREF_PREFIX "/chats" | |
| 44 | ||
| 45 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
46 | update_marker_for_gtkconv(PidginConversation *gtkconv) |
| 15231 | 47 | { |
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
48 | PurpleConversation *conv; |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
49 | |
| 15231 | 50 | g_return_if_fail(gtkconv != NULL); |
| 51 | ||
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
52 | conv = gtkconv->active_conv; |
| 15231 | 53 | |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
32773
diff
changeset
|
54 | if ((PURPLE_IS_CHAT_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_CHATS)) || |
|
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
32773
diff
changeset
|
55 | (PURPLE_IS_IM_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_IMS))) |
| 15231 | 56 | return; |
| 57 | ||
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
58 | gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
59 | "var mhr = document.getElementById(\"markerhr\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
60 | "if (!mhr) {" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
61 | "mhr = document.createElement(\"hr\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
62 | "mhr.setAttribute(\"id\", \"markerhr\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
63 | "mhr.setAttribute(\"color\", \"#ff0000\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
64 | "mhr.setAttribute(\"size\", \"1\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
65 | "}" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
66 | "document.getElementById(\"Chat\").appendChild(mhr);"); |
| 15231 | 67 | } |
| 68 | ||
| 69 | static gboolean | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
70 | focus_removed(GtkWidget *widget, GdkEventVisibility *event, PidginWindow *win) |
| 15231 | 71 | { |
| 15884 | 72 | PurpleConversation *conv; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
73 | PidginConversation *gtkconv; |
| 15231 | 74 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
75 | conv = pidgin_conv_window_get_active_conversation(win); |
| 15231 | 76 | g_return_val_if_fail(conv != NULL, FALSE); |
| 77 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
78 | gtkconv = PIDGIN_CONVERSATION(conv); |
| 15231 | 79 | update_marker_for_gtkconv(gtkconv); |
| 80 | ||
| 81 | return FALSE; | |
| 82 | } | |
| 83 | ||
| 84 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
85 | page_switched(GtkWidget *widget, GtkWidget *page, gint num, PidginWindow *win) |
| 15231 | 86 | { |
| 87 | focus_removed(NULL, NULL, win); | |
| 88 | } | |
| 89 | ||
| 90 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
91 | detach_from_gtkconv(PidginConversation *gtkconv, gpointer null) |
| 15231 | 92 | { |
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
93 | gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
94 | "var mhr = document.getElementById(\"markerhr\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
95 | "if (mhr) mhr.parentNode.removeChild(mhr);"); |
| 15231 | 96 | } |
| 97 | ||
| 98 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
99 | detach_from_pidgin_window(PidginWindow *win, gpointer null) |
| 15231 | 100 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
101 | g_list_foreach(pidgin_conv_window_get_gtkconvs(win), (GFunc)detach_from_gtkconv, NULL); |
| 15231 | 102 | g_signal_handlers_disconnect_by_func(G_OBJECT(win->notebook), page_switched, win); |
| 103 | g_signal_handlers_disconnect_by_func(G_OBJECT(win->window), focus_removed, win); | |
| 104 | } | |
| 105 | ||
| 106 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
107 | attach_to_gtkconv(PidginConversation *gtkconv, gpointer null) |
| 15231 | 108 | { |
| 109 | detach_from_gtkconv(gtkconv, NULL); | |
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
110 | update_marker_for_gtkconv(gtkconv); |
| 15231 | 111 | } |
| 112 | ||
| 113 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
114 | attach_to_pidgin_window(PidginWindow *win, gpointer null) |
| 15231 | 115 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
116 | g_list_foreach(pidgin_conv_window_get_gtkconvs(win), (GFunc)attach_to_gtkconv, NULL); |
| 15231 | 117 | |
| 118 | g_signal_connect(G_OBJECT(win->window), "focus_out_event", | |
| 119 | G_CALLBACK(focus_removed), win); | |
| 120 | ||
| 121 | g_signal_connect(G_OBJECT(win->notebook), "switch_page", | |
| 122 | G_CALLBACK(page_switched), win); | |
| 123 | } | |
| 124 | ||
| 125 | static void | |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
20288
diff
changeset
|
126 | detach_from_all_windows(void) |
| 15231 | 127 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
128 | g_list_foreach(pidgin_conv_windows_get_list(), (GFunc)detach_from_pidgin_window, NULL); |
| 15231 | 129 | } |
| 130 | ||
| 131 | static void | |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
20288
diff
changeset
|
132 | attach_to_all_windows(void) |
| 15231 | 133 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
134 | g_list_foreach(pidgin_conv_windows_get_list(), (GFunc)attach_to_pidgin_window, NULL); |
| 15231 | 135 | } |
| 136 | ||
| 137 | static void | |
|
24604
6d8cec169c3f
Use a more appropriate signal for the markerline plugin. Fixes #7518.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22809
diff
changeset
|
138 | conv_created(PidginConversation *gtkconv, gpointer null) |
| 15231 | 139 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
140 | PidginWindow *win; |
| 15231 | 141 | |
|
24604
6d8cec169c3f
Use a more appropriate signal for the markerline plugin. Fixes #7518.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22809
diff
changeset
|
142 | win = pidgin_conv_get_window(gtkconv); |
|
6d8cec169c3f
Use a more appropriate signal for the markerline plugin. Fixes #7518.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22809
diff
changeset
|
143 | if (!win) |
| 15231 | 144 | return; |
| 145 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
146 | detach_from_pidgin_window(win, NULL); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
147 | attach_to_pidgin_window(win, NULL); |
| 15231 | 148 | } |
| 149 | ||
|
22809
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
150 | static void |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
151 | jump_to_markerline(PurpleConversation *conv, gpointer null) |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
152 | { |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
153 | PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
154 | |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
155 | if (!gtkconv) |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
156 | return; |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
157 | |
|
32773
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
158 | gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
159 | "var mhr = document.getElementById(\"markerhr\");" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
160 | "if (mhr) {" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
161 | "window.scroll(0, mhr.offsetTop);" |
|
6700409ec3a3
JS-ify the markerline plugin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
162 | "}"); |
|
22809
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
163 | } |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
164 | |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
165 | static void |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
166 | conv_menu_cb(PurpleConversation *conv, GList **list) |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
167 | { |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
32773
diff
changeset
|
168 | gboolean enabled = ((PURPLE_IS_IM_CONVERSATION(conv) && purple_prefs_get_bool(PREF_IMS)) || |
|
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
32773
diff
changeset
|
169 | (PURPLE_IS_CHAT_CONVERSATION(conv) && purple_prefs_get_bool(PREF_CHATS))); |
|
22809
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
170 | PurpleMenuAction *action = purple_menu_action_new(_("Jump to markerline"), |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
171 | enabled ? PURPLE_CALLBACK(jump_to_markerline) : NULL, NULL, NULL); |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
172 | *list = g_list_append(*list, action); |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
173 | } |
|
c2b010c50376
Add a 'Jump to markerline' option in the conversation window menu to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
174 | |
| 15884 | 175 | static PurplePluginPrefFrame * |
| 176 | get_plugin_pref_frame(PurplePlugin *plugin) | |
| 15231 | 177 | { |
| 15884 | 178 | PurplePluginPrefFrame *frame; |
| 179 | PurplePluginPref *pref; | |
| 15231 | 180 | |
| 15884 | 181 | frame = purple_plugin_pref_frame_new(); |
| 15231 | 182 | |
| 15884 | 183 | pref = purple_plugin_pref_new_with_label(_("Draw Markerline in ")); |
| 184 | purple_plugin_pref_frame_add(frame, pref); | |
| 15231 | 185 | |
| 15884 | 186 | pref = purple_plugin_pref_new_with_name_and_label(PREF_IMS, |
| 15231 | 187 | _("_IM windows")); |
| 15884 | 188 | purple_plugin_pref_frame_add(frame, pref); |
| 15231 | 189 | |
| 15884 | 190 | pref = purple_plugin_pref_new_with_name_and_label(PREF_CHATS, |
| 15231 | 191 | _("C_hat windows")); |
| 15884 | 192 | purple_plugin_pref_frame_add(frame, pref); |
| 15231 | 193 | |
| 194 | return frame; | |
| 195 | } | |
| 196 | ||
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
197 | static PidginPluginInfo * |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
198 | plugin_query(GError **error) |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
199 | { |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
200 | const gchar * const authors[] = PLUGIN_AUTHORS; |
| 15231 | 201 | |
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
202 | return pidgin_plugin_info_new( |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
203 | "id", PLUGIN_ID, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
204 | "name", PLUGIN_NAME, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
205 | "version", DISPLAY_VERSION, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
206 | "category", PLUGIN_CATEGORY, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
207 | "summary", PLUGIN_SUMMARY, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
208 | "description", PLUGIN_DESCRIPTION, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
209 | "authors", authors, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
210 | "website", PURPLE_WEBSITE, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
211 | "abi-version", PURPLE_ABI_VERSION, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
212 | "preferences-frame", get_plugin_pref_frame, |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
213 | NULL |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
214 | ); |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
215 | } |
| 15231 | 216 | |
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
217 | static gboolean |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
218 | plugin_load(PurplePlugin *plugin, GError **error) |
| 15231 | 219 | { |
| 15884 | 220 | purple_prefs_add_none(PREF_PREFIX); |
| 221 | purple_prefs_add_bool(PREF_IMS, FALSE); | |
| 222 | purple_prefs_add_bool(PREF_CHATS, TRUE); | |
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
223 | |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
224 | attach_to_all_windows(); |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
225 | |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
226 | purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
227 | plugin, PURPLE_CALLBACK(conv_created), NULL); |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
228 | |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
229 | purple_signal_connect(purple_conversations_get_handle(), "conversation-extended-menu", |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
230 | plugin, PURPLE_CALLBACK(conv_menu_cb), NULL); |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
231 | return TRUE; |
| 15231 | 232 | } |
| 233 | ||
|
36757
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
234 | static gboolean |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
235 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
236 | { |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
237 | detach_from_all_windows(); |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
238 | |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
239 | return TRUE; |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
240 | } |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
241 | |
|
2e04586cf6e8
Refactored some pidgin plugins to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
242 | PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); |