Commit Graph

1035 Commits

Author SHA1 Message Date
Joel Martin 4245363cf4 Add a viewport example/test.
Tested with an iPad 2.

This example shows a 400x200 viewport of an 800x400 display.

It tries to be intelligent about how much it redraws. It copies what
it can, and then when the user releases the mouse, it redraws the
"dirty" areas that were newly revealed.
2011-08-03 18:18:41 -05:00
Joel Martin ce3bdbccc2 Catch Mozilla prefixing of WebSocket.
Pull 475cfae from websockify.

In Firefox 7 Mozilla has added Websockets support but prefixed the
constructor with "Moz".
2011-08-02 08:02:51 -05:00
Joel Martin ad3f762409 Touch events and mouse button selectors.
First crack at supporting touch screen for devices like Android and
iOS tablets. Part of https://github.com/kanaka/noVNC/issues/48.

This change detects touch screen support and uses the touchstart,
touchmove, touchend events in place of the normal mouse events.

In order to support middle and right mouse clicks, if the device is
a touch device, then three toggle buttons are added to the UI
representing the left, middle and right mouse buttons. These select
which mouse button will be sent when the screen is touched. All the
buttons can be toggled off, in which case then the touch events only
move the mouse cursor rather than sending a mouse down and mouse up
for touchstart and touchend events respectively. This allows fairly
full control with the mouse on touch screens.
2011-07-23 21:24:59 -05:00
Joel Martin ac99a1f791 Change default PixelFormat. Fix canvas test.
Instead of R,G,B (red-shift of 0, green-shift of 8, and blue-shift
of 16), use the default ordering of B,G,R (red-shift of 16, green-shift of 8, and blue-shift
of 0) that tightvncserver uses (and that VMWare's VNC server seems to
require). Also, warn in the console if the server does not default to
the new format.

Fix the tests/canvas.html test. This is a general fix with regards to
the rename/refactor of canvas.js into display.js and not specific to
the color re-ordering.
2011-07-18 12:17:47 -05:00
Joel Martin c0c143a153 Version 0.1, debian packaging, license text.
noVNC version 0.1

Add debian packaging directory loosely based on
http://trac.zentyal.org/browser/trunk/extra/novnc/debian

Show web root directory on startup (pulled from websockify f1c8223).

Lintian fixups:
    - Some license text clarifications.
    - remove executable permission on utils/launch.sh and
      include/web-socket-js/web_socket.js
    - Add executable permission to utils/launch.sh
2011-07-14 15:57:01 -05:00
Joel Martin 29c3cbee8b README: Fix CloudSigma link. 2011-07-13 15:19:09 -05:00
Joel Martin 241a6caea6 README: link to CloudSigma as product using noVNC. 2011-07-13 15:17:22 -05:00
Joel Martin 4f8c746518 Pull websockify socket() static method.
Pull websockify 46e2fbe.

WebSocketServer.socket() is a static method takes a host and port and
an optional connect parameter. If connect is not set then it returns
a socket listening on host and port. If connect is set then
a connection will be made host and port and the socket returned. This
has IPv6 support like the addrinfo method it replaces.

Also, prefer IPv4 resolutions if they are in the list. This can be
overriden to prefer IPv6 resolutions for the same host using the
optional prefer_ipv6 parameter.
2011-07-09 13:39:04 -05:00
Joel Martin 3a39bf60f3 Pull IPv6 and HyBi fixes from websockify.
Pull 7ae8711 from websockify.
2011-07-07 15:14:41 -05:00
Joel Martin 123e5e7445 Pull IPv6 support from websockify.
Pull from websockify 247b74950d.
2011-07-07 11:47:11 -05:00
Joel Martin a4ff1f573d Fix ordering of tightPNG fills.
This addresses issue #65:
https://github.com/kanaka/noVNC/issues/65

When tightPNG encoded rects were received, any fill types were
immediately drawn to the canvas while images (PNG, JPEGs) were queued
for loading. This can cause screen corruption when things are changing
rapidly due to the misordering of fills vs images.

Also, remove the onload setting in each image on the queue and instead
decrease the tight image queue scanning interval (to 40ms or 25
scans per second).
2011-07-06 16:32:42 -05:00
Joel Martin c6fd71536f Show full pixelFormat received from server.
For debugging issue #70: https://github.com/kanaka/noVNC/issues/70
2011-07-01 13:17:20 -05:00
Joel Martin 61fc1f2287 Remove extraneous question mark.
Part of https://github.com/kanaka/noVNC/issues/69

Pull from websockify b590289de5.
2011-06-28 16:29:29 -05:00
Joel Martin 96513f5645 Merge branch 'master' of git@github.com:kanaka/noVNC 2011-06-28 16:23:57 -05:00
Joel Martin 0b7bc4e986 Only append random string to swf path in IE.
Issue https://github.com/kanaka/noVNC/issues/69

Thanks https://github.com/EdSchouten for the catch.

Import from websockify 9a2b50d8.
2011-06-28 16:22:50 -05:00
Joel Martin 95ff836e45 Merge pull request #67 from EdSchouten/master
Add support for setting the WebSocket URI path.
2011-06-27 07:26:00 -07:00
Ed Schouten 3b8caa4b09 Add support for passing the file name to get.
This change allows one to implement a single WebSockets proxy, which
multiplexes connections to different hosts.
2011-06-27 10:55:03 +02:00
Joel Martin 8a7ce3da6a Clarify companies/projects link description. 2011-06-26 16:02:42 -05:00
Joel Martin 68edd7f4f8 Move project/companies info to wiki.
Just have a list here without all the links.
2011-06-26 15:55:44 -05:00
Joel Martin 8c305c60ad Pull fix of recording from websockify.
Pull websockify 7f487fdbd.

The reocrd parameter will turn on recording of all messages sent
to and from the client. The record parameter is a file prefix. The
full file-name will be the prefix with an extension '.HANDLER_ID'
based on the handler ID.
2011-06-26 14:21:56 -05:00
Joel Martin fa8f14d56d Fix playback of recorded VNC.
- Update test mode calls to work with separate websock module.

- Pull in include/websock.js update 7f487fdbd from websockify.
2011-06-26 14:17:42 -05:00
Anthony Young 2270c7b5ae add ability to set title from url 2011-06-26 13:21:45 -05:00
Joel Martin 939cc6d563 Broadway link cleanup. 2011-06-13 14:29:51 -05:00
Joel Martin 6a545db4cb Merge branch 'master' of git@github.com:kanaka/noVNC 2011-06-13 14:28:38 -05:00
Joel Martin a6f3281283 Broadway HTML5 GDK backend link.
Broadway uses noVNC keyboard/input handling. Link to it.
2011-06-13 14:27:47 -05:00
Joel Martin 3859e1d35c Merge pull request #59 from smussmann/patch-1
Fixed minor typo in util/launch.sh informational output (s/to to/to/)
2011-05-19 10:08:30 -07:00
Sam Mussmann 19ed81fdff Fixed minor typo
s/to to/to/
2011-05-19 09:37:28 -07:00
Joel Martin 557efaf856 utils/websocket.py: disable debug output. 2011-05-12 12:55:04 -05:00
Joel Martin 7d14602759 Pull websockify 284ef3cc1a54
Including HyBi-07 support and refactor of send/recv.
2011-05-12 12:33:57 -05:00
Joel Martin 5210330a6c Refactor configuration attributes.
- Add conf_defaults which accepts an array of configuration
  attributes.
- Split out user configuration defaults from the actual configuration
  object.
- Add mode field and enforce read-only, write-once, read-write modes.
2011-05-11 17:31:53 -05:00
Joel Martin d890e8640f API changes/cleanup.
API changes:
    - include/canvas.js renamed to include/display.js
    - Display.rescale() method removed from API. Use Display.set_scale() instead.
    - Make logo configuration attribute of Display and display it when
      clear() is called if it is set.

API deprecations:
    - use RFB onUpdateState instead of updateState.
    - use RFB onClipboard instead of clipboardReceive.

See https://github.com/kanaka/noVNC/wiki/ModuleAPI for detailed noVNC
modules and API description.

Expand and normalize the event/callback interfaces. Standize on
"onEventName" form for callbacks.

    Callback Renames:
        - RFB updateState -> onUpdateState
        - RFB clipboardReceive -> onClipboard
        - Keyboard keyPress -> onKeyPress
        - Mouse mouseButton -> onMouseButton
        - Mouse mouseMove -> onMouseMove

    Callback Additions:
        - RFB onPasswordRequired
        - RFB onBell
        - RFB onFBUReceive
        - RFB onFBUComplete

Other:
- Add array type support to Util.conf_default()
- Removed a bunch of routines from the Display API that were just used
  internally and not actually by noVNC: flush, setFillColor,
  imageDataGet, imageDataCreate, rgbxImageData, rgbxImageFill,
  cmapImageData, cmapImageFill.
- More keyboard/mouse logging when debug turned on.
- Some JSLinting
2011-05-11 15:55:44 -05:00
Joel Martin 2fb665ec94 Merge branch 'master' of git@github.com:kanaka/noVNC 2011-05-09 18:09:59 -05:00
Joel Martin f31eeaa8ab Stop sending empty frames.
Pull from websockify a339a4856.
2011-05-09 17:22:02 -05:00
Joel Martin 1a2371fcd2 include/canvas.js: missed scale fix. 2011-04-29 14:04:40 -05:00
Joel Martin 58b4c53661 Fix scale/rescale attribute/hooks.
Still buggy so not yet activated in the UI, but the hooks are at least
here.
2011-04-29 14:01:40 -05:00
Joel Martin 1ac21e2941 README.md: adjust links to clarify.
Separate the links from each other so it's obvious where the links
are.
2011-04-24 12:52:19 -05:00
Joel Martin 4529ec0176 README.md: Add OpenStack doc and video link. 2011-04-24 12:45:58 -05:00
Joel Martin 667ef9bae8 README.md: fix wiki links.
github changed something about relative links.
2011-04-24 12:34:09 -05:00
Joel Martin bbee8098c2 tests/browser.js: Missing. Needed for arrays.html test. 2011-04-21 08:45:04 -05:00
Joel Martin 41b9ae6ec9 Sync with websockify. Save handshake headers.
Derived classes will almost certainly want to make use of the raw
info.
2011-04-19 09:37:43 -05:00
Joel Martin eb6426b4bc input.js: remove redundant switch case statments.
Issue #21 - non-US key handling.
2011-04-15 08:48:04 -06:00
Joel Martin dc4131b14a input.js: uncomment special key handling for non-US keys.
Issue #21 - non-US keyboard layouts.

The code section for tab, backspace and enter was commented out for
testing but got checked in that way. Fix that.
2011-04-15 08:40:20 -06:00
Joel Martin b7c9657b83 include/input.js: change to LGPL-2 or later.
Requested by Alexander Larsson at Red Hat to allow incorporation of
solution into HTML5 gtk 3.0 backend.
2011-04-14 11:25:11 -06:00
Joel Martin fac149ddbe input.js: adjust special key handling for non-US keys.
Issue #21 - non-US keyboard layouts.

Only identify some keys as special during the keyDown event so that
when using non-US keyboards the values don't overlap with the values
for normal keys.

Some keys have to still be identified in both keyDown and keyPress
since they generate both: backspace and enter for Firefox and Opera,
tab for Opera.
2011-04-12 09:06:11 -05:00
Joel Martin 303819eaa9 util/json2graph.py: new location for json2graph.py.
Also clarify usage statement with legend height adjustment.

Remove console.log in arrays.js so that it works in firefox without
firebug.
2011-04-06 11:19:02 -05:00
Joel Martin 40e5c25ad8 utils/rebind, utils/u2x11: use /usr/bin/env 2011-04-06 10:05:59 -05:00
Joel Martin 0a92014700 include/webutil.js: fix dirObj undefined attribute. 2011-04-05 14:46:22 -05:00
Joel Martin d0c29bb679 Fix copyright year to 2011. 2011-04-05 14:44:47 -05:00
Joel Martin c96f900336 Refactor keyboard event handling.
This is part of addressing issue #21 - non-US keyboard layouts.

There are several challenges when dealing with keyboard events:
  - The meaning and use of keyCode, charCode and which depends on
    both the browser and the event type (keyDown/Up vs keyPress).
  - We cannot automatically determine the keyboard layout
  - The keyDown and keyUp events have a keyCode value that has not
    been translated by modifier keys.
  - The keyPress event has a translated (for layout and modifiers)
    character code but the attribute containing it differs. keyCode
    contains the translated value in WebKit (Chrome/Safari), Opera
    11 and IE9. charCode contains the value in WebKit and Firefox.
    The which attribute contains the value on WebKit, Firefox and
    Opera 11.
  - The keyDown/Up keyCode value indicates (sort of) the physical
    key was pressed but only for standard US layout. On a US
    keyboard, the '-' and '_' characters are on the same key and
    generate a keyCode value of 189. But on an AZERTY keyboard even
    though they are different physical keys they both still
    generate a keyCode of 189!
  - To prevent a key event from propagating to the browser and
    causing unwanted default actions (such as closing a tab,
    opening a menu, shifting focus, etc) we must suppress this
    event in both keyDown and keyPress because not all key strokes
    generate on a keyPress event. Also, in WebKit and IE9
    suppressing the keyDown prevents a keyPress but other browsers
    still generated a keyPress even if keyDown is suppressed.

For safe key events, we wait until the keyPress event before
reporting a key down event. For unsafe key events, we report a key
down event when the keyDown event fires and we suppress any further
actions (including keyPress).

In order to report a key up event that matches what we reported
for the key down event, we keep a list of keys that are currently
down. When the keyDown event happens, we add the key event to the
list. If it is a safe key event, then we update the which attribute
in the most recent item on the list when we received a keyPress
event (keyPress should immediately follow keyDown). When we
received a keyUp event we search for the event on the list with
a matching keyCode and we report the character code using the value
in the 'which' attribute that was stored with that key.

For character codes above 255 we use a character code to keysym lookup
table. This is generated using the util/u2x11 script contributed by
Colin Dean (xvpsource.org).
2011-04-05 14:26:54 -05:00
Joel Martin d1bd5ec7d4 Fix focus/clipboard related to mouse/keyboard refactor. 2011-04-03 17:51:47 -05:00