]> code.delx.au - gnu-emacs/blobdiff - src/xwidget.c
Remove unused arguments from make-xwidget
[gnu-emacs] / src / xwidget.c
index f436e95d686edf5f76c304a0021e58ab10d0a75c..4f1df1aabdfc13e22d30b0af234b7d82ee60ce94 100644 (file)
@@ -6,8 +6,8 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -156,27 +156,23 @@ webkit_navigation_policy_decision_requested_cb (WebKitWebView *,
 
 DEFUN ("make-xwidget",
        Fmake_xwidget, Smake_xwidget,
-       7, 8, 0,
-       doc: /* Make an xwidget from BEG to END of TYPE.
+       5, 6, 0,
+       doc: /* Make an xwidget of TYPE.
 If BUFFER is nil, use the current buffer.
 If BUFFER is a string and no such buffer exists, create it.
 TYPE is a symbol which can take one of the following values:
 
-- webkit-osr
+- webkit
 
 Returns the newly constructed xwidget, or nil if construction fails.  */)
-  (Lisp_Object beg, Lisp_Object end, Lisp_Object type,
+  (Lisp_Object type,
    Lisp_Object title, Lisp_Object width, Lisp_Object height,
    Lisp_Object arguments, Lisp_Object buffer)
 {
   CHECK_SYMBOL (type);
   CHECK_NATNUM (width);
   CHECK_NATNUM (height);
-  /* This should work a bit like "make-button"
-     (make-button BEG END &rest PROPERTIES)
-     TYPE etc. should be keyword args eventually.
-     (make-xwidget 3 3 'button "oei" 31 31 nil)
-     (xwidget-info (car xwidget-list))  */
+
   struct xwidget *xw = allocate_xwidget ();
   Lisp_Object val;
   xw->type = type;
@@ -387,9 +383,12 @@ webkit_download_cb (WebKitWebView *webkitwebview,
 }
 
 static gboolean
-webkit_mime_type_policy_typedecision_requested_cb
-(WebKitWebView *webView, WebKitWebFrame *frame, WebKitNetworkRequest *request,
- gchar *mimetype, WebKitWebPolicyDecision *policy_decision, gpointer user_data)
+webkit_mime_type_policy_typedecision_requested_cb (WebKitWebView *webView,
+                                                  WebKitWebFrame *frame,
+                                                  WebKitNetworkRequest *request,
+                                                  gchar *mimetype,
+                                                  WebKitWebPolicyDecision *policy_decision,
+                                                  gpointer user_data)
 {
   /* This function makes webkit send a download signal for all unknown
      mime types.  TODO: Defer the decision to Lisp, so that it's
@@ -404,10 +403,12 @@ webkit_mime_type_policy_typedecision_requested_cb
 }
 
 static gboolean
-webkit_new_window_policy_decision_requested_cb
-(WebKitWebView *webView, WebKitWebFrame *frame, WebKitNetworkRequest *request,
- WebKitWebNavigationAction *navigation_action,
- WebKitWebPolicyDecision *policy_decision, gpointer user_data)
+webkit_new_window_policy_decision_requested_cb (WebKitWebView *webView,
+                                               WebKitWebFrame *frame,
+                                               WebKitNetworkRequest *request,
+                                               WebKitWebNavigationAction *navigation_action,
+                                               WebKitWebPolicyDecision *policy_decision,
+                                               gpointer user_data)
 {
   struct xwidget *xw = g_object_get_data (G_OBJECT (webView), XG_XWIDGET);
   webkit_web_navigation_action_get_original_uri (navigation_action);
@@ -419,10 +420,12 @@ webkit_new_window_policy_decision_requested_cb
 }
 
 static gboolean
-webkit_navigation_policy_decision_requested_cb
-(WebKitWebView *webView, WebKitWebFrame *frame, WebKitNetworkRequest *request,
- WebKitWebNavigationAction *navigation_action,
- WebKitWebPolicyDecision *policy_decision, gpointer user_data)
+webkit_navigation_policy_decision_requested_cb (WebKitWebView *webView,
+                                               WebKitWebFrame *frame,
+                                               WebKitNetworkRequest *request,
+                                               WebKitWebNavigationAction *navigation_action,
+                                               WebKitWebPolicyDecision *policy_decision,
+                                               gpointer user_data)
 {
   struct xwidget *xw = g_object_get_data (G_OBJECT (webView), XG_XWIDGET);
   store_xwidget_event_string (xw, "navigation-policy-decision-requested",
@@ -760,14 +763,14 @@ VALUE is the amount to scroll, either relatively or absolutely.  */)
    Lisp_Object value)
 {
   CHECK_XWIDGET (xwidget);
-  CHECK_NATNUM (value);
+  CHECK_NUMBER (value);
   struct xwidget *xw = XXWIDGET (xwidget);
   GtkAdjustment *adjustment
     = ((EQ (Qhorizontal, axis)
        ? gtk_scrolled_window_get_hadjustment
        : gtk_scrolled_window_get_vadjustment)
        (GTK_SCROLLED_WINDOW (xw->widgetscrolledwindow_osr)));
-  double final_value = XFASTINT (value);
+  double final_value = XINT (value);
   if (EQ (Qt, relative))
     final_value += gtk_adjustment_get_value (adjustment);
   gtk_adjustment_set_value (adjustment, final_value);
@@ -980,7 +983,7 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_goto_uri);
   defsubr (&Sxwidget_webkit_execute_script);
   defsubr (&Sxwidget_webkit_get_title);
-  DEFSYM (Qwebkit_osr, "webkit-osr");
+  DEFSYM (Qwebkit_osr, "webkit");
 
   defsubr (&Sxwidget_size_request);
   defsubr (&Sdelete_xwidget_view);