Joel Martin [Thu, 12 Jan 2012 23:07:07 +0000 (17:07 -0600)]
Merge remote branch 'origin/issue-70'
Conflicts:
include/display.js
include/rfb.js
This merges in the fix for https://github.com/kanaka/noVNC/issues/70
This changes noVNC to use the preferred color ordering that most VNC
server prefer and that VMWare VNC requires. It's possible this may
break some VNC servers out there in which case we might have to do
something a bit more subtle such as having alternate render functions
for little and big endian color ordering.
Based on proposal from @mightpenguin:
Matthew Balman <emperor@mightypenguin.org>
If view_only option is set then do not send mouse and keyboard events.
This is not a secure/enforced way to make a client view only. To
enforce view only at the server, most VNC servers support setting
a view only password.
- Use array module for unmasking HyBi when no numpy module is
available.
- Detect client close properly when using python 3.
- Print request URL path is specified.
- New option --run-once will exit after handling a single WebSocket
connection (but not ater flash policy or normal web requests).
- New option --timeout TIME will stop listening for new connections
after exit after TIME seconds (the master process shuts down).
Existing WebSocket connections will continue but once all
connections are closed all processes will terminate.
Joel Martin [Mon, 26 Sep 2011 16:28:24 +0000 (11:28 -0500)]
Remove support for non-HTML5 browsers.
Display API change:
- getTile -> startTile (no longer returns a tile)
- setSubTile -> subTile (drop img/tile first parameter)
- putTile -> finishTile (no longer takes img/tile paramter)
The Display tile logic uses canvas image data directly and
caches/reuses a 16x16 imageData tile (for other sizes, the tile is
create for each call). This gives a 30% speedup on Chrome
13 (and no significant change for Firefox 3.6/4.0).
Other:
- Remove rgbxImageFill and cmapImageFill routines.
- Simplify constructor tests and just error if createImageData is not
supported by canvas instead of .
- Remove webkit canvas bug workaround that effects Chrome 7. Chrome
7 usage share is now less than 0.5 percent and the workaround is
ugly. Drop the function wrapping in the constructor and the canvas
flush() routine.
- Remove support for getImageData (Opera 11+ now required)
Joel Martin [Fri, 23 Sep 2011 05:51:55 +0000 (00:51 -0500)]
Fixing iOS clipping, keyboard issues.
- Make sure that on iOS the clipping setting is always forced to be
enabled.
- Hide the showKeyboard button unless connected.
- Use the URL text entry method and disable autocorrect and
autocapitalize in the show keyboard input box.
Joel Martin [Fri, 23 Sep 2011 05:04:01 +0000 (00:04 -0500)]
Only show move/drag button when clipping. Cleanup.
Cleanup:
- remove unused changeViewportMeta function from include/ui.js
- remove some debug output and debug CSS.
- rename panel toggle functions and put them in same location in the
code.
- refactor some code from updateState to updateVisualState routine
(renamed from updateSettingsState).
Joel Martin [Thu, 22 Sep 2011 15:36:23 +0000 (10:36 -0500)]
Viewport clip/drag for mobile/touchscreen devices.
API changes (forward compatible):
- Display: add 'viewport' conf option to turn on and off viewport
mode.
- RFB: add 'viewportDrag' option to enable/disable viewport dragging
mode.
Other:
- Add clip mode setting to default UI. For touch devices, clipping is
forced on.
- Use CSS media queries to adjust visual elements based on screen
size. Especially disconnected logo size/position and button text size.
- Catch page unload while connected and give a confirm dialog.
- Change mouse button selector to a single button that changes between
' ', 'L', 'M', 'R' when clicked (empty means mouse is just being
moved and doesn't send clicks).
- include/ui.js:setViewClip() routine sets the clipping of the
viewport to the current size of the viewport area (if clipping is
enabled).
- include/ui.js:setViewDrag() toggles/enables/disables viewport
dragging mode.
- Add several images for the UI and for Apple devices:
- images/clipboard.png: clipboard menu icon
- images/connect.png: connect menu icon
- images/disconnect.png: disconnect button icon
- images/keyboard.png: show keyboard button
- images/move.png: viewport drag/move toggle button
- images/settings.png: settings menu icon
- images/screen_320x460.png: iOS app/desktop link start image
- images/screen_57x57.png: iOS app icon
- images/screen_700x700.png: full size noVNC image
Joel Martin [Tue, 13 Sep 2011 18:14:11 +0000 (13:14 -0500)]
Fix window/document sizing in firefox.
Another firefox issue is that height: 100% is calculated as 100% of
the containing element even when the containing element is the window.
This means that the size of any sibling element shifts the window size
down by that much and causes the vertical scroll bars to appear. This
doesn't happen in Chrome.
- So instead, put a pad element inside the noVNC_screen element that
is the size of the control bar. This is hidden by the control bar,
however, it causes things to be sized correctly.
Joel Martin [Tue, 13 Sep 2011 17:17:44 +0000 (12:17 -0500)]
Firefox offset bug: use margin instead of padding.
For some reason, the position calculation is broken in firefox when
a DOM object in the ancestry change uses padding. So use margin to
shift the view area down.
Joel Martin [Tue, 13 Sep 2011 14:54:44 +0000 (09:54 -0500)]
Viewport handling in include/display.js
Part of mobile device support:
https://github.com/kanaka/noVNC/issues/48
The Display object is redefined as a larger display region with
an equal or smaller visible viewport. The size of the full display
region is set/changed using resize(). The viewport is set/changed
using viewportChange().
All exposed routines that draw on the display now take coordinates
that are absolute (relative to the full display region). For example,
the result of fillRect(100, 100, 10, 10, [255,0,0]) will appear in the
canvas at (0,0) if the viewport is set to (100,100).
Details:
- Move the generic part of the viewport code from tests/viewport.html
into include/display.
- Add two new routines to the Display interface:
- viewportChange(deltaX, deltaY, width, height)
- This adjusts the position of the visible viewport and/or the
size of the viewport.
- deltaX and deltaY specify how the position of the viewport
should be shifted. The position of the viewport is clamped
to the full region size (i.e. cannot outside the display
region).
- The clean and dirty regions of the display are updated based
on calls to this routine. For example, if the viewport width
is increased, then there is now a dirty box on the right
side of the viewport. Another example, if the viewport is
shifted down and to the left over the display region, there
are now two dirty boxes: one on the left side and one
on the bottom of the viewport.
- getCleanDirtyReset()
- This returns an object with the clean box and a list of
dirty boxes (that need to be redrawn).
{'cleanBox':
{'x': x, 'y': y, 'w': w, 'h': h},
'dirtyBoxes':
[{'x': x, 'y': y, 'w': w, 'h': h}, ...]
}
- The coordinates in the clean and dirty boxes are absolute
coordinates (relative to the full display region) but they
are clipped to the visible viewport.
- Calling this function also resets the clean rectangle to be
the whole viewport (i.e. nothing visible needs to be redrawn
dirty) so the caller of this routine is responsible for
redrawing any
Joel Martin [Wed, 3 Aug 2011 23:18:41 +0000 (18:18 -0500)]
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.
Joel Martin [Sun, 24 Jul 2011 02:24:59 +0000 (21:24 -0500)]
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.
Joel Martin [Mon, 18 Jul 2011 17:17:47 +0000 (12:17 -0500)]
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.
Joel Martin [Thu, 14 Jul 2011 20:57:01 +0000 (15:57 -0500)]
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
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.
Joel Martin [Wed, 6 Jul 2011 21:32:42 +0000 (16:32 -0500)]
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).
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.