refactored encodings to directories.

This commit is contained in:
betzalel 2017-06-14 10:54:15 +03:00
parent 89ff8ac9e3
commit f28d0de0ad
26 changed files with 1200 additions and 966 deletions

View File

@ -3,23 +3,37 @@
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/../elastictrail" /> <root url="file://$PROJECT_DIR$/../elastictrail" />
<root url="file://$PROJECT_DIR$/../gopkg.in" /> <root url="file://$PROJECT_DIR$/../gopkg.in" />
<root url="file://$PROJECT_DIR$/../srf.opb" /> <root url="file://$PROJECT_DIR$/../vncproxy1" />
<root url="file://$PROJECT_DIR$/../GoProjExample" /> <root url="file://$PROJECT_DIR$/../GoProjExample" />
<root url="file://$PROJECT_DIR$/../github.com" /> <root url="file://$PROJECT_DIR$/../srf.opb" />
<root url="file://$PROJECT_DIR$/../golang.org" />
<root url="file://$PROJECT_DIR$/../sourcegraph.com" /> <root url="file://$PROJECT_DIR$/../sourcegraph.com" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/github.com" />
<root url="file://$PROJECT_DIR$/../github.com" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/gopkg.in" />
<root url="file://$PROJECT_DIR$/../golang.org" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/golang.org" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/srf" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/version" />
<root url="file://$PROJECT_DIR$/../srf.storage" /> <root url="file://$PROJECT_DIR$/../srf.storage" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/sourcegraph.com" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/../elastictrail" /> <root url="file://$PROJECT_DIR$/../elastictrail" />
<root url="file://$PROJECT_DIR$/../gopkg.in" /> <root url="file://$PROJECT_DIR$/../gopkg.in" />
<root url="file://$PROJECT_DIR$/../srf.opb" /> <root url="file://$PROJECT_DIR$/../vncproxy1" />
<root url="file://$PROJECT_DIR$/../GoProjExample" /> <root url="file://$PROJECT_DIR$/../GoProjExample" />
<root url="file://$PROJECT_DIR$/../github.com" /> <root url="file://$PROJECT_DIR$/../srf.opb" />
<root url="file://$PROJECT_DIR$/../golang.org" />
<root url="file://$PROJECT_DIR$/../sourcegraph.com" /> <root url="file://$PROJECT_DIR$/../sourcegraph.com" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/github.com" />
<root url="file://$PROJECT_DIR$/../github.com" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/gopkg.in" />
<root url="file://$PROJECT_DIR$/../golang.org" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/golang.org" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/srf" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/version" />
<root url="file://$PROJECT_DIR$/../srf.storage" /> <root url="file://$PROJECT_DIR$/../srf.storage" />
<root url="file://$USER_HOME$/srf/experience.center.opb/src/sourcegraph.com" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="file://$PROJECT_DIR$" /> <root url="file://$PROJECT_DIR$" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GOROOT" path="C:/Go" /> <component name="GOROOT" path="/usr/local/Cellar/go/1.8.3/libexec" />
</project> </project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
</project> </project>

View File

@ -1,7 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="aeba8696-a0e4-4bdc-984c-b9ca26151c10" name="Default" comment="" /> <list default="true" id="aeba8696-a0e4-4bdc-984c-b9ca26151c10" name="Default" comment="">
<change type="DELETED" beforePath="$PROJECT_DIR$/vnc/client.go" afterPath="" />
<change type="MOVED" beforePath="$PROJECT_DIR$/vnc/enc-raw.go" afterPath="$PROJECT_DIR$/encodings/enc-raw.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/compiler.xml" afterPath="$PROJECT_DIR$/.idea/compiler.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/copyright/profiles_settings.xml" afterPath="$PROJECT_DIR$/.idea/copyright/profiles_settings.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/libraries/GOPATH__vncproxy_.xml" afterPath="$PROJECT_DIR$/.idea/libraries/GOPATH__vncproxy_.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/modules.xml" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vncproxy.iml" afterPath="$PROJECT_DIR$/.idea/vncproxy.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.vscode/launch.json" afterPath="$PROJECT_DIR$/.vscode/launch.json" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.vscode/tasks.json" afterPath="$PROJECT_DIR$/.vscode/tasks.json" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/LICENSE" afterPath="$PROJECT_DIR$/LICENSE" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/main.go" afterPath="$PROJECT_DIR$/main.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/Logger.go" afterPath="$PROJECT_DIR$/vnc/Logger.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/README.md" afterPath="$PROJECT_DIR$/vnc/README.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/client_auth.go" afterPath="$PROJECT_DIR$/vnc/client_auth.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/client_auth_test.go" afterPath="$PROJECT_DIR$/vnc/client_auth_test.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/client_test.go" afterPath="$PROJECT_DIR$/vnc/client_test.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/color.go" afterPath="$PROJECT_DIR$/vnc/color.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/enc-hextile.go" afterPath="$PROJECT_DIR$/vnc/enc-hextile.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/enc-rre.go" afterPath="$PROJECT_DIR$/vnc/enc-rre.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/enc-tight.go" afterPath="$PROJECT_DIR$/vnc/enc-tight.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/enc-zlib.go" afterPath="$PROJECT_DIR$/vnc/enc-zlib.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/enc-zrle.go" afterPath="$PROJECT_DIR$/vnc/enc-zrle.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/encoding.go" afterPath="$PROJECT_DIR$/vnc/encoding.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/pixel_format.go" afterPath="$PROJECT_DIR$/vnc/pixel_format.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/pointer.go" afterPath="$PROJECT_DIR$/vnc/pointer.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/recorder.go" afterPath="$PROJECT_DIR$/vnc/recorder.go" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/vnc/server_messages.go" afterPath="$PROJECT_DIR$/vnc/server_messages.go" />
</list>
<ignored path="vncproxy.iws" /> <ignored path="vncproxy.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
<ignored path=".idea/dataSources.local.xml" /> <ignored path=".idea/dataSources.local.xml" />
@ -18,63 +50,46 @@
<component name="CreatePatchCommitExecutor"> <component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" /> <option name="PATCH_PATH" value="" />
</component> </component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_TABLE_DETAILS" value="true" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager"> <component name="FavoritesManager">
<favorites_list name="vncproxy" /> <favorites_list name="vncproxy" />
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="client.go" pinned="false" current-in-tab="true"> <file leaf-file-name="client-conn.go" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="25" lean-forward="true" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="enc-raw.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/enc-raw.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="1" lean-forward="true" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" />
<folding>
<element signature="e#13#24#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="client-conn.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357"> <state relative-caret-position="15">
<caret line="28" column="48" lean-forward="false" selection-start-line="28" selection-start-column="48" selection-end-line="28" selection-end-column="48" /> <caret line="357" column="33" lean-forward="false" selection-start-line="357" selection-start-column="28" selection-end-line="357" selection-end-column="33" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="main.go" pinned="false" current-in-tab="false"> <file leaf-file-name="enc-rre.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/main.go"> <entry file="file://$PROJECT_DIR$/vnc/enc-rre.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221"> <state relative-caret-position="312">
<caret line="13" column="0" lean-forward="false" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" /> <caret line="31" column="0" lean-forward="false" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
<folding> <folding />
<element signature="e#14#68#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="client_test.go" pinned="false" current-in-tab="false"> <file leaf-file-name="readers.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/client_test.go"> <entry file="file://$PROJECT_DIR$/common/readers.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="162">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="97" column="41" lean-forward="false" selection-start-line="97" selection-start-column="23" selection-end-line="97" selection-end-column="41" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -90,11 +105,53 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="client_auth.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/client_auth.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="enc-raw.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/encodings/enc-raw.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="167">
<caret line="18" column="24" lean-forward="false" selection-start-line="18" selection-start-column="24" selection-end-line="18" selection-end-column="24" />
<folding>
<element signature="e#19#77#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="client_test.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/client_test.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="enc-hextile.go" pinned="false" current-in-tab="false"> <file leaf-file-name="enc-hextile.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/enc-hextile.go"> <entry file="file://$PROJECT_DIR$/vnc/enc-hextile.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="765"> <state relative-caret-position="402">
<caret line="45" column="55" lean-forward="false" selection-start-line="45" selection-start-column="55" selection-end-line="45" selection-end-column="55" /> <caret line="45" column="41" lean-forward="true" selection-start-line="45" selection-start-column="41" selection-end-line="45" selection-end-column="41" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Logger.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/Logger.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -103,18 +160,8 @@
<file leaf-file-name="enc-tight.go" pinned="false" current-in-tab="false"> <file leaf-file-name="enc-tight.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/enc-tight.go"> <entry file="file://$PROJECT_DIR$/vnc/enc-tight.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="385"> <state relative-caret-position="60">
<caret line="104" column="63" lean-forward="false" selection-start-line="104" selection-start-column="63" selection-end-line="104" selection-end-column="63" /> <caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="server_messages.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/vnc/server_messages.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="439">
<caret line="86" column="0" lean-forward="false" selection-start-line="86" selection-start-column="0" selection-end-line="86" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -122,6 +169,19 @@
</file> </file>
</leaf> </leaf>
</component> </component>
<component name="FindInProjectRecents">
<findStrings>
<find>Read</find>
<find>.Read</find>
<find>.read</find>
<find>server</find>
<find>uint8</find>
<find>TightMinToCompress</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings"> <component name="GradleLocalSettings">
<option name="externalProjectsViewState"> <option name="externalProjectsViewState">
<projects_view /> <projects_view />
@ -130,13 +190,17 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/main.go" />
<option value="$PROJECT_DIR$/vnc/enc-tight.go" /> <option value="$PROJECT_DIR$/vnc/enc-tight.go" />
<option value="$PROJECT_DIR$/vnc/encoding/enc-raw.go" /> <option value="$PROJECT_DIR$/vnc/encoding/enc-raw.go" />
<option value="$PROJECT_DIR$/vnc/enc-raw.go" /> <option value="$PROJECT_DIR$/vnc/enc-raw.go" />
<option value="$PROJECT_DIR$/vnc/common/client.go" /> <option value="$PROJECT_DIR$/vnc/common/client.go" />
<option value="$PROJECT_DIR$/vnc/encoding/client.go" /> <option value="$PROJECT_DIR$/vnc/encoding/client.go" />
<option value="$PROJECT_DIR$/main.go" />
<option value="$PROJECT_DIR$/vnc/server_messages.go" />
<option value="$PROJECT_DIR$/vnc/client.go" /> <option value="$PROJECT_DIR$/vnc/client.go" />
<option value="$PROJECT_DIR$/vnc/enc-rre.go" />
<option value="$PROJECT_DIR$/encodings/enc-raw.go" />
<option value="$PROJECT_DIR$/common/readers.go" />
</list> </list>
</option> </option>
</component> </component>
@ -147,11 +211,12 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="-8" /> <option name="x" value="256" />
<option name="y" value="-8" /> <option name="y" value="201" />
<option name="width" value="1936" /> <option name="width" value="1280" />
<option name="height" value="1176" /> <option name="height" value="773" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectReloadState"> <component name="ProjectReloadState">
<option name="STATE" value="1" /> <option name="STATE" value="1" />
</component> </component>
@ -163,13 +228,120 @@
<showLibraryContents /> <showLibraryContents />
<hideEmptyPackages /> <hideEmptyPackages />
<abbreviatePackageNames /> <abbreviatePackageNames />
<autoscrollToSource /> <autoscrollToSource ProjectPane="true" />
<autoscrollFromSource /> <autoscrollFromSource ProjectPane="true" />
<sortByType /> <sortByType />
<manualOrder /> <manualOrder />
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Go SDK 1.8.3" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.SyntheticLibraryElementNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Go SDK 1.8.3" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.SyntheticLibraryElementNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="bytes" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vnc" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="encodings" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="common" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope"> <pane id="Scope">
<subPane subId="Problems"> <subPane subId="Problems">
<PATH> <PATH>
@ -232,51 +404,24 @@
</PATH> </PATH>
</subPane> </subPane>
</pane> </pane>
<pane id="Scratches" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vncproxy" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="vnc" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="settings.editor.selected.configurable" value="project.propCompiler" /> <property name="settings.editor.selected.configurable" value="reference.settingsdialog.IDE.editor.colors.General" />
<property name="go.libraries.notification.had.been.shown" value="true" /> <property name="go.libraries.notification.had.been.shown" value="true" />
<property name="recentsLimit" value="5" /> <property name="recentsLimit" value="5" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/encodings" />
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/common" />
<recent name="C:\Users\betzalel\Dropbox\go\src\vncproxy\vnc" /> <recent name="C:\Users\betzalel\Dropbox\go\src\vncproxy\vnc" />
<recent name="C:\Users\betzalel\Dropbox\go\src\vncproxy\vnc\encoding" /> <recent name="C:\Users\betzalel\Dropbox\go\src\vncproxy\vnc\encoding" />
<recent name="C:\Users\betzalel\Dropbox\go\src\vncproxy\vnc\common" />
</key> </key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
@ -534,7 +679,7 @@
<method /> <method />
</configuration> </configuration>
<configuration default="true" type="GoRunFileConfiguration" factoryName="Go Single File"> <configuration default="true" type="GoRunFileConfiguration" factoryName="Go Single File">
<module name="" /> <module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" /> <working_directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" /> <filePath value="$PROJECT_DIR$" />
<method /> <method />
@ -735,9 +880,9 @@
</configuration> </configuration>
<list size="4"> <list size="4">
<item index="0" class="java.lang.String" itemvalue="Go Single File.runVnc" /> <item index="0" class="java.lang.String" itemvalue="Go Single File.runVnc" />
<item index="1" class="java.lang.String" itemvalue="Go Application.Build main.go and run" /> <item index="1" class="java.lang.String" itemvalue="Go Single File.Unnamed" />
<item index="2" class="java.lang.String" itemvalue="Go Application.Build main.go and run (1)" /> <item index="2" class="java.lang.String" itemvalue="Go Application.Build main.go and run" />
<item index="3" class="java.lang.String" itemvalue="Go Single File.Unnamed" /> <item index="3" class="java.lang.String" itemvalue="Go Application.Build main.go and run (1)" />
</list> </list>
<recent_temporary> <recent_temporary>
<list size="2"> <list size="2">
@ -784,11 +929,16 @@
<workItem from="1497276427351" duration="817000" /> <workItem from="1497276427351" duration="817000" />
<workItem from="1497277513428" duration="371000" /> <workItem from="1497277513428" duration="371000" />
<workItem from="1497278098752" duration="3181000" /> <workItem from="1497278098752" duration="3181000" />
<workItem from="1497313424857" duration="102000" />
<workItem from="1497313550726" duration="2070000" />
<workItem from="1497315693804" duration="252000" />
<workItem from="1497315971989" duration="1909000" />
<workItem from="1497322223215" duration="351000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="5305000" /> <option name="totallyTimeSpent" value="11052000" />
</component> </component>
<component name="TodoView" selected-index="2"> <component name="TodoView" selected-index="2">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -800,38 +950,38 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" /> <frame x="256" y="201" width="1280" height="773" extended-state="0" />
<editor active="true" />
<layout> <layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32981783" sideWeight="0.4914712" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32981783" sideWeight="0.4914712" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.35474592" sideWeight="0.5170576" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32892805" sideWeight="0.50646204" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.7036247" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.7036247" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32981783" sideWeight="0.4936034" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32981783" sideWeight="0.4936034" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.14658849" sideWeight="0.4947994" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23990306" sideWeight="0.4947994" order="0" side_tool="false" content_ui="combo" />
<window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32892805" sideWeight="0.49353796" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.14658849" sideWeight="0.50520056" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35474592" sideWeight="0.48294243" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35474592" sideWeight="0.48294243" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.14658849" sideWeight="0.50520056" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
@ -855,53 +1005,45 @@
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/main.go</url> <url>file://$PROJECT_DIR$/main.go</url>
<line>11</line> <line>11</line>
<properties />
<option name="timeStamp" value="5" /> <option name="timeStamp" value="5" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>76</line> <line>76</line>
<properties />
<option name="timeStamp" value="6" /> <option name="timeStamp" value="6" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>98</line> <line>98</line>
<properties />
<option name="timeStamp" value="7" /> <option name="timeStamp" value="7" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>103</line> <line>103</line>
<properties />
<option name="timeStamp" value="8" /> <option name="timeStamp" value="8" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>155</line> <line>156</line>
<properties />
<option name="timeStamp" value="9" /> <option name="timeStamp" value="9" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>172</line> <line>173</line>
<properties />
<option name="timeStamp" value="10" /> <option name="timeStamp" value="10" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/enc-tight.go</url> <url>file://$PROJECT_DIR$/vnc/enc-tight.go</url>
<line>177</line> <line>178</line>
<properties />
<option name="timeStamp" value="11" /> <option name="timeStamp" value="11" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint"> <line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/vnc/server_messages.go</url> <url>file://$PROJECT_DIR$/vnc/server_messages.go</url>
<line>78</line> <line>78</line>
<properties />
<option name="timeStamp" value="12" /> <option name="timeStamp" value="12" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
<option name="time" value="13" /> <option name="time" value="14" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager /> <watches-manager />
</component> </component>
@ -910,16 +1052,54 @@
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/vnc/client.go"> <entry file="file://$PROJECT_DIR$/main.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="360">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="24" column="60" lean-forward="false" selection-start-line="24" selection-start-column="60" selection-end-line="24" selection-end-column="60" />
<folding> <folding>
<element signature="e#123#158#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="28" column="48" lean-forward="false" selection-start-line="28" selection-start-column="48" selection-end-line="28" selection-end-column="48" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/enc-tight.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1003">
<caret line="59" column="23" lean-forward="false" selection-start-line="59" selection-start-column="23" selection-end-line="59" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="5" lean-forward="false" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
<folding>
<element signature="e#14#68#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476"> <state relative-caret-position="476">
@ -933,7 +1113,7 @@
<state relative-caret-position="187"> <state relative-caret-position="187">
<caret line="17" column="5" lean-forward="false" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" /> <caret line="17" column="5" lean-forward="false" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -946,16 +1126,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go"> <entry file="file://$PROJECT_DIR$/vnc/client.go" />
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476"> <state relative-caret-position="476">
@ -969,7 +1140,7 @@
<state relative-caret-position="289"> <state relative-caret-position="289">
<caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" /> <caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -982,16 +1153,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go"> <entry file="file://$PROJECT_DIR$/vnc/client.go" />
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="555">
<caret line="40" column="29" lean-forward="false" selection-start-line="40" selection-start-column="29" selection-end-line="40" selection-end-column="29" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315"> <state relative-caret-position="315">
@ -1013,21 +1175,12 @@
<state relative-caret-position="360"> <state relative-caret-position="360">
<caret line="24" column="60" lean-forward="false" selection-start-line="24" selection-start-column="60" selection-end-line="24" selection-end-column="60" /> <caret line="24" column="60" lean-forward="false" selection-start-line="24" selection-start-column="60" selection-end-line="24" selection-end-column="60" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="40" column="29" lean-forward="false" selection-start-line="40" selection-start-column="29" selection-end-line="40" selection-end-column="29" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -1036,16 +1189,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go"> <entry file="file://$PROJECT_DIR$/vnc/client.go" />
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476"> <state relative-caret-position="476">
@ -1067,31 +1211,13 @@
<state relative-caret-position="289"> <state relative-caret-position="289">
<caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" /> <caret line="17" column="5" lean-forward="true" selection-start-line="17" selection-start-column="5" selection-end-line="17" selection-end-column="5" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="28" column="0" lean-forward="true" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="555">
<caret line="40" column="29" lean-forward="false" selection-start-line="40" selection-start-column="29" selection-end-line="40" selection-end-column="29" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315"> <state relative-caret-position="315">
@ -1113,21 +1239,12 @@
<state relative-caret-position="360"> <state relative-caret-position="360">
<caret line="24" column="60" lean-forward="false" selection-start-line="24" selection-start-column="60" selection-end-line="24" selection-end-column="60" /> <caret line="24" column="60" lean-forward="false" selection-start-line="24" selection-start-column="60" selection-end-line="24" selection-end-column="60" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="40" column="29" lean-forward="false" selection-start-line="40" selection-start-column="29" selection-end-line="40" selection-end-column="29" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -1136,42 +1253,92 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go"> <entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file:///usr/local/Cellar/go/1.8/libexec/src/os/file_unix.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="1785">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="122" column="0" lean-forward="false" selection-start-line="122" selection-start-column="0" selection-end-line="122" selection-end-column="0" />
<folding> <folding />
<element signature="e#123#158#0" expanded="true" /> </state>
</folding> </provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="105">
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
</first_editor>
<second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/main.go"> <entry file="file://$PROJECT_DIR$/main.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221"> <state relative-caret-position="465">
<caret line="13" column="0" lean-forward="false" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" /> <caret line="37" column="28" lean-forward="false" selection-start-line="37" selection-start-column="28" selection-end-line="37" selection-end-column="28" />
<folding> <folding>
<element signature="e#14#68#0" expanded="true" /> <element signature="e#14#68#0" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file:///usr/local/Cellar/go/1.8.3/libexec/src/io/io.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161">
<caret line="76" column="5" lean-forward="false" selection-start-line="76" selection-start-column="5" selection-end-line="76" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/server_messages.go"> <entry file="file://$PROJECT_DIR$/vnc/server_messages.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="439"> <state relative-caret-position="420">
<caret line="86" column="0" lean-forward="false" selection-start-line="86" selection-start-column="0" selection-end-line="86" selection-end-column="0" /> <caret line="33" column="45" lean-forward="false" selection-start-line="33" selection-start-column="45" selection-end-line="33" selection-end-column="45" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/enc-tight.go"> <entry file="file:///usr/local/Cellar/go/1.8.3/libexec/src/bytes/buffer.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="385"> <state relative-caret-position="150">
<caret line="104" column="63" lean-forward="false" selection-start-line="104" selection-start-column="63" selection-end-line="104" selection-end-column="63" /> <caret line="14" column="64" lean-forward="false" selection-start-line="14" selection-start-column="64" selection-end-line="14" selection-end-column="64" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go" />
<entry file="file://$PROJECT_DIR$/vnc/enc-rre.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="312">
<caret line="31" column="0" lean-forward="false" selection-start-line="31" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/Logger.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/enc-hextile.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="402">
<caret line="45" column="41" lean-forward="true" selection-start-line="45" selection-start-column="41" selection-end-line="45" selection-end-column="41" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/encodings/enc-raw.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="167">
<caret line="18" column="24" lean-forward="false" selection-start-line="18" selection-start-column="24" selection-end-line="18" selection-end-column="24" />
<folding>
<element signature="e#19#77#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client_test.go"> <entry file="file://$PROJECT_DIR$/vnc/client_test.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -1188,42 +1355,38 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/enc-hextile.go"> <entry file="file://$PROJECT_DIR$/common/readers.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="765"> <state relative-caret-position="162">
<caret line="45" column="55" lean-forward="false" selection-start-line="45" selection-start-column="55" selection-end-line="45" selection-end-column="55" /> <caret line="97" column="41" lean-forward="false" selection-start-line="97" selection-start-column="23" selection-end-line="97" selection-end-column="41" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/enc-raw.go"> <entry file="file://$PROJECT_DIR$/vnc/enc-tight.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221"> <state relative-caret-position="60">
<caret line="13" column="1" lean-forward="true" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" /> <caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="31" />
<folding> <folding />
<element signature="e#13#24#0" expanded="true" /> </state>
</folding> </provider>
</entry>
<entry file="file://$PROJECT_DIR$/vnc/client_auth.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client-conn.go"> <entry file="file://$PROJECT_DIR$/vnc/client-conn.go">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357"> <state relative-caret-position="15">
<caret line="28" column="48" lean-forward="false" selection-start-line="28" selection-start-column="48" selection-end-line="28" selection-end-column="48" /> <caret line="357" column="33" lean-forward="false" selection-start-line="357" selection-start-column="28" selection-end-line="357" selection-end-column="33" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/vnc/client.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="25" lean-forward="true" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
<folding>
<element signature="e#123#158#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component> </component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>

View File

@ -1,4 +1,4 @@
package vnc package common
type Logger interface { type Logger interface {
Debug(v ...interface{}) Debug(v ...interface{})

28
common/encoding.go Normal file
View File

@ -0,0 +1,28 @@
package common
import (
"io"
)
// An Encoding implements a method for encoding pixel data that is
// sent by the server to the client.
type Encoding interface {
// The number that uniquely identifies this encoding type.
Type() int32
// Read reads the contents of the encoded pixel data from the reader.
// This should return a new Encoding implementation that contains
// the proper data.
Read(*PixelFormat, *Rectangle, io.Reader) (Encoding, error)
}
const (
EncodingRaw = 0
EncodingCopyRect = 1
EncodingRRE = 2
EncodingCoRRE = 4
EncodingHextile = 5
EncodingZlib = 6
EncodingTight = 7
EncodingZRLE = 16
)

111
common/readers.go Normal file
View File

@ -0,0 +1,111 @@
// Package vnc implements a VNC client.
//
// References:
// [PROTOCOL]: http://tools.ietf.org/html/rfc6143
package common
import (
"bytes"
"encoding/binary"
"fmt"
"io"
)
// type DataSource struct {
// conn io.Reader
// output io.Writer
// passThrough bool
// PixelFormat PixelFormat
// }Color
type RfbReader struct {
reader io.Reader
saveBytes bool
savedBuff bytes.Buffer
}
func (r *RfbReader) Read(p []byte) (n int, err error) {
readLen, err := r.reader.Read(p)
r.savedBuff.Write(p)
return readLen, err
}
func (r *RfbReader) SavedBuff() bytes.Buffer {
return r.savedBuff
}
type RfbReadHelper struct {
io.Reader
}
func (d *RfbReadHelper) ReadBytes(count int) ([]byte, error) {
buff := make([]byte, count)
_, err := io.ReadFull(d.Reader, buff)
if err != nil {
//if err := binary.Read(d.conn, binary.BigEndian, &buff); err != nil {
return nil, err
}
return buff, nil
}
func (d *RfbReadHelper) ReadUint8() (uint8, error) {
var myUint uint8
if err := binary.Read(d.Reader, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *RfbReadHelper) ReadUint16() (uint16, error) {
var myUint uint16
if err := binary.Read(d.Reader, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *RfbReadHelper) ReadUint32() (uint32, error) {
var myUint uint32
if err := binary.Read(d.Reader, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *RfbReadHelper) ReadCompactLen() (int, error) {
var err error
part, err := d.ReadUint8()
//byteCount := 1
len := uint32(part & 0x7F)
if (part & 0x80) != 0 {
part, err = d.ReadUint8()
//byteCount++
len |= uint32(part&0x7F) << 7
if (part & 0x80) != 0 {
part, err = d.ReadUint8()
//byteCount++
len |= uint32(part&0xFF) << 14
}
}
// for i := 0; i < byteCount; i++{
// rec.writeByte(portion[i]);
// }
return int(len), err
}
var TightMinToCompress int = 12
func (r *RfbReadHelper) ReadTightData(dataSize int) ([]byte, error) {
if int(dataSize) < TightMinToCompress {
return r.ReadBytes(int(dataSize))
}
zlibDataLen, err := r.ReadCompactLen()
fmt.Printf("compactlen=%d\n", zlibDataLen)
if err != nil {
return nil, err
}
//byte[] zlibData = new byte[zlibDataLen];
//rfb.readFully(zlibData);
return r.ReadBytes(zlibDataLen)
}

View File

@ -1,4 +1,8 @@
package vnc package common
import (
"fmt"
)
// Rectangle represents a rectangle of pixel data. // Rectangle represents a rectangle of pixel data.
type Rectangle struct { type Rectangle struct {
@ -9,6 +13,10 @@ type Rectangle struct {
Enc Encoding Enc Encoding
} }
func (r *Rectangle) String() string {
return fmt.Sprintf("(%d,%d) (width: %d, height: %d), Enc= %d", r.X, r.Y, r.Width, r.Height, r.Enc.Type())
}
// PixelFormat describes the way a pixel is formatted for a VNC connection. // PixelFormat describes the way a pixel is formatted for a VNC connection.
// //
// See RFC 6143 Section 7.4 for information on each of the fields. // See RFC 6143 Section 7.4 for information on each of the fields.

View File

@ -0,0 +1,26 @@
package encodings
import (
"io"
"vncproxy/common"
)
type CopyRectEncoding struct {
//Colors []Color
copyRectSrcX uint16
copyRectSrcY uint16
}
func (z *CopyRectEncoding) Type() int32 {
return 1
}
func (z *CopyRectEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
z.copyRectSrcX, _ = conn.ReadUint16()
z.copyRectSrcY, _ = conn.ReadUint16()
return z, nil
}
//////////

48
encodings/enc-corre.go Normal file
View File

@ -0,0 +1,48 @@
package encodings
import (
"io"
"vncproxy/common"
)
type CoRREEncoding struct {
//Colors []Color
}
func (z *CoRREEncoding) Type() int32 {
return 4
}
func (z *CoRREEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
bytesPerPixel := int(pixelFmt.BPP / 8)
numOfSubrectangles, _ := conn.ReadUint32()
//read whole rect background color
conn.ReadBytes(bytesPerPixel)
//read all individual rects (color=BPP + x=16b + y=16b + w=16b + h=16b)
_, err := conn.ReadBytes(int(numOfSubrectangles) * (bytesPerPixel + 4))
if err != nil {
return nil, err
}
return z, nil
//int nSubrects = rfb.readU32();
//byte[] bg_buf = new byte[bytesPerPixel];
//rfb.readFully(bytesPerPixel);
//Color pixel;
// if (bytesPixel == 1) {
// pixel = colors[bg_buf[0] & 0xFF];
// } else {
// pixel = new Color(bg_buf[2] & 0xFF, bg_buf[1] & 0xFF, bg_buf[0] & 0xFF);
// }
// memGraphics.setColor(pixel);
// memGraphics.fillRect(x, y, w, h);
// byte[] buf = new byte[nSubrects * (bytesPixel + 4)];
// rfb.readFully(buf);
}

View File

@ -1,6 +1,9 @@
package vnc package encodings
import "io" import (
"io"
"vncproxy/common"
)
const ( const (
HextileRaw = 1 HextileRaw = 1
@ -11,15 +14,16 @@ const (
) )
type HextileEncoding struct { type HextileEncoding struct {
Colors []Color //Colors []Color
} }
func (z *HextileEncoding) Type() int32 { func (z *HextileEncoding) Type() int32 {
return 5 return 5
} }
func (z *HextileEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) { func (z *HextileEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat} //conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
bytesPerPixel := int(conn.PixelFormat.BPP) / 8 bytesPerPixel := int(pixelFmt.BPP) / 8
//buf := make([]byte, bytesPerPixel) //buf := make([]byte, bytesPerPixel)
for ty := rect.Y; ty < rect.Y+rect.Height; ty += 16 { for ty := rect.Y; ty < rect.Y+rect.Height; ty += 16 {
th := 16 th := 16
@ -34,7 +38,7 @@ func (z *HextileEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (
} }
//handle Hextile Subrect(tx, ty, tw, th): //handle Hextile Subrect(tx, ty, tw, th):
subencoding, err := conn.readUint8() subencoding, err := conn.ReadUint8()
//fmt.Printf("hextile reader tile: (%d,%d) subenc=%d\n", ty, tx, subencoding) //fmt.Printf("hextile reader tile: (%d,%d) subenc=%d\n", ty, tx, subencoding)
if err != nil { if err != nil {
//fmt.Printf("error in hextile reader: %v\n", err) //fmt.Printf("error in hextile reader: %v\n", err)
@ -43,22 +47,22 @@ func (z *HextileEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (
if (subencoding & HextileRaw) != 0 { if (subencoding & HextileRaw) != 0 {
//ReadRawRect(c, rect, r) //ReadRawRect(c, rect, r)
conn.readBytes(tw * th * bytesPerPixel) conn.ReadBytes(tw * th * bytesPerPixel)
//fmt.Printf("hextile reader: HextileRaw\n") //fmt.Printf("hextile reader: HextileRaw\n")
continue continue
} }
if (subencoding & HextileBackgroundSpecified) != 0 { if (subencoding & HextileBackgroundSpecified) != 0 {
conn.readBytes(int(bytesPerPixel)) conn.ReadBytes(int(bytesPerPixel))
} }
if (subencoding & HextileForegroundSpecified) != 0 { if (subencoding & HextileForegroundSpecified) != 0 {
conn.readBytes(int(bytesPerPixel)) conn.ReadBytes(int(bytesPerPixel))
} }
if (subencoding & HextileAnySubrects) == 0 { if (subencoding & HextileAnySubrects) == 0 {
//fmt.Printf("hextile reader: no Subrects\n") //fmt.Printf("hextile reader: no Subrects\n")
continue continue
} }
//fmt.Printf("hextile reader: handling Subrects\n") //fmt.Printf("hextile reader: handling Subrects\n")
nSubrects, err := conn.readUint8() nSubrects, err := conn.ReadUint8()
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -67,7 +71,7 @@ func (z *HextileEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (
bufsize += int(nSubrects) * int(bytesPerPixel) bufsize += int(nSubrects) * int(bytesPerPixel)
} }
//byte[] buf = new byte[bufsize]; //byte[] buf = new byte[bufsize];
conn.readBytes(bufsize) conn.ReadBytes(bufsize)
} }
} }

View File

@ -1,24 +1,25 @@
package vnc package encodings
import "io" import (
"io"
"vncproxy/common"
)
// RawEncoding is raw pixel data sent by the server. // RawEncoding is raw pixel data sent by the server.
// //
// See RFC 6143 Section 7.7.1 // See RFC 6143 Section 7.7.1
type RawEncoding struct { type RawEncoding struct {
Colors []Color //Colors []Color
} }
func (*RawEncoding) Type() int32 { func (*RawEncoding) Type() int32 {
return 0 return 0
} }
func (*RawEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
func (*RawEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat} //conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
conn := common.RfbReadHelper{r}
bytesPerPixel := int(conn.PixelFormat.BPP / 8) bytesPerPixel := int(pixelFmt.BPP / 8)
//pixelBytes := make([]uint8, bytesPerPixel) //pixelBytes := make([]uint8, bytesPerPixel)
// var byteOrder binary.ByteOrder = binary.LittleEndian // var byteOrder binary.ByteOrder = binary.LittleEndian
@ -26,11 +27,11 @@ func (*RawEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encodi
// byteOrder = binary.BigEndian // byteOrder = binary.BigEndian
// } // }
colors := make([]Color, int(rect.Height)*int(rect.Width)) //colors := make([]vnc.Color, int(rect.Height)*int(rect.Width))
for y := uint16(0); y < rect.Height; y++ { for y := uint16(0); y < rect.Height; y++ {
for x := uint16(0); x < rect.Width; x++ { for x := uint16(0); x < rect.Width; x++ {
if _, err := conn.readBytes(bytesPerPixel); err != nil { if _, err := conn.ReadBytes(bytesPerPixel); err != nil {
return nil, err return nil, err
} }
@ -54,5 +55,5 @@ func (*RawEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encodi
} }
} }
return &RawEncoding{colors}, nil return &RawEncoding{}, nil
} }

28
encodings/enc-rre.go Normal file
View File

@ -0,0 +1,28 @@
package encodings
import "io"
import "vncproxy/common"
type RREEncoding struct {
//Colors []Color
}
func (z *RREEncoding) Type() int32 {
return 2
}
func (z *RREEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
bytesPerPixel := int(pixelFmt.BPP / 8)
numOfSubrectangles, _ := conn.ReadUint32()
//read whole rect background color
conn.ReadBytes(bytesPerPixel)
//read all individual rects (color=BPP + x=16b + y=16b + w=16b + h=16b)
_, err := conn.ReadBytes(int(numOfSubrectangles) * (bytesPerPixel + 8))
if err != nil {
return nil, err
}
return z, nil
}

View File

@ -1,9 +1,10 @@
package vnc package encodings
import ( import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"vncproxy/common"
) )
var TightMinToCompress int = 12 var TightMinToCompress int = 12
@ -20,7 +21,7 @@ const (
type TightEncoding struct { type TightEncoding struct {
output io.Writer output io.Writer
logger Logger logger common.Logger
} }
func (t *TightEncoding) SetOutput(output io.Writer) { func (t *TightEncoding) SetOutput(output io.Writer) {
@ -56,7 +57,7 @@ func (*TightEncoding) Type() int32 {
// return myUint, err // return myUint, err
// } // }
func calcTightBytePerPixel(pf PixelFormat) int { func calcTightBytePerPixel(pf *common.PixelFormat) int {
bytesPerPixel := int(pf.BPP / 8) bytesPerPixel := int(pf.BPP / 8)
var bytesPerPixelTight int var bytesPerPixelTight int
@ -68,13 +69,13 @@ func calcTightBytePerPixel(pf PixelFormat) int {
return bytesPerPixelTight return bytesPerPixelTight
} }
func (t *TightEncoding) Read(conn *ClientConn, rect *Rectangle, reader io.Reader) (Encoding, error) { func (t *TightEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, reader io.Reader) (common.Encoding, error) {
bytesPixel := calcTightBytePerPixel(conn.PixelFormat) bytesPixel := calcTightBytePerPixel(pixelFmt)
conn := common.RfbReadHelper{reader}
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat} //conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//var subencoding uint8 //var subencoding uint8
subencoding, err := conn.readUint8() subencoding, err := conn.ReadUint8()
if err != nil { if err != nil {
fmt.Printf("error in handling tight encoding: %v\n", err) fmt.Printf("error in handling tight encoding: %v\n", err)
return nil, err return nil, err
@ -98,19 +99,19 @@ func (t *TightEncoding) Read(conn *ClientConn, rect *Rectangle, reader io.Reader
case TightFill: case TightFill:
fmt.Printf("reading fill size=%d\n", bytesPixel) fmt.Printf("reading fill size=%d\n", bytesPixel)
//read color //read color
conn.readBytes(int(bytesPixel)) conn.ReadBytes(int(bytesPixel))
return t, nil return t, nil
case TightJpeg: case TightJpeg:
if conn.PixelFormat.BPP == 8 { if pixelFmt.BPP == 8 {
return nil, errors.New("Tight encoding: JPEG is not supported in 8 bpp mode") return nil, errors.New("Tight encoding: JPEG is not supported in 8 bpp mode")
} }
len, err := conn.readCompactLen() len, err := conn.ReadCompactLen()
if err != nil { if err != nil {
return nil, err return nil, err
} }
fmt.Printf("reading jpeg size=%d\n", len) fmt.Printf("reading jpeg size=%d\n", len)
conn.readBytes(len) conn.ReadBytes(len)
return t, nil return t, nil
default: default:
@ -118,12 +119,13 @@ func (t *TightEncoding) Read(conn *ClientConn, rect *Rectangle, reader io.Reader
fmt.Println("Compression control byte is incorrect!") fmt.Println("Compression control byte is incorrect!")
} }
handleTightFilters(subencoding, conn, rect, reader) handleTightFilters(subencoding, pixelFmt, rect, reader)
return t, nil return t, nil
} }
} }
func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, reader io.Reader) { func handleTightFilters(subencoding uint8, pixelFmt *common.PixelFormat, rect *common.Rectangle, reader io.Reader) {
conn := common.RfbReadHelper{reader}
var FILTER_ID_MASK uint8 = 0x40 var FILTER_ID_MASK uint8 = 0x40
//var STREAM_ID_MASK uint8 = 0x30 //var STREAM_ID_MASK uint8 = 0x30
@ -132,7 +134,7 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
var err error var err error
if (subencoding & FILTER_ID_MASK) > 0 { // filter byte presence if (subencoding & FILTER_ID_MASK) > 0 { // filter byte presence
filterid, err = conn.readUint8() filterid, err = conn.ReadUint8()
if err != nil { if err != nil {
fmt.Printf("error in handling tight encoding, reading filterid: %v\n", err) fmt.Printf("error in handling tight encoding, reading filterid: %v\n", err)
return return
@ -141,7 +143,7 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
} }
//var numColors uint8 //var numColors uint8
bytesPixel := calcTightBytePerPixel(conn.PixelFormat) bytesPixel := calcTightBytePerPixel(pixelFmt)
fmt.Printf("filter: %d\n", filterid) fmt.Printf("filter: %d\n", filterid)
// if rfb.rec != null { // if rfb.rec != null {
@ -152,11 +154,11 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
switch filterid { switch filterid {
case TightFilterPalette: //PALETTE_FILTER case TightFilterPalette: //PALETTE_FILTER
colorCount, err := conn.readUint8() colorCount, err := conn.ReadUint8()
paletteSize := colorCount + 1 // add one more paletteSize := colorCount + 1 // add one more
fmt.Printf("----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel) fmt.Printf("----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel)
//complete palette //complete palette
conn.readBytes(int(paletteSize) * bytesPixel) conn.ReadBytes(int(paletteSize) * bytesPixel)
var dataLength int var dataLength int
if paletteSize == 2 { if paletteSize == 2 {
@ -164,7 +166,7 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
} else { } else {
dataLength = int(rect.Width * rect.Height) dataLength = int(rect.Width * rect.Height)
} }
_, err = readTightData(conn, dataLength) _, err = conn.ReadTightData(dataLength)
if err != nil { if err != nil {
fmt.Printf("error in handling tight encoding, Reading Palette: %v\n", err) fmt.Printf("error in handling tight encoding, Reading Palette: %v\n", err)
return return
@ -173,10 +175,10 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
fmt.Printf("----GRADIENT_FILTER: bytesPixel=%d\n", bytesPixel) fmt.Printf("----GRADIENT_FILTER: bytesPixel=%d\n", bytesPixel)
//useGradient = true //useGradient = true
fmt.Printf("usegrad: %d\n", filterid) fmt.Printf("usegrad: %d\n", filterid)
readTightData(conn, lengthCurrentbpp) conn.ReadTightData(lengthCurrentbpp)
case TightFilterCopy: //BASIC_FILTER case TightFilterCopy: //BASIC_FILTER
fmt.Printf("----BASIC_FILTER: bytesPixel=%d\n", bytesPixel) fmt.Printf("----BASIC_FILTER: bytesPixel=%d\n", bytesPixel)
readTightData(conn, lengthCurrentbpp) conn.ReadTightData(lengthCurrentbpp)
default: default:
fmt.Printf("Bad tight filter id: %d\n", filterid) fmt.Printf("Bad tight filter id: %d\n", filterid)
return return
@ -330,17 +332,3 @@ func handleTightFilters(subencoding uint8, conn *ClientConn, rect *Rectangle, re
return return
} }
func readTightData(conn *ClientConn, dataSize int) ([]byte, error) {
if int(dataSize) < TightMinToCompress {
return conn.readBytes(int(dataSize))
}
zlibDataLen, err := conn.readCompactLen()
fmt.Printf("compactlen=%d\n", zlibDataLen)
if err != nil {
return nil, err
}
//byte[] zlibData = new byte[zlibDataLen];
//rfb.readFully(zlibData);
return conn.readBytes(zlibDataLen)
}

24
encodings/enc-zlib.go Normal file
View File

@ -0,0 +1,24 @@
package encodings
import "io"
import "vncproxy/common"
type ZLibEncoding struct {
//Colors []Color
}
func (z *ZLibEncoding) Type() int32 {
return 6
}
func (z *ZLibEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
len, _ := conn.ReadUint32()
_, err := conn.ReadBytes(int(len))
if err != nil {
return nil, err
}
return z, nil
}

24
encodings/enc-zrle.go Normal file
View File

@ -0,0 +1,24 @@
package encodings
import "io"
import "vncproxy/common"
type ZRLEEncoding struct {
//Colors []Color
}
func (z *ZRLEEncoding) Type() int32 {
return 16
}
func (z *ZRLEEncoding) Read(pixelFmt *common.PixelFormat, rect *common.Rectangle, r io.Reader) (common.Encoding, error) {
conn := common.RfbReadHelper{r}
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
len, _ := conn.ReadUint32()
_, err := conn.ReadBytes(int(len))
if err != nil {
return nil, err
}
return z, nil
}

19
main.go
View File

@ -5,11 +5,13 @@ import (
"net" "net"
"os" "os"
"time" "time"
"vncproxy/common"
"vncproxy/encodings"
"vncproxy/vnc" "vncproxy/vnc"
) )
func main() { func main() {
fmt.Println("") //fmt.Println("")
//nc, err := net.Dial("tcp", "192.168.1.101:5903") //nc, err := net.Dial("tcp", "192.168.1.101:5903")
nc, err := net.Dial("tcp", "localhost:5903") nc, err := net.Dial("tcp", "localhost:5903")
@ -29,17 +31,18 @@ func main() {
// fmt.Printf("error requesting fb update: %s\n", err) // fmt.Printf("error requesting fb update: %s\n", err)
// } // }
tight := vnc.TightEncoding{} tight := encodings.TightEncoding{}
//rre := vnc.RREEncoding{} //rre := encodings.RREEncoding{}
//zlib := vnc.ZLibEncoding{} //zlib := encodings.ZLibEncoding{}
//zrle := vnc.ZRLEEncoding{} //zrle := encodings.ZRLEEncoding{}
cpyRect := vnc.CopyRectEncoding{} cpyRect := encodings.CopyRectEncoding{}
//hextile := vnc.HextileEncoding{} //coRRE := encodings.CoRREEncoding{}
//hextile := encodings.HextileEncoding{}
file, _ := os.OpenFile("stam.bin", os.O_CREATE|os.O_RDWR, 0755) file, _ := os.OpenFile("stam.bin", os.O_CREATE|os.O_RDWR, 0755)
defer file.Close() defer file.Close()
tight.SetOutput(file) tight.SetOutput(file)
clientConn.SetEncodings([]vnc.Encoding{&cpyRect, &tight}) clientConn.SetEncodings([]common.Encoding{&cpyRect, &tight})
go func() { go func() {
for { for {

View File

@ -7,6 +7,7 @@ import (
"io" "io"
"net" "net"
"unicode" "unicode"
"vncproxy/common"
) )
// A ServerMessage implements a message sent from the server to the client. // A ServerMessage implements a message sent from the server to the client.
@ -33,8 +34,6 @@ type ClientAuth interface {
type ClientConn struct { type ClientConn struct {
conn net.Conn conn net.Conn
output io.Writer
passThrough bool
//c net.Conn //c net.Conn
config *ClientConfig config *ClientConfig
@ -46,7 +45,7 @@ type ClientConn struct {
// Encodings supported by the client. This should not be modified // Encodings supported by the client. This should not be modified
// directly. Instead, SetEncodings should be used. // directly. Instead, SetEncodings should be used.
Encs []Encoding Encs []common.Encoding
// Width of the frame buffer in pixels, sent from the server. // Width of the frame buffer in pixels, sent from the server.
FrameBufferWidth uint16 FrameBufferWidth uint16
@ -60,7 +59,7 @@ type ClientConn struct {
// The pixel format associated with the connection. This shouldn't // The pixel format associated with the connection. This shouldn't
// be modified. If you wish to set a new pixel format, use the // be modified. If you wish to set a new pixel format, use the
// SetPixelFormat method. // SetPixelFormat method.
PixelFormat PixelFormat PixelFormat common.PixelFormat
} }
// A ClientConfig structure is used to configure a ClientConn. After // A ClientConfig structure is used to configure a ClientConn. After
@ -246,7 +245,7 @@ func (c *ClientConn) PointerEvent(mask ButtonMask, x, y uint16) error {
// given should not be modified. // given should not be modified.
// //
// See RFC 6143 Section 7.5.2 // See RFC 6143 Section 7.5.2
func (c *ClientConn) SetEncodings(encs []Encoding) error { func (c *ClientConn) SetEncodings(encs []common.Encoding) error {
data := make([]interface{}, 3+len(encs)) data := make([]interface{}, 3+len(encs))
data[0] = uint8(2) data[0] = uint8(2)
data[1] = uint8(0) data[1] = uint8(0)
@ -277,7 +276,7 @@ func (c *ClientConn) SetEncodings(encs []Encoding) error {
// in FramebufferUpdate messages from the server. // in FramebufferUpdate messages from the server.
// //
// See RFC 6143 Section 7.5.1 // See RFC 6143 Section 7.5.1
func (c *ClientConn) SetPixelFormat(format *PixelFormat) error { func (c *ClientConn) SetPixelFormat(format *common.PixelFormat) error {
var keyEvent [20]byte var keyEvent [20]byte
keyEvent[0] = 0 keyEvent[0] = 0

View File

@ -1,75 +0,0 @@
// Package vnc implements a VNC client.
//
// References:
// [PROTOCOL]: http://tools.ietf.org/html/rfc6143
package vnc
import (
"encoding/binary"
"io"
)
// type DataSource struct {
// conn io.Reader
// output io.Writer
// passThrough bool
// PixelFormat PixelFormat
// }Color
func (d *ClientConn) readBytes(count int) ([]byte, error) {
buff := make([]byte, count)
_, err := io.ReadFull(d.conn, buff)
if err != nil {
//if err := binary.Read(d.conn, binary.BigEndian, &buff); err != nil {
return nil, err
}
return buff, nil
}
func (d *ClientConn) readUint8() (uint8, error) {
var myUint uint8
if err := binary.Read(d.conn, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *ClientConn) readUint16() (uint16, error) {
var myUint uint16
if err := binary.Read(d.conn, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *ClientConn) readUint32() (uint32, error) {
var myUint uint32
if err := binary.Read(d.conn, binary.BigEndian, &myUint); err != nil {
return 0, err
}
//fmt.Printf("myUint=%d", myUint)
return myUint, nil
}
func (d *ClientConn) readCompactLen() (int, error) {
var err error
part, err := d.readUint8()
//byteCount := 1
len := uint32(part & 0x7F)
if (part & 0x80) != 0 {
part, err = d.readUint8()
//byteCount++
len |= uint32(part&0x7F) << 7
if (part & 0x80) != 0 {
part, err = d.readUint8()
//byteCount++
len |= uint32(part&0xFF) << 14
}
}
// for i := 0; i < byteCount; i++{
// rec.writeByte(portion[i]);
// }
return int(len), err
}

View File

@ -1,69 +0,0 @@
package vnc
import "io"
type RREEncoding struct {
Colors []Color
}
func (z *RREEncoding) Type() int32 {
return 2
}
func (z *RREEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
bytesPerPixel := int(conn.PixelFormat.BPP / 8)
numOfSubrectangles, _ := conn.readUint32()
//read whole rect background color
conn.readBytes(bytesPerPixel)
//read all individual rects (color=BPP + x=16b + y=16b + w=16b + h=16b)
_, err := conn.readBytes(int(numOfSubrectangles) * (bytesPerPixel + 8))
if err != nil {
return nil, err
}
return z, nil
}
type CoRREEncoding struct {
Colors []Color
}
func (z *CoRREEncoding) Type() int32 {
return 4
}
func (z *CoRREEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
bytesPerPixel := int(conn.PixelFormat.BPP / 8)
numOfSubrectangles, _ := conn.readUint32()
//read whole rect background color
conn.readBytes(bytesPerPixel)
//read all individual rects (color=BPP + x=16b + y=16b + w=16b + h=16b)
_, err := conn.readBytes(int(numOfSubrectangles) * (bytesPerPixel + 4))
if err != nil {
return nil, err
}
return z, nil
//int nSubrects = rfb.readU32();
//byte[] bg_buf = new byte[bytesPerPixel];
//rfb.readFully(bytesPerPixel);
//Color pixel;
// if (bytesPixel == 1) {
// pixel = colors[bg_buf[0] & 0xFF];
// } else {
// pixel = new Color(bg_buf[2] & 0xFF, bg_buf[1] & 0xFF, bg_buf[0] & 0xFF);
// }
// memGraphics.setColor(pixel);
// memGraphics.fillRect(x, y, w, h);
// byte[] buf = new byte[nSubrects * (bytesPixel + 4)];
// rfb.readFully(buf);
}

View File

@ -1,22 +0,0 @@
package vnc
import "io"
type ZLibEncoding struct {
Colors []Color
}
func (z *ZLibEncoding) Type() int32 {
return 6
}
func (z *ZLibEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
len, _ := conn.readUint32()
_, err := conn.readBytes(int(len))
if err != nil {
return nil, err
}
return z, nil
}

View File

@ -1,22 +0,0 @@
package vnc
import "io"
type ZRLEEncoding struct {
Colors []Color
}
func (z *ZRLEEncoding) Type() int32 {
return 16
}
func (z *ZRLEEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
len, _ := conn.readUint32()
_, err := conn.readBytes(int(len))
if err != nil {
return nil, err
}
return z, nil
}

View File

@ -1,45 +0,0 @@
package vnc
import "io"
// An Encoding implements a method for encoding pixel data that is
// sent by the server to the client.
type Encoding interface {
// The number that uniquely identifies this encoding type.
Type() int32
// Read reads the contents of the encoded pixel data from the reader.
// This should return a new Encoding implementation that contains
// the proper data.
Read(*ClientConn, *Rectangle, io.Reader) (Encoding, error)
}
const (
EncodingRaw = 0
EncodingCopyRect = 1
EncodingRRE = 2
EncodingCoRRE = 4
EncodingHextile = 5
EncodingZlib = 6
EncodingTight = 7
EncodingZRLE = 16
)
type CopyRectEncoding struct {
Colors []Color
copyRectSrcX uint16
copyRectSrcY uint16
}
func (z *CopyRectEncoding) Type() int32 {
return 1
}
func (z *CopyRectEncoding) Read(conn *ClientConn, rect *Rectangle, r io.Reader) (Encoding, error) {
//conn := &DataSource{conn: conn.c, PixelFormat: conn.PixelFormat}
//bytesPerPixel := c.PixelFormat.BPP / 8
z.copyRectSrcX, _ = conn.readUint16()
z.copyRectSrcY, _ = conn.readUint16()
return z, nil
}
//////////

View File

@ -4,9 +4,10 @@ import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"io" "io"
"vncproxy/common"
) )
func readPixelFormat(r io.Reader, result *PixelFormat) error { func readPixelFormat(r io.Reader, result *common.PixelFormat) error {
var rawPixelFormat [16]byte var rawPixelFormat [16]byte
if _, err := io.ReadFull(r, rawPixelFormat[:]); err != nil { if _, err := io.ReadFull(r, rawPixelFormat[:]); err != nil {
return err return err
@ -67,7 +68,7 @@ func readPixelFormat(r io.Reader, result *PixelFormat) error {
return nil return nil
} }
func writePixelFormat(format *PixelFormat) ([]byte, error) { func writePixelFormat(format *common.PixelFormat) ([]byte, error) {
var buf bytes.Buffer var buf bytes.Buffer
// Byte 1 // Byte 1

View File

@ -2,15 +2,16 @@ package vnc
import ( import (
"os" "os"
"vncproxy/common"
) )
type Recorder struct { type Recorder struct {
RBSFileName string RBSFileName string
fileHandle *os.File fileHandle *os.File
logger Logger logger common.Logger
} }
func NewRecorder(saveFilePath string, logger Logger) *Recorder { func NewRecorder(saveFilePath string, logger common.Logger) *Recorder {
rec := Recorder{RBSFileName: saveFilePath} rec := Recorder{RBSFileName: saveFilePath}
var err error var err error
rec.fileHandle, err = os.OpenFile(saveFilePath, os.O_RDWR|os.O_CREATE, 0755) rec.fileHandle, err = os.OpenFile(saveFilePath, os.O_RDWR|os.O_CREATE, 0755)

View File

@ -5,18 +5,14 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"vncproxy/common"
"vncproxy/encodings"
) )
// FramebufferUpdateMessage consists of a sequence of rectangles of // FramebufferUpdateMessage consists of a sequence of rectangles of
// pixel data that the client should put into its framebuffer. // pixel data that the client should put into its framebuffer.
type FramebufferUpdateMessage struct { type FramebufferUpdateMessage struct {
Rectangles []Rectangle Rectangles []common.Rectangle
}
func (r *Rectangle) String() string {
return fmt.Sprintf("(%d,%d) (width: %d, height: %d), Enc= %d", r.X, r.Y, r.Width, r.Height, r.Enc.Type())
} }
func (m *FramebufferUpdateMessage) String() string { func (m *FramebufferUpdateMessage) String() string {
@ -44,17 +40,17 @@ func (*FramebufferUpdateMessage) Read(c *ClientConn, r io.Reader) (ServerMessage
} }
// Build the map of encodings supported // Build the map of encodings supported
encMap := make(map[int32]Encoding) encMap := make(map[int32]common.Encoding)
for _, enc := range c.Encs { for _, enc := range c.Encs {
encMap[enc.Type()] = enc encMap[enc.Type()] = enc
} }
// We must always support the raw encoding // We must always support the raw encoding
rawEnc := new(RawEncoding) rawEnc := new(encodings.RawEncoding)
encMap[rawEnc.Type()] = rawEnc encMap[rawEnc.Type()] = rawEnc
fmt.Printf("numrects= %d\n", numRects) fmt.Printf("numrects= %d\n", numRects)
rects := make([]Rectangle, numRects) rects := make([]common.Rectangle, numRects)
for i := uint16(0); i < numRects; i++ { for i := uint16(0); i < numRects; i++ {
fmt.Printf("###############rect################: %d\n", i) fmt.Printf("###############rect################: %d\n", i)
var encodingType int32 var encodingType int32
@ -84,7 +80,7 @@ func (*FramebufferUpdateMessage) Read(c *ClientConn, r io.Reader) (ServerMessage
} }
var err error var err error
rect.Enc, err = enc.Read(c, rect, r) rect.Enc, err = enc.Read(&c.PixelFormat, rect, r)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -184,7 +180,7 @@ func (*ServerCutTextMessage) Type() uint8 {
return 3 return 3
} }
func (*ServerCutTextMessage) Read(c *ClientConn, r io.Reader) (ServerMessage, error) { func (*ServerCutTextMessage) Read(conn *ClientConn, r io.Reader) (ServerMessage, error) {
// Read off the padding // Read off the padding
var padding [1]byte var padding [1]byte
if _, err := io.ReadFull(r, padding[:]); err != nil { if _, err := io.ReadFull(r, padding[:]); err != nil {