diff pidgin/gtkwebview.h @ 32442:fb8447f6649c

Rearrange these files a bit to group common functions together. Use a variable to store the pointer to the private GObject data which avoids extra casting. Also, use the GObject way of allocating a private data structure.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 04 Jan 2012 02:30:11 +0000
parents 34f778db624f
children 8436fb68930e
line wrap: on
line diff
--- a/pidgin/gtkwebview.h	Wed Jan 04 01:30:38 2012 +0000
+++ b/pidgin/gtkwebview.h	Wed Jan 04 02:30:11 2012 +0000
@@ -38,28 +38,22 @@
 #define GTK_WEBVIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_WEBVIEW, GtkWebView))
 #define GTK_WEBVIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_WEBVIEW, GtkWebViewClass))
 #define GTK_IS_WEBVIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_WEBVIEW))
-#define GTK_IS_WEBVIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_WEBVIEW))
+#define GTK_IS_WEBVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_WEBVIEW))
+#define GTK_WEBVIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_WEBVIEW, GtkWebViewClass))
 
-
-struct GtkWebViewPriv;
+typedef struct _GtkWebView GtkWebView;
+typedef struct _GtkWebViewClass GtkWebViewClass;
 
 struct _GtkWebView
 {
-	WebKitWebView webkit_web_view;
-
-	/*< private >*/
-	struct GtkWebViewPriv *priv;
+	WebKitWebView parent;
 };
 
-typedef struct _GtkWebView GtkWebView;
-
 struct _GtkWebViewClass
 {
 	WebKitWebViewClass parent;
 };
 
-typedef struct _GtkWebViewClass GtkWebViewClass;
-
 G_BEGIN_DECLS
 
 /**
@@ -77,12 +71,15 @@
 GtkWidget *gtk_webview_new(void);
 
 /**
- * Set the vertical adjustment for the GtkWebView.
+ * TODO WEBKIT: Right now this just tests whether an append has been called
+ * since the last clear or since the Widget was created.  So it does not
+ * test for load_string's called in between.
  *
- * @param webview  The GtkWebView object
- * @param vadj     The GtkAdjustment that control the webview
+ * @param webview The GtkWebView object
+ *
+ * @return gboolean indicating whether the webview is empty
  */
-void gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj);
+gboolean gtk_webview_is_empty(GtkWebView *webview);
 
 /**
  * A very basic routine to append html, which can be considered
@@ -104,17 +101,6 @@
 void gtk_webview_load_html_string_with_imgstore(GtkWebView *webview, const char *html);
 
 /**
- * TODO WEBKIT: Right now this just tests whether an append has been called
- * since the last clear or since the Widget was created.  So it does not
- * test for load_string's called in between.
- *
- * @param webview The GtkWebView object
- *
- * @return gboolean indicating whether the webview is empty
- */
-gboolean gtk_webview_is_empty(GtkWebView *webview);
-
-/**
  * Execute the JavaScript only after the webkit_webview_load_string
  * loads completely. We also guarantee that the scripts are executed
  * in the order they are called here. This is useful to avoid race
@@ -137,6 +123,14 @@
 char *gtk_webview_quote_js_string(const char *str);
 
 /**
+ * Set the vertical adjustment for the GtkWebView.
+ *
+ * @param webview  The GtkWebView object
+ * @param vadj     The GtkAdjustment that control the webview
+ */
+void gtk_webview_set_vadjustment(GtkWebView *webview, GtkAdjustment *vadj);
+
+/**
  * Scrolls the Webview to the end of its contents.
  *
  * @param webview The GtkWebView object