Sun, 17 Oct 2004 23:55:49 +0000
[gaim-migrate @ 11141]
Two things:
a. Added Enter as a gtk_binding to GtkIMHtml. This fixes everything.
Input methods now work. The "Enter sends" and "Ctrl-Enter sends" preferences
were removed and defaulted to yes and no respectively, BUT, in a very super-cool
turn of events, you can now add your own bindings to .gtkrc to make WHATEVER
YOU WANT send. Awesome. Someone should use g_signal_accumulator_true_handled
or something to make profiles and away messages able to insert newlines.
b. Removed "Use multi-colored screennames in chats," defaulted to yes, and
wrote a nifty algorithm to automatically adjust the colors to accomodate the
background (see http://gaim.sf.net/sean/porn-chat.png). People should play
around and tweak it a bit. The algorithm takes into consideration the
luminosity of the current background and the base hue to use for the screenname
in generating the new colors. Note that it does this while maintaining the hues.
Someone should optimize this so it skips over the floating point arithmatic when
the background color is white.
| 9791 | 1 | /* gaim |
| 2 | * | |
| 3 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 4 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 20 | */ | |
| 21 | #include "internal.h" | |
| 22 | #include "gtkgaim.h" | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
23 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
24 | #include "conversation.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
25 | #include "signals.h" |
| 9943 | 26 | #include "version.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
27 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
28 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
29 | #include "gtkplugin.h" |
|
4202
8b92de3b1c07
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
30 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
31 | #define ICONAWAY_PLUGIN_ID "gtk-iconaway" |
| 133 | 32 | |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5873
diff
changeset
|
33 | #ifdef _WIN32 |
|
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5873
diff
changeset
|
34 | __declspec(dllimport) GtkWidget *imaway; |
|
5917
a79e79eca294
[gaim-migrate @ 6349]
Mark Doliner <markdoliner@pidgin.im>
parents:
5912
diff
changeset
|
35 | #else |
|
a79e79eca294
[gaim-migrate @ 6349]
Mark Doliner <markdoliner@pidgin.im>
parents:
5912
diff
changeset
|
36 | G_MODULE_IMPORT GtkWidget *imaway; |
|
5912
32619a71edd2
[gaim-migrate @ 6344]
Herman Bloggs <herman@bluedigits.com>
parents:
5873
diff
changeset
|
37 | #endif |
| 133 | 38 | |
|
147
69703999f3fa
[gaim-migrate @ 157]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
138
diff
changeset
|
39 | #ifdef USE_APPLET |
|
69703999f3fa
[gaim-migrate @ 157]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
138
diff
changeset
|
40 | extern void applet_destroy_buddy(); |
|
69703999f3fa
[gaim-migrate @ 157]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
138
diff
changeset
|
41 | #endif |
| 133 | 42 | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
43 | static void |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
44 | iconify_windows(GaimAccount *account, char *state, char *message, void *data) |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
45 | { |
|
7118
280b3b85a28a
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
46 | GaimConvWindow *win; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
47 | GList *windows; |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
48 | GaimConnection *gc; |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
49 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
50 | gc = gaim_account_get_connection(account); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
51 | |
|
9962
1a129f4915dc
[gaim-migrate @ 10870]
Mark Doliner <markdoliner@pidgin.im>
parents:
9943
diff
changeset
|
52 | #if 0 /* STATUS */ |
|
2395
a8dcd0aec51a
[gaim-migrate @ 2408]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2098
diff
changeset
|
53 | if (!imaway || !gc->away) |
|
1406
45a8e718dd86
[gaim-migrate @ 1416]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1405
diff
changeset
|
54 | return; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
55 | |
|
3472
3939deb42c1e
[gaim-migrate @ 3523]
Robert McQueen <robot101@debian.org>
parents:
3188
diff
changeset
|
56 | gtk_window_iconify(GTK_WINDOW(imaway)); |
|
4726
6b4828c46d91
[gaim-migrate @ 5039]
Herman Bloggs <herman@bluedigits.com>
parents:
4585
diff
changeset
|
57 | gaim_blist_set_visible(FALSE); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
58 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
59 | for (windows = gaim_get_windows(); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
60 | windows != NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
61 | windows = windows->next) { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
62 | |
|
7118
280b3b85a28a
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
63 | win = (GaimConvWindow *)windows->data; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
64 | |
|
4476
bf88170ba269
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4468
diff
changeset
|
65 | if (GAIM_IS_GTK_WINDOW(win)) { |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5598
diff
changeset
|
66 | GaimGtkWindow *gtkwin; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
67 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
68 | gtkwin = GAIM_GTK_WINDOW(win); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
69 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
70 | gtk_window_iconify(GTK_WINDOW(gtkwin->window)); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
71 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
72 | } |
|
9962
1a129f4915dc
[gaim-migrate @ 10870]
Mark Doliner <markdoliner@pidgin.im>
parents:
9943
diff
changeset
|
73 | #endif /* STATUS */ |
| 133 | 74 | } |
| 75 | ||
| 3630 | 76 | /* |
| 77 | * EXPORTED FUNCTIONS | |
| 78 | */ | |
| 79 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
80 | static gboolean |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
81 | plugin_load(GaimPlugin *plugin) |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
82 | { |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
83 | gaim_signal_connect(gaim_accounts_get_handle(), "account-away", |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
84 | plugin, GAIM_CALLBACK(iconify_windows), NULL); |
| 133 | 85 | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
86 | return TRUE; |
| 133 | 87 | } |
| 88 | ||
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
89 | static GaimGtkPluginUiInfo ui_info = |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
90 | { |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
91 | NULL /**< get_config_frame */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
92 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
93 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
94 | static GaimPluginInfo info = |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
95 | { |
| 9943 | 96 | GAIM_PLUGIN_MAGIC, |
| 97 | GAIM_MAJOR_VERSION, | |
| 98 | GAIM_MINOR_VERSION, | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
99 | GAIM_PLUGIN_STANDARD, /**< type */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
100 | GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
101 | 0, /**< flags */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
102 | NULL, /**< dependencies */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
103 | GAIM_PRIORITY_DEFAULT, /**< priority */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
104 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
105 | ICONAWAY_PLUGIN_ID, /**< id */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
106 | N_("Iconify on Away"), /**< name */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
107 | VERSION, /**< version */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
108 | /** summary */ |
|
5598
4b30a063a33b
[gaim-migrate @ 6002]
Robert McQueen <robot101@debian.org>
parents:
5587
diff
changeset
|
109 | N_("Iconifies the buddy list and your conversations when you go away."), |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
110 | /** description */ |
|
5598
4b30a063a33b
[gaim-migrate @ 6002]
Robert McQueen <robot101@debian.org>
parents:
5587
diff
changeset
|
111 | N_("Iconifies the buddy list and your conversations when you go away."), |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
112 | "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
113 | GAIM_WEBSITE, /**< homepage */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
114 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
115 | plugin_load, /**< load */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
116 | NULL, /**< unload */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
117 | NULL, /**< destroy */ |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
118 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
119 | &ui_info, /**< ui_info */ |
| 8993 | 120 | NULL, /**< extra_info */ |
| 121 | NULL, | |
| 122 | NULL | |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
123 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
124 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
125 | static void |
|
5920
963bfdefee02
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5917
diff
changeset
|
126 | init_plugin(GaimPlugin *plugin) |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
127 | { |
| 133 | 128 | } |
| 129 | ||
| 6063 | 130 | GAIM_INIT_PLUGIN(iconaway, init_plugin, info) |