diff options
| -rw-r--r-- | README.xwidget | 176 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 26 | ||||
| -rw-r--r-- | lisp/xwidget.el | 5 | ||||
| -rw-r--r-- | src/xwidget.c | 15 |
4 files changed, 125 insertions, 97 deletions
diff --git a/README.xwidget b/README.xwidget index 6b735cae13a..e9b8817b17b 100644 --- a/README.xwidget +++ b/README.xwidget | |||
| @@ -264,7 +264,8 @@ Currently I just allocate as large an area as the offscreen widget | |||
| 264 | desires. This works well most of the time. But a HTML page might in | 264 | desires. This works well most of the time. But a HTML page might in |
| 265 | principle be of infinite height so there will probably be cases where | 265 | principle be of infinite height so there will probably be cases where |
| 266 | this doesn't work too well. | 266 | this doesn't work too well. |
| 267 | ** TODO again a trace | 267 | ** DONE again a trace |
| 268 | CLOSED: [2011-10-28 Fri 13:48] | ||
| 268 | [2011-08-23 Tue] | 269 | [2011-08-23 Tue] |
| 269 | the hunch is that since I still hand-wave the view storage the array | 270 | the hunch is that since I still hand-wave the view storage the array |
| 270 | can get out of synchronous. so maybe switching to a lisp structure | 271 | can get out of synchronous. so maybe switching to a lisp structure |
| @@ -533,6 +534,9 @@ xdotool | |||
| 533 | xte xautomation | 534 | xte xautomation |
| 534 | crikey | 535 | crikey |
| 535 | libxdo | 536 | libxdo |
| 537 | |||
| 538 | *** TODO webkit raw keyboard event escape | ||
| 539 | c-c tab could send a raw tab to the webkit instance. | ||
| 536 | ** DONE remove the special-case for when the minibuffer is | 540 | ** DONE remove the special-case for when the minibuffer is |
| 537 | active. I added some code to reduce the annoying problem display artefacts | 541 | active. I added some code to reduce the annoying problem display artefacts |
| 538 | when making the minibuffer the selected window. This made xwidgets in the | 542 | when making the minibuffer the selected window. This made xwidgets in the |
| @@ -1203,6 +1207,10 @@ to see the problem surface to http://www.slashdot.org | |||
| 1203 | 1207 | ||
| 1204 | and then compare by resizing in Epiphany, which is also webkit based. | 1208 | and then compare by resizing in Epiphany, which is also webkit based. |
| 1205 | 1209 | ||
| 1210 | **** TODO try putting webkit osr inside a scrolling window | ||
| 1211 | it seems webkit is supposed to behave differently while embedded in a | ||
| 1212 | scrolling window. This is a bit cumbersome because the container stack | ||
| 1213 | is already deep. | ||
| 1206 | *** TODO xwidget webkit allow loading from string from emacs | 1214 | *** TODO xwidget webkit allow loading from string from emacs |
| 1207 | *** DONE xwidget-webkit-last-session | 1215 | *** DONE xwidget-webkit-last-session |
| 1208 | CLOSED: [2011-08-01 Mon 22:38] | 1216 | CLOSED: [2011-08-01 Mon 22:38] |
| @@ -1230,6 +1238,90 @@ that image-mode has special code to handle scrolling. the browser mode | |||
| 1230 | and image mode has some similarities. | 1238 | and image mode has some similarities. |
| 1231 | 1239 | ||
| 1232 | I made some delegation code frrom webkit mode to image mode. | 1240 | I made some delegation code frrom webkit mode to image mode. |
| 1241 | *** TODO internal links (page.html#section) do not work | ||
| 1242 | see xwidget-webkit-show-named-element | ||
| 1243 | |||
| 1244 | *** TODO sindicat notes | ||
| 1245 | Here are some comments from user "sindikat" and my replies | ||
| 1246 | |||
| 1247 | - site.com and http://site.com should be equivalent (simple site.com | ||
| 1248 | throws error) | ||
| 1249 | |||
| 1250 | Yes, but its unclear at what level in Emacs to do this | ||
| 1251 | properly. I added a url-tidy function as a start. | ||
| 1252 | |||
| 1253 | - http://ya.ru renders inadequatly (compare with any other browser) - | ||
| 1254 | the search text-input is way below | ||
| 1255 | |||
| 1256 | The problem is the size communication between Emacs and Webkit. | ||
| 1257 | |||
| 1258 | - doing PageDown is endless; so if you do 100 PageDowns, you have to | ||
| 1259 | do 100 PageUps to retun to the header of the page | ||
| 1260 | |||
| 1261 | True, I hadn't noticed. Thanks. | ||
| 1262 | |||
| 1263 | - http://linux.org.ru (just an example) renders incorrectly too - it | ||
| 1264 | should stretch horizontally | ||
| 1265 | |||
| 1266 | Size communication. | ||
| 1267 | |||
| 1268 | - obviously, pointing of mouse over some link should change it to | ||
| 1269 | pointing hand cursor | ||
| 1270 | |||
| 1271 | Need to verify with some other webkit browser. | ||
| 1272 | |||
| 1273 | - when you are somewhere on the middle of a long page, than go to some | ||
| 1274 | other page, you are still in the middle, instead of being again on | ||
| 1275 | the top | ||
| 1276 | |||
| 1277 | This is because I inherit from Image view mode. I kind of like it so | ||
| 1278 | we can add an option for it. | ||
| 1279 | |||
| 1280 | |||
| 1281 | - changing dropdown menus cause flickering | ||
| 1282 | |||
| 1283 | |||
| 1284 | - string entering is incorrect - by default it enters the title of the | ||
| 1285 | page, while it should be empty | ||
| 1286 | |||
| 1287 | The cause is the lack of return value in the webkit evaluation | ||
| 1288 | API. Ive made some fixes. | ||
| 1289 | |||
| 1290 | - internal links (page.html#section) do not work | ||
| 1291 | |||
| 1292 | ive added a rudimentary function "xwidget-webkit-show-named-element" for this | ||
| 1293 | |||
| 1294 | - maybe it's a good idea to implement Conkeror or some other | ||
| 1295 | keybindings, where you press 'f' then select the exact <input | ||
| 1296 | type="text"> where you want to enter text, without using mouse, | ||
| 1297 | etc.; | ||
| 1298 | |||
| 1299 | Indeed, this would require better DOM integration. | ||
| 1300 | |||
| 1301 | - pressing 'home' and 'end' puts nonsense into minibuffer | ||
| 1302 | |||
| 1303 | Probably because the Image mode derivative is mostly a hack. | ||
| 1304 | fixed now I think. | ||
| 1305 | |||
| 1306 | |||
| 1307 | |||
| 1308 | |||
| 1309 | |||
| 1310 | |||
| 1311 | - implement search (emacs internal isearch obviously doesn't work) | ||
| 1312 | |||
| 1313 | Either use the webkit search but that doesn't feel right. It would be | ||
| 1314 | better to expose the DOM and search that. | ||
| 1315 | |||
| 1316 | - some sites intercept with keyboard; example - | ||
| 1317 | http://www.artlebedev.ru/kovodstvo/business-lynch/2011/10/03/ uses | ||
| 1318 | Ctrl+left/right/up/down to navigate between pages - this should be | ||
| 1319 | implemented too | ||
| 1320 | |||
| 1321 | Keyboard integration is the unloved step-child of xwidgets, unfortunately. | ||
| 1322 | |||
| 1323 | |||
| 1324 | |||
| 1233 | ** TODO xwidget image display spec compatibility | 1325 | ** TODO xwidget image display spec compatibility |
| 1234 | some history: the first version of the xwidget display spec was | 1326 | some history: the first version of the xwidget display spec was |
| 1235 | the same as an image spec. This turned out not to be fantastic because | 1327 | the same as an image spec. This turned out not to be fantastic because |
| @@ -1369,85 +1461,3 @@ splint -Demacs -DHAVE_CONFIG_H -I. -I/home/joakim/build_myprojs/emacsnew/emac | |||
| 1369 | user reports that xwidgets segfaults on the 32 bit Mint distribution | 1461 | user reports that xwidgets segfaults on the 32 bit Mint distribution |
| 1370 | but not the 64 bit. Mint is an Ubuntu derivative. I got some | 1462 | but not the 64 bit. Mint is an Ubuntu derivative. I got some |
| 1371 | VirtualBox images to test with. | 1463 | VirtualBox images to test with. |
| 1372 | ** TODO sindicat notes | ||
| 1373 | Here are some comments from user "sindikat" and my replies | ||
| 1374 | |||
| 1375 | - site.com and http://site.com should be equivalent (simple site.com | ||
| 1376 | throws error) | ||
| 1377 | |||
| 1378 | Yes, but its unclear at what level in Emacs to do this | ||
| 1379 | properly. I added a url-tidy function as a start. | ||
| 1380 | |||
| 1381 | - http://ya.ru renders inadequatly (compare with any other browser) - | ||
| 1382 | the search text-input is way below | ||
| 1383 | |||
| 1384 | The problem is the size communication between Emacs and Webkit. | ||
| 1385 | |||
| 1386 | - doing PageDown is endless; so if you do 100 PageDowns, you have to | ||
| 1387 | do 100 PageUps to retun to the header of the page | ||
| 1388 | |||
| 1389 | True, I hadn't noticed. Thanks. | ||
| 1390 | |||
| 1391 | - http://linux.org.ru (just an example) renders incorrectly too - it | ||
| 1392 | should stretch horizontally | ||
| 1393 | |||
| 1394 | Size communication. | ||
| 1395 | |||
| 1396 | - obviously, pointing of mouse over some link should change it to | ||
| 1397 | pointing hand cursor | ||
| 1398 | |||
| 1399 | Need to verify with some other webkit browser. | ||
| 1400 | |||
| 1401 | - when you are somewhere on the middle of a long page, than go to some | ||
| 1402 | other page, you are still in the middle, instead of being again on | ||
| 1403 | the top | ||
| 1404 | |||
| 1405 | This is because I inherit from Image view mode. I kind of like it so | ||
| 1406 | we can add an option for it. | ||
| 1407 | |||
| 1408 | |||
| 1409 | - changing dropdown menus cause flickering | ||
| 1410 | |||
| 1411 | |||
| 1412 | - string entering is incorrect - by default it enters the title of the | ||
| 1413 | page, while it should be empty | ||
| 1414 | |||
| 1415 | The cause is the lack of return value in the webkit evaluation | ||
| 1416 | API. Ive made some fixes. | ||
| 1417 | |||
| 1418 | - internal links (page.html#section) do not work | ||
| 1419 | |||
| 1420 | ive added a rudimentary function "xwidget-webkit-show-named-element" for this | ||
| 1421 | |||
| 1422 | - maybe it's a good idea to implement Conkeror or some other | ||
| 1423 | keybindings, where you press 'f' then select the exact <input | ||
| 1424 | type="text"> where you want to enter text, without using mouse, | ||
| 1425 | etc.; | ||
| 1426 | |||
| 1427 | Indeed, this would require better DOM integration. | ||
| 1428 | |||
| 1429 | - pressing 'home' and 'end' puts nonsense into minibuffer | ||
| 1430 | |||
| 1431 | Probably because the Image mode derivative is mostly a hack. | ||
| 1432 | fixed now I think. | ||
| 1433 | |||
| 1434 | |||
| 1435 | |||
| 1436 | |||
| 1437 | |||
| 1438 | |||
| 1439 | - implement search (emacs internal isearch obviously doesn't work) | ||
| 1440 | |||
| 1441 | Either use the webkit search but that doesn't feel right. It would be | ||
| 1442 | better to expose the DOM and search that. | ||
| 1443 | |||
| 1444 | - some sites intercept with keyboard; example - | ||
| 1445 | http://www.artlebedev.ru/kovodstvo/business-lynch/2011/10/03/ uses | ||
| 1446 | Ctrl+left/right/up/down to navigate between pages - this should be | ||
| 1447 | implemented too | ||
| 1448 | |||
| 1449 | Keyboard integration is the unloved step-child of xwidgets, unfortunately. | ||
| 1450 | |||
| 1451 | |||
| 1452 | * TODO - internal links (page.html#section) do not work | ||
| 1453 | see xwidget-webkit-show-named-element | ||
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index d6512306ad1..1cd953d9e18 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p | 10 | ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p |
| 11 | ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively | 11 | ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively |
| 12 | ;;;;;; notevery notany every some mapcon mapcan mapl maplist map | 12 | ;;;;;; notevery notany every some mapcon mapcan mapl maplist map |
| 13 | ;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "26339d9571f9485bf34fa6d2ae38fc84") | 13 | ;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "15a5e127e1c9c9c3d1f398963b66cde7") |
| 14 | ;;; Generated autoloads from cl-extra.el | 14 | ;;; Generated autoloads from cl-extra.el |
| 15 | 15 | ||
| 16 | (autoload 'coerce "cl-extra" "\ | 16 | (autoload 'coerce "cl-extra" "\ |
| @@ -28,7 +28,7 @@ strings case-insensitively. | |||
| 28 | \(fn X Y)" nil nil) | 28 | \(fn X Y)" nil nil) |
| 29 | 29 | ||
| 30 | (autoload 'cl-mapcar-many "cl-extra" "\ | 30 | (autoload 'cl-mapcar-many "cl-extra" "\ |
| 31 | Not documented | 31 | |
| 32 | 32 | ||
| 33 | \(fn CL-FUNC CL-SEQS)" nil nil) | 33 | \(fn CL-FUNC CL-SEQS)" nil nil) |
| 34 | 34 | ||
| @@ -84,27 +84,27 @@ Return true if PREDICATE is false of some element of SEQ or SEQs. | |||
| 84 | (defalias 'cl-map-keymap 'map-keymap) | 84 | (defalias 'cl-map-keymap 'map-keymap) |
| 85 | 85 | ||
| 86 | (autoload 'cl-map-keymap-recursively "cl-extra" "\ | 86 | (autoload 'cl-map-keymap-recursively "cl-extra" "\ |
| 87 | Not documented | 87 | |
| 88 | 88 | ||
| 89 | \(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil) | 89 | \(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil) |
| 90 | 90 | ||
| 91 | (autoload 'cl-map-intervals "cl-extra" "\ | 91 | (autoload 'cl-map-intervals "cl-extra" "\ |
| 92 | Not documented | 92 | |
| 93 | 93 | ||
| 94 | \(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil) | 94 | \(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil) |
| 95 | 95 | ||
| 96 | (autoload 'cl-map-overlays "cl-extra" "\ | 96 | (autoload 'cl-map-overlays "cl-extra" "\ |
| 97 | Not documented | 97 | |
| 98 | 98 | ||
| 99 | \(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil) | 99 | \(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil) |
| 100 | 100 | ||
| 101 | (autoload 'cl-set-frame-visible-p "cl-extra" "\ | 101 | (autoload 'cl-set-frame-visible-p "cl-extra" "\ |
| 102 | Not documented | 102 | |
| 103 | 103 | ||
| 104 | \(fn FRAME VAL)" nil nil) | 104 | \(fn FRAME VAL)" nil nil) |
| 105 | 105 | ||
| 106 | (autoload 'cl-progv-before "cl-extra" "\ | 106 | (autoload 'cl-progv-before "cl-extra" "\ |
| 107 | Not documented | 107 | |
| 108 | 108 | ||
| 109 | \(fn SYMS VALUES)" nil nil) | 109 | \(fn SYMS VALUES)" nil nil) |
| 110 | 110 | ||
| @@ -180,7 +180,11 @@ Return t if OBJECT is a random-state object. | |||
| 180 | \(fn OBJECT)" nil nil) | 180 | \(fn OBJECT)" nil nil) |
| 181 | 181 | ||
| 182 | (autoload 'cl-float-limits "cl-extra" "\ | 182 | (autoload 'cl-float-limits "cl-extra" "\ |
| 183 | Not documented | 183 | Initialize the Common Lisp floating-point parameters. |
| 184 | This sets the values of: `most-positive-float', `most-negative-float', | ||
| 185 | `least-positive-float', `least-negative-float', `float-epsilon', | ||
| 186 | `float-negative-epsilon', `least-positive-normalized-float', and | ||
| 187 | `least-negative-normalized-float'. | ||
| 184 | 188 | ||
| 185 | \(fn)" nil nil) | 189 | \(fn)" nil nil) |
| 186 | 190 | ||
| @@ -228,12 +232,12 @@ PROPLIST is a list of the sort returned by `symbol-plist'. | |||
| 228 | \(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil) | 232 | \(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil) |
| 229 | 233 | ||
| 230 | (autoload 'cl-set-getf "cl-extra" "\ | 234 | (autoload 'cl-set-getf "cl-extra" "\ |
| 231 | Not documented | 235 | |
| 232 | 236 | ||
| 233 | \(fn PLIST TAG VAL)" nil nil) | 237 | \(fn PLIST TAG VAL)" nil nil) |
| 234 | 238 | ||
| 235 | (autoload 'cl-do-remf "cl-extra" "\ | 239 | (autoload 'cl-do-remf "cl-extra" "\ |
| 236 | Not documented | 240 | |
| 237 | 241 | ||
| 238 | \(fn PLIST TAG)" nil nil) | 242 | \(fn PLIST TAG)" nil nil) |
| 239 | 243 | ||
| @@ -267,7 +271,7 @@ This also does some trivial optimizations to make the form prettier. | |||
| 267 | \(fn FORM &optional ENV)" nil nil) | 271 | \(fn FORM &optional ENV)" nil nil) |
| 268 | 272 | ||
| 269 | (autoload 'cl-prettyexpand "cl-extra" "\ | 273 | (autoload 'cl-prettyexpand "cl-extra" "\ |
| 270 | Not documented | 274 | |
| 271 | 275 | ||
| 272 | \(fn FORM &optional FULL)" nil nil) | 276 | \(fn FORM &optional FULL)" nil nil) |
| 273 | 277 | ||
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index aeae8d59453..159ba5d12b0 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el | |||
| @@ -275,6 +275,11 @@ Argument H height." | |||
| 275 | (interactive "nWidth:\nnHeight:\n") | 275 | (interactive "nWidth:\nnHeight:\n") |
| 276 | ( xwidget-resize ( xwidget-webkit-current-session) w h)) | 276 | ( xwidget-resize ( xwidget-webkit-current-session) w h)) |
| 277 | 277 | ||
| 278 | (defun xwidget-webkit-fit-width () | ||
| 279 | (interactive) | ||
| 280 | (xwidget-webkit-adjust-size | ||
| 281 | (- (caddr (window-inside-pixel-edges)) (car (window-inside-pixel-edges))) | ||
| 282 | 1000)) | ||
| 278 | 283 | ||
| 279 | (defun xwidget-webkit-new-session (url) | 284 | (defun xwidget-webkit-new-session (url) |
| 280 | "Create a new webkit session buffer with URL." | 285 | "Create a new webkit session buffer with URL." |
diff --git a/src/xwidget.c b/src/xwidget.c index 6be377c8b90..49e8917892f 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -837,13 +837,22 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 3, 3, 0, doc: | |||
| 837 | h = XFASTINT (new_height); | 837 | h = XFASTINT (new_height); |
| 838 | 838 | ||
| 839 | 839 | ||
| 840 | printf("resize xwidget %d (%d,%d)->(%d,%d)",xw, xw->width,xw->height,w,h); | 840 | printf("resize xwidget %d (%d,%d)->(%d,%d)\n",xw, xw->width,xw->height,w,h); |
| 841 | xw->width=w; | 841 | xw->width=w; |
| 842 | xw->height=h; | 842 | xw->height=h; |
| 843 | //if theres a osr resize it 1st | 843 | //if theres a osr resize it 1st |
| 844 | if(xw->widget_osr){ | 844 | if(xw->widget_osr){ |
| 845 | gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow_osr), xw->width, xw->height); | 845 | printf("resize xwidget_osr\n"); |
| 846 | gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); | 846 | //gtk_container_set_resize_mode ( GTK_WINDOW(xw->widgetwindow_osr), GTK_RESIZE_QUEUE); |
| 847 | //gtk_container_set_resize_mode ( GTK_WINDOW(xw->widget_osr), GTK_RESIZE_QUEUE); | ||
| 848 | |||
| 849 | |||
| 850 | //gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow_osr), xw->width, xw->height); | ||
| 851 | gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); //minimum size | ||
| 852 | //gtk_window_resize( GTK_WINDOW(xw->widget_osr), xw->width, xw->height); | ||
| 853 | gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); | ||
| 854 | gtk_container_resize_children ( GTK_WINDOW(xw->widgetwindow_osr)); | ||
| 855 | |||
| 847 | } | 856 | } |
| 848 | 857 | ||
| 849 | for (int i = 0; i < MAX_XWIDGETS; i++) //TODO MVC refactor lazy linear search | 858 | for (int i = 0; i < MAX_XWIDGETS; i++) //TODO MVC refactor lazy linear search |