annotate pidgin/gtkwebview.h @ 32109:1cebf9aa291a

Use (void) in prototypes. (thanks Elliott)
author tdrhq@soc.pidgin.im
date Wed, 19 Aug 2009 02:43:17 +0000
parents 25d99f3621bb
children 24c8a98a6acc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
1 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
2 * @file gtkwebview.h Wrapper over the Gtk WebKitWebView component
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
3 * @ingroup pidgin
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
4 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
5
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
6 /* Pidgin is the legal property of its developers, whose names are too numerous
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
8 * source distribution.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
9 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
11 * under the terms of the GNU General Public License as published by
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
13 * (at your option) any later version.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
14 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
18 * GNU General Public License for more details.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
19 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
23 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
24
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
25 #ifndef _PIDGIN_WEBVIEW_H_
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
26 #define _PIDGIN_WEBVIEW_H_
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
27
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
28 #include <glib.h>
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
29 #include <gtk/gtk.h>
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
30 #include <webkit/webkit.h>
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
31
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
32 #include "notify.h"
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
33
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
34 #define GTK_TYPE_WEBVIEW (gtk_webview_get_type())
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
35 #define GTK_WEBVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEW, GtkWebView))
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
36 #define GTK_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEW, GtkWebViewClass))
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
37 #define GTK_IS_WEBVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_WEBVIEW))
32080
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
38 #define GTK_IS_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_WEBVIEW))
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
39
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
40
32080
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
41 struct GtkWebViewPriv;
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
42
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
43 struct _GtkWebView
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
44 {
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
45 WebKitWebView webkit_web_view;
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
46
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
47 /*< private >*/
32080
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
48 struct GtkWebViewPriv* priv;
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
49 };
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
50
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
51 typedef struct _GtkWebView GtkWebView;
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
52
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
53 struct _GtkWebViewClass
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
54 {
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
55 WebKitWebViewClass parent;
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
56 };
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
57
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
58 typedef struct _GtkWebViewClass GtkWebViewClass;
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
59
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
60
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
61 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
62 * Returns the GType for a GtkWebView widget
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
63 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
64 * @return the GType for GtkWebView widget
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
65 */
32109
1cebf9aa291a Use (void) in prototypes. (thanks Elliott)
tdrhq@soc.pidgin.im
parents: 32082
diff changeset
66 GType gtk_webview_get_type (void);
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
67
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
68 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
69 * Create a new GtkWebView object
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
70 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
71 * @return a GtkWidget corresponding to the GtkWebView object
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
72 */
32109
1cebf9aa291a Use (void) in prototypes. (thanks Elliott)
tdrhq@soc.pidgin.im
parents: 32082
diff changeset
73 GtkWidget* gtk_webview_new (void);
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
74
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
75 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
76 * A very basic routine to append html, which can be considered
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
77 * equivalent to a "document.write" using JavaScript.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
78 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
79 * @param webview The GtkWebView object
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
80 * @param markup The html markup to append
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
81 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
82 void gtk_webview_append_html (GtkWebView *webview, const char* markup);
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
83
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
84 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
85 * Rather than use webkit_webview_load_string, this routine
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
86 * parses and displays the <img id=?> tags that make use of the
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
87 * Pidgin imgstore.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
88 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
89 * @param webview The GtkWebView object
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
90 * @param html The HTML content to load
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
91 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
92 void gtk_webview_load_html_string_with_imgstore (GtkWebView* webview, const char* html);
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
93
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
94 /**
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
95 * (To be changed, right now it just tests whether an append has been
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
96 * called since the last clear or since the Widget was created. So it
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
97 * does not test for load_string's called in between.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
98 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
99 * @param webview The GtkWebView object
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
100 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
101 * @return gboolean indicating whether the webview is empty.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
102 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
103 gboolean gtk_webview_is_empty (GtkWebView *webview);
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
104
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
105 /**
32080
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
106 * Execute the JavaScript only after the webkit_webview_load_string
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
107 * loads completely. We also guarantee that the scripts are executed
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
108 * in the order they are called here.This is useful to avoid race
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
109 * conditions when calls JS functions immediately after opening the
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
110 * page.
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
111 *
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
112 * @param webview the GtkWebView object
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
113 * @param script the script to execute
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
114 */
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
115 void gtk_webview_safe_execute_script (GtkWebView *webview, const char* script);
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
116
b89351c7580b safely execute JS scripts only after loading is done. Untested code as of now, will test it in next commit.
tdrhq@soc.pidgin.im
parents: 32061
diff changeset
117 /**
32061
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
118 * A convenience routine to quote a string for use as a JavaScript
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
119 * string. For instance, "hello 'world'" becomes "'hello \\'world\\''"
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
120 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
121 * @param str The string to escape and quote
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
122 *
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
123 * @return the quoted string.
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
124 */
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
125 char* gtk_webview_quote_js_string (const char* str);
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
126
ac42a0dfda48 Apparently I missed these in my previous commit.
tdrhq@soc.pidgin.im
parents:
diff changeset
127 #endif /* _PIDGIN_WEBVIEW_H_ */