diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/xwidget-test.el | 16 | ||||
| -rw-r--r-- | lisp/xwidget.el | 25 |
2 files changed, 33 insertions, 8 deletions
diff --git a/lisp/xwidget-test.el b/lisp/xwidget-test.el index 060ebcd6101..69f7cfff82b 100644 --- a/lisp/xwidget-test.el +++ b/lisp/xwidget-test.el | |||
| @@ -36,24 +36,24 @@ | |||
| 36 | ,@body)) | 36 | ,@body)) |
| 37 | 37 | ||
| 38 | (xwidget-demo "a-button" | 38 | (xwidget-demo "a-button" |
| 39 | (xwidget-insert (point-min) 1 "button" 40 50 1) | 39 | (xwidget-insert (point-min) 'button "button" 40 50 1) |
| 40 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) | 40 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) |
| 41 | 41 | ||
| 42 | (xwidget-demo "a-big-button" | 42 | (xwidget-demo "a-big-button" |
| 43 | (xwidget-insert (point-min) 1 "button" 400 500 1) | 43 | (xwidget-insert (point-min) 'button "button" 400 500 1) |
| 44 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) | 44 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) |
| 45 | 45 | ||
| 46 | (xwidget-demo "a-socket" | 46 | (xwidget-demo "a-socket" |
| 47 | (xwidget-insert (point-min) 3 "socket" 500 500 5) | 47 | (xwidget-insert (point-min) 'socket "socket" 500 500 5) |
| 48 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) | 48 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic)) |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | (xwidget-demo "basic" | 51 | (xwidget-demo "basic" |
| 52 | (xwidget-insert (point-min) 1 "button" 40 50 1) | 52 | (xwidget-insert (point-min) 'button "button" 40 50 1) |
| 53 | (xwidget-insert 15 2 "toggle" 60 30 2) | 53 | (xwidget-insert 15 'toggle "toggle" 60 30 2) |
| 54 | (xwidget-insert 30 3 "emacs" 400 200 3) | 54 | (xwidget-insert 30 'socket "emacs" 400 200 3) |
| 55 | (xwidget-insert 20 4 "slider" 100 50 4) | 55 | (xwidget-insert 20 'slider "slider" 100 50 4) |
| 56 | (xwidget-insert 40 3 "uzbl-core" 400 400 5) | 56 | (xwidget-insert 40 'socket "uzbl-core" 400 400 5) |
| 57 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic) | 57 | (define-key (current-local-map) [xwidget-event] 'xwidget-handler-demo-basic) |
| 58 | ) | 58 | ) |
| 59 | 59 | ||
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index ef200048f59..71dcc15df69 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el | |||
| @@ -38,6 +38,31 @@ hand-wave issues like these until the hard parts are solved. | |||
| 38 | (xwidget-resize-internal id width height) | 38 | (xwidget-resize-internal id width height) |
| 39 | )) | 39 | )) |
| 40 | 40 | ||
| 41 | |||
| 42 | (defun xwidget-socket-handler () | ||
| 43 | "creates plug for socket." | ||
| 44 | (interactive) | ||
| 45 | (message "socket handler xwidget %S" last-input-event) | ||
| 46 | (let* | ||
| 47 | ((xwidget-event-type (nth 2 last-input-event)) | ||
| 48 | (xwidget-id (nth 1 last-input-event))) | ||
| 49 | (cond ( (eq xwidget-event-type 'xembed-ready) | ||
| 50 | (let* | ||
| 51 | ((xembed-id (nth 3 last-input-event))) | ||
| 52 | (message "xembed ready event: %S xw-id:%s" xembed-id xwidget-id) | ||
| 53 | ;;TODO fetch process data from the xwidget. create it, store process info | ||
| 54 | ;;will start emacs/uzbl in a xembed socket when its ready | ||
| 55 | ;; (cond | ||
| 56 | ;; ((eq 3 xwidget-id) | ||
| 57 | ;; (start-process "xembed" "*xembed*" (format "%ssrc/emacs" default-directory) "-q" "--parent-id" (number-to-string xembed-id) ) ) | ||
| 58 | ;; ((eq 5 xwidget-id) | ||
| 59 | ;; (start-process "xembed2" "*xembed2*" "uzbl-core" "-s" (number-to-string xembed-id) "http://www.fsf.org" ) ) | ||
| 60 | |||
| 61 | ) | ||
| 62 | )))) | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 41 | ;; use declare here? | 66 | ;; use declare here? |
| 42 | ;; (declare-function xwidget-resize-internal "xwidget.c" ) | 67 | ;; (declare-function xwidget-resize-internal "xwidget.c" ) |
| 43 | ;; check-declare-function? | 68 | ;; check-declare-function? |