pidgin/pidgintalkatu.c

Sun, 07 Jun 2020 02:39:43 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 07 Jun 2020 02:39:43 -0500
branch
Ball--Gy-rgy/update-screenshot-url-in-appdata-file-1591293245974
changeset 40438
708c6622acc6
parent 39223
7016ec26cd75
child 40484
7df95db772d8
permissions
-rw-r--r--

closing merged branch

39223
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /* pidgin
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * source distribution.
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * (at your option) any later version.
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * GNU General Public License for more details.
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <pidgin/pidgintalkatu.h>
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 GtkWidget *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 pidgin_talkatu_editor_new_for_connection(PurpleConnection *pc) {
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 GtkWidget *editor = NULL;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 GtkWidget *view = NULL;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 g_return_val_if_fail(pc != NULL, NULL);
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 editor = talkatu_editor_new();
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 view = talkatu_editor_get_view(TALKATU_EDITOR(editor));
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 gtk_text_view_set_buffer(
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 GTK_TEXT_VIEW(view),
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 pidgin_talkatu_buffer_new_for_connection(pc)
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 );
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 return editor;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 }
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 GtkTextBuffer *
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 pidgin_talkatu_buffer_new_for_connection(PurpleConnection *pc) {
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 PurpleConnectionFlags flags = 0;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GtkTextBuffer *buffer = NULL;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 g_return_val_if_fail(pc != NULL, NULL);
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 flags = purple_connection_get_flags(pc);
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 if(flags & PURPLE_CONNECTION_FLAG_HTML) {
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 buffer = talkatu_html_buffer_new();
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 } else if(flags & PURPLE_CONNECTION_FLAG_FORMATTING_WBFO) {
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 buffer = talkatu_whole_buffer_new();
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 } else {
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 buffer = talkatu_buffer_new(NULL);
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 }
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 return buffer;
7016ec26cd75 Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 }

mercurial