Mercurial > pidgin.yaz
comparison pidgin/gtkwebview.c @ 32526:a2fd5f08ed49
cleaning up code.
author | tdrhq@soc.pidgin.im |
---|---|
date | Fri, 07 Aug 2009 18:38:31 +0000 |
parents | ac42a0dfda48 |
children | 2af29d62cfde |
comparison
equal
deleted
inserted
replaced
32525:d0be198c4694 | 32526:a2fd5f08ed49 |
---|---|
1 /* | |
2 * @file gtkwebview.c GTK+ WebKitWebView wrapper class. | |
3 * @ingroup pidgin | |
4 */ | |
5 | |
6 /* pidgin | |
7 * | |
8 * Pidgin is the legal property of its developers, whose names are too numerous | |
9 * to list here. Please refer to the COPYRIGHT file distributed with this | |
10 * source distribution. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * under the terms of the GNU General Public License as published by | |
14 * the Free Software Foundation; either version 2 of the License, or | |
15 * (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, | |
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 * GNU General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program; if not, write to the Free Software | |
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
25 * | |
26 */ | |
27 | |
28 #ifdef HAVE_CONFIG_H | |
29 #include <config.h> | |
30 #endif | |
1 | 31 |
2 #include <ctype.h> | 32 #include <ctype.h> |
3 #include <string.h> | 33 #include <string.h> |
4 #include <glib.h> | 34 #include <glib.h> |
5 #include <glib/gstdio.h> | 35 #include <glib/gstdio.h> |
6 #include <JavaScriptCore/JavaScript.h> | 36 #include <JavaScriptCore/JavaScript.h> |
7 | 37 |
8 #include "util.h" | 38 #include "util.h" |
9 #include "gtkwebview.h" | 39 #include "gtkwebview.h" |
40 #include "imgstore.h" | |
10 | 41 |
11 static WebKitWebViewClass *parent_class = NULL; | 42 static WebKitWebViewClass *parent_class = NULL; |
12 | 43 |
13 GtkWidget* gtk_webview_new () | 44 GtkWidget* gtk_webview_new () |
14 { | 45 { |
15 return GTK_WIDGET(g_object_new(gtk_webview_get_type(), NULL)); | 46 return GTK_WIDGET(g_object_new(gtk_webview_get_type(), NULL)); |
16 } | 47 } |
17 | 48 |
18 static char* | 49 static char* |
19 get_img_filename_by_id (GtkWebView* view, int id) | 50 get_image_filename_from_id (GtkWebView* view, int id) |
20 { | 51 { |
21 char *filename = NULL; | 52 char *filename = NULL; |
22 FILE *file; | 53 FILE *file; |
23 PurpleStoredImage* img; | 54 PurpleStoredImage* img; |
24 | 55 |
99 nid = atoi (id+1); | 130 nid = atoi (id+1); |
100 | 131 |
101 /* let's dump this, tag and then dump the src information */ | 132 /* let's dump this, tag and then dump the src information */ |
102 g_string_append_len (buffer, img, cur - img); | 133 g_string_append_len (buffer, img, cur - img); |
103 | 134 |
104 g_string_append_printf (buffer, " src='file://%s' ", get_img_filename_by_id (view, nid)); | 135 g_string_append_printf (buffer, " src='file://%s' ", get_image_filename_from_id (view, nid)); |
105 } | 136 } |
106 return g_string_free (buffer, FALSE); | 137 return g_string_free (buffer, FALSE); |
107 } | 138 } |
108 | 139 |
109 static void | 140 static void |