Skip to content
This repository
Browse code

Initial import of Java XenAPI console viewer from http://community.ci…

…trix.com/cdn/xs/sdks (licensed GPL + linking exception)
  • Loading branch information...
commit b79ae86e8f6e7d9e69faac6cf67dc863c01847e9 1 parent 4862758
authored October 09, 2009

Showing 26 changed files with 4,167 additions and 4 deletions. Show diff stats Hide diff stats

  1. 20  OMakefile
  2. 26  java/Console.html
  3. 339  java/GPL-2
  4. 35  java/LICENSE
  5. 12  java/OMakefile
  6. 30  java/build.xml
  7. 43  java/com/citrix/xenserver/console/ConnectionListener.java
  8. 37  java/com/citrix/xenserver/console/ConsoleListener.java
  9. 231  java/com/citrix/xenserver/console/Initialize.java
  10. 117  java/com/citrix/xenserver/console/KeyMap.java
  11. 170  java/com/citrix/xenserver/console/KeyMap.properties
  12. 108  java/com/citrix/xenserver/console/Main.java
  13. 221  java/com/citrix/xenserver/console/RawHTTP.java
  14. 97  java/com/citrix/xenserver/console/SSLHelper.java
  15. 826  java/com/citrix/xenserver/console/VNCCanvas.java
  16. 66  java/com/citrix/xenserver/console/VNCClient.java
  17. 325  java/com/citrix/xenserver/console/VNCControls.java
  18. 113  java/com/citrix/xenserver/console/VNCFullscreen.java
  19. 48  java/com/citrix/xenserver/console/VNCPixelFormat.java
  20. 1,302  java/com/citrix/xenserver/console/VNCStream.java
  21. BIN  java/com/citrix/xenserver/console/attach_24.png
  22. BIN  java/com/citrix/xenserver/console/button-graphic-console.png
  23. BIN  java/com/citrix/xenserver/console/button-options.png
  24. BIN  java/com/citrix/xenserver/console/cad_24.png
  25. BIN  java/com/citrix/xenserver/console/detach_24.png
  26. 5  ocaml/idl/js_backend/OMakefile
20  OMakefile
@@ -60,7 +60,7 @@ export CLEAN_OBJS
60 60
 clean:
61 61
 	rm -rf doc/
62 62
 
63  
-.SUBDIRS: ocaml scripts
  63
+.SUBDIRS: ocaml scripts java javascript
64 64
 
65 65
 
66 66
 if $(not $(defined-env COMPILE_OCAML))
@@ -69,6 +69,9 @@ if $(not $(defined-env COMPILE_OCAML))
69 69
 if $(not $(defined-env COMPILE_JS))
70 70
   COMPILE_JS = yes
71 71
   export
  72
+if $(not $(defined-env COMPILE_JAVA))
  73
+  COMPILE_JAVA = yes
  74
+  export
72 75
 
73 76
 # inherits COMPILE_XENSTUFF from the Makefile (NB don't set it here or else
74 77
 # you can't build the fakeserver etc on a machine without Xen, e.g. an Apple)
@@ -87,10 +90,19 @@ JS_PHASE1=
87 90
 JS_PHASE2=js_binding
88 91
 JS_PHASE3=
89 92
 
  93
+# Java ##############################################################################
  94
+JAVA_PHASE1= XenServerConsole.jar
  95
+JAVA_PHASE2=
  96
+JAVA_PHASE3=
  97
+
90 98
 JS_PHASE1_TARGETS = $(if $(equal $(COMPILE_JS), yes), $(JS_PHASE1), none)
91 99
 JS_PHASE2_TARGETS = $(if $(equal $(COMPILE_JS), yes), $(JS_PHASE2), none)
92 100
 JS_PHASE3_TARGETS = $(if $(equal $(COMPILE_JS), yes), $(JS_PHASE3), none)
93 101
 
  102
+JAVA_PHASE1_TARGETS = $(if $(equal $(COMPILE_JAVA), yes), $(JAVA_PHASE1), none)
  103
+JAVA_PHASE2_TARGETS = $(if $(equal $(COMPILE_JAVA), yes), $(JAVA_PHASE2), none)
  104
+JAVA_PHASE3_TARGETS = $(if $(equal $(COMPILE_JAVA), yes), $(JAVA_PHASE3), none)
  105
+
94 106
 # Phase 3 targets divided into two depending on whether we're building the Xen stuff or not:
95 107
 OCAML_PHASE3_XEN = \
96 108
 	ocaml/xapi/xapi \
@@ -162,14 +174,14 @@ OCAML_PHASE3_TARGETS = $(if $(equal $(COMPILE_OCAML), yes), $(OCAML_PHASE3), non
162 174
 
163 175
 # phase1: build stdlib2
164 176
 .PHONY: phase1
165  
-phase1: $(OCAML_PHASE1_TARGETS) $(JS_PHASE1_TARGETS)
  177
+phase1: $(OCAML_PHASE1_TARGETS) $(JS_PHASE1_TARGETS) $(JAVA_PHASE1_TARGETS)
166 178
 	mkdir -p $(DIST) $(DIST)/bin
167 179
 
168 180
 # phase2: build compilers and make autogenerated files
169 181
 .PHONY: phase2
170  
-phase2: $(OCAML_PHASE2_TARGETS) $(JS_PHASE2_TARGETS)
  182
+phase2: $(OCAML_PHASE2_TARGETS) $(JS_PHASE2_TARGETS) $(JAVA_PHASE2_TARGETS)
171 183
 
172 184
 # phase3: use autogenerated files to make apps
173 185
 .PHONY: phase3
174  
-phase3: $(OCAML_PHASE3_TARGETS) $(JS_PHASE3_TARGETS)
  186
+phase3: $(OCAML_PHASE3_TARGETS) $(JS_PHASE3_TARGETS) $(JAVA_PHASE3_TARGETS)
175 187
 
26  java/Console.html
... ...
@@ -0,0 +1,26 @@
  1
+/*
  2
+ * Copyright (c) 2009 Citrix Systems, Inc.
  3
+ *
  4
+ * Permission to use, copy, modify, and distribute this file for any
  5
+ * purpose with or without fee is hereby granted.
  6
+ */
  7
+
  8
+<html>
  9
+<body>
  10
+<center>
  11
+  <table>
  12
+    <tr>
  13
+      <td>
  14
+        <applet code="com/citrix/xenserver/console/Initialize.class" 
  15
+            archive="XenServerConsole.jar"
  16
+            width="800" height="600">
  17
+          <PARAM NAME=SESSION VALUE="OpaqueRef:your_session_here">
  18
+          <PARAM NAME=URL VALUE="https://your.host.here/console.url.here">
  19
+          <PARAM NAME=USEURL VALUE="true">
  20
+        </applet>
  21
+      </td>
  22
+    </tr>
  23
+  </table>
  24
+</center>
  25
+</body>
  26
+</html>
339  java/GPL-2
... ...
@@ -0,0 +1,339 @@
  1
+		    GNU GENERAL PUBLIC LICENSE
  2
+		       Version 2, June 1991
  3
+
  4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
  5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  6
+ Everyone is permitted to copy and distribute verbatim copies
  7
+ of this license document, but changing it is not allowed.
  8
+
  9
+			    Preamble
  10
+
  11
+  The licenses for most software are designed to take away your
  12
+freedom to share and change it.  By contrast, the GNU General Public
  13
+License is intended to guarantee your freedom to share and change free
  14
+software--to make sure the software is free for all its users.  This
  15
+General Public License applies to most of the Free Software
  16
+Foundation's software and to any other program whose authors commit to
  17
+using it.  (Some other Free Software Foundation software is covered by
  18
+the GNU Lesser General Public License instead.)  You can apply it to
  19
+your programs, too.
  20
+
  21
+  When we speak of free software, we are referring to freedom, not
  22
+price.  Our General Public Licenses are designed to make sure that you
  23
+have the freedom to distribute copies of free software (and charge for
  24
+this service if you wish), that you receive source code or can get it
  25
+if you want it, that you can change the software or use pieces of it
  26
+in new free programs; and that you know you can do these things.
  27
+
  28
+  To protect your rights, we need to make restrictions that forbid
  29
+anyone to deny you these rights or to ask you to surrender the rights.
  30
+These restrictions translate to certain responsibilities for you if you
  31
+distribute copies of the software, or if you modify it.
  32
+
  33
+  For example, if you distribute copies of such a program, whether
  34
+gratis or for a fee, you must give the recipients all the rights that
  35
+you have.  You must make sure that they, too, receive or can get the
  36
+source code.  And you must show them these terms so they know their
  37
+rights.
  38
+
  39
+  We protect your rights with two steps: (1) copyright the software, and
  40
+(2) offer you this license which gives you legal permission to copy,
  41
+distribute and/or modify the software.
  42
+
  43
+  Also, for each author's protection and ours, we want to make certain
  44
+that everyone understands that there is no warranty for this free
  45
+software.  If the software is modified by someone else and passed on, we
  46
+want its recipients to know that what they have is not the original, so
  47
+that any problems introduced by others will not reflect on the original
  48
+authors' reputations.
  49
+
  50
+  Finally, any free program is threatened constantly by software
  51
+patents.  We wish to avoid the danger that redistributors of a free
  52
+program will individually obtain patent licenses, in effect making the
  53
+program proprietary.  To prevent this, we have made it clear that any
  54
+patent must be licensed for everyone's free use or not licensed at all.
  55
+
  56
+  The precise terms and conditions for copying, distribution and
  57
+modification follow.
  58
+
  59
+		    GNU GENERAL PUBLIC LICENSE
  60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  61
+
  62
+  0. This License applies to any program or other work which contains
  63
+a notice placed by the copyright holder saying it may be distributed
  64
+under the terms of this General Public License.  The "Program", below,
  65
+refers to any such program or work, and a "work based on the Program"
  66
+means either the Program or any derivative work under copyright law:
  67
+that is to say, a work containing the Program or a portion of it,
  68
+either verbatim or with modifications and/or translated into another
  69
+language.  (Hereinafter, translation is included without limitation in
  70
+the term "modification".)  Each licensee is addressed as "you".
  71
+
  72
+Activities other than copying, distribution and modification are not
  73
+covered by this License; they are outside its scope.  The act of
  74
+running the Program is not restricted, and the output from the Program
  75
+is covered only if its contents constitute a work based on the
  76
+Program (independent of having been made by running the Program).
  77
+Whether that is true depends on what the Program does.
  78
+
  79
+  1. You may copy and distribute verbatim copies of the Program's
  80
+source code as you receive it, in any medium, provided that you
  81
+conspicuously and appropriately publish on each copy an appropriate
  82
+copyright notice and disclaimer of warranty; keep intact all the
  83
+notices that refer to this License and to the absence of any warranty;
  84
+and give any other recipients of the Program a copy of this License
  85
+along with the Program.
  86
+
  87
+You may charge a fee for the physical act of transferring a copy, and
  88
+you may at your option offer warranty protection in exchange for a fee.
  89
+
  90
+  2. You may modify your copy or copies of the Program or any portion
  91
+of it, thus forming a work based on the Program, and copy and
  92
+distribute such modifications or work under the terms of Section 1
  93
+above, provided that you also meet all of these conditions:
  94
+
  95
+    a) You must cause the modified files to carry prominent notices
  96
+    stating that you changed the files and the date of any change.
  97
+
  98
+    b) You must cause any work that you distribute or publish, that in
  99
+    whole or in part contains or is derived from the Program or any
  100
+    part thereof, to be licensed as a whole at no charge to all third
  101
+    parties under the terms of this License.
  102
+
  103
+    c) If the modified program normally reads commands interactively
  104
+    when run, you must cause it, when started running for such
  105
+    interactive use in the most ordinary way, to print or display an
  106
+    announcement including an appropriate copyright notice and a
  107
+    notice that there is no warranty (or else, saying that you provide
  108
+    a warranty) and that users may redistribute the program under
  109
+    these conditions, and telling the user how to view a copy of this
  110
+    License.  (Exception: if the Program itself is interactive but
  111
+    does not normally print such an announcement, your work based on
  112
+    the Program is not required to print an announcement.)
  113
+
  114
+These requirements apply to the modified work as a whole.  If
  115
+identifiable sections of that work are not derived from the Program,
  116
+and can be reasonably considered independent and separate works in
  117
+themselves, then this License, and its terms, do not apply to those
  118
+sections when you distribute them as separate works.  But when you
  119
+distribute the same sections as part of a whole which is a work based
  120
+on the Program, the distribution of the whole must be on the terms of
  121
+this License, whose permissions for other licensees extend to the
  122
+entire whole, and thus to each and every part regardless of who wrote it.
  123
+
  124
+Thus, it is not the intent of this section to claim rights or contest
  125
+your rights to work written entirely by you; rather, the intent is to
  126
+exercise the right to control the distribution of derivative or
  127
+collective works based on the Program.
  128
+
  129
+In addition, mere aggregation of another work not based on the Program
  130
+with the Program (or with a work based on the Program) on a volume of
  131
+a storage or distribution medium does not bring the other work under
  132
+the scope of this License.
  133
+
  134
+  3. You may copy and distribute the Program (or a work based on it,
  135
+under Section 2) in object code or executable form under the terms of
  136
+Sections 1 and 2 above provided that you also do one of the following:
  137
+
  138
+    a) Accompany it with the complete corresponding machine-readable
  139
+    source code, which must be distributed under the terms of Sections
  140
+    1 and 2 above on a medium customarily used for software interchange; or,
  141
+
  142
+    b) Accompany it with a written offer, valid for at least three
  143
+    years, to give any third party, for a charge no more than your
  144
+    cost of physically performing source distribution, a complete
  145
+    machine-readable copy of the corresponding source code, to be
  146
+    distributed under the terms of Sections 1 and 2 above on a medium
  147
+    customarily used for software interchange; or,
  148
+
  149
+    c) Accompany it with the information you received as to the offer
  150
+    to distribute corresponding source code.  (This alternative is
  151
+    allowed only for noncommercial distribution and only if you
  152
+    received the program in object code or executable form with such
  153
+    an offer, in accord with Subsection b above.)
  154
+
  155
+The source code for a work means the preferred form of the work for
  156
+making modifications to it.  For an executable work, complete source
  157
+code means all the source code for all modules it contains, plus any
  158
+associated interface definition files, plus the scripts used to
  159
+control compilation and installation of the executable.  However, as a
  160
+special exception, the source code distributed need not include
  161
+anything that is normally distributed (in either source or binary
  162
+form) with the major components (compiler, kernel, and so on) of the
  163
+operating system on which the executable runs, unless that component
  164
+itself accompanies the executable.
  165
+
  166
+If distribution of executable or object code is made by offering
  167
+access to copy from a designated place, then offering equivalent
  168
+access to copy the source code from the same place counts as
  169
+distribution of the source code, even though third parties are not
  170
+compelled to copy the source along with the object code.
  171
+
  172
+  4. You may not copy, modify, sublicense, or distribute the Program
  173
+except as expressly provided under this License.  Any attempt
  174
+otherwise to copy, modify, sublicense or distribute the Program is
  175
+void, and will automatically terminate your rights under this License.
  176
+However, parties who have received copies, or rights, from you under
  177
+this License will not have their licenses terminated so long as such
  178
+parties remain in full compliance.
  179
+
  180
+  5. You are not required to accept this License, since you have not
  181
+signed it.  However, nothing else grants you permission to modify or
  182
+distribute the Program or its derivative works.  These actions are
  183
+prohibited by law if you do not accept this License.  Therefore, by
  184
+modifying or distributing the Program (or any work based on the
  185
+Program), you indicate your acceptance of this License to do so, and
  186
+all its terms and conditions for copying, distributing or modifying
  187
+the Program or works based on it.
  188
+
  189
+  6. Each time you redistribute the Program (or any work based on the
  190
+Program), the recipient automatically receives a license from the
  191
+original licensor to copy, distribute or modify the Program subject to
  192
+these terms and conditions.  You may not impose any further
  193
+restrictions on the recipients' exercise of the rights granted herein.
  194
+You are not responsible for enforcing compliance by third parties to
  195
+this License.
  196
+
  197
+  7. If, as a consequence of a court judgment or allegation of patent
  198
+infringement or for any other reason (not limited to patent issues),
  199
+conditions are imposed on you (whether by court order, agreement or
  200
+otherwise) that contradict the conditions of this License, they do not
  201
+excuse you from the conditions of this License.  If you cannot
  202
+distribute so as to satisfy simultaneously your obligations under this
  203
+License and any other pertinent obligations, then as a consequence you
  204
+may not distribute the Program at all.  For example, if a patent
  205
+license would not permit royalty-free redistribution of the Program by
  206
+all those who receive copies directly or indirectly through you, then
  207
+the only way you could satisfy both it and this License would be to
  208
+refrain entirely from distribution of the Program.
  209
+
  210
+If any portion of this section is held invalid or unenforceable under
  211
+any particular circumstance, the balance of the section is intended to
  212
+apply and the section as a whole is intended to apply in other
  213
+circumstances.
  214
+
  215
+It is not the purpose of this section to induce you to infringe any
  216
+patents or other property right claims or to contest validity of any
  217
+such claims; this section has the sole purpose of protecting the
  218
+integrity of the free software distribution system, which is
  219
+implemented by public license practices.  Many people have made
  220
+generous contributions to the wide range of software distributed
  221
+through that system in reliance on consistent application of that
  222
+system; it is up to the author/donor to decide if he or she is willing
  223
+to distribute software through any other system and a licensee cannot
  224
+impose that choice.
  225
+
  226
+This section is intended to make thoroughly clear what is believed to
  227
+be a consequence of the rest of this License.
  228
+
  229
+  8. If the distribution and/or use of the Program is restricted in
  230
+certain countries either by patents or by copyrighted interfaces, the
  231
+original copyright holder who places the Program under this License
  232
+may add an explicit geographical distribution limitation excluding
  233
+those countries, so that distribution is permitted only in or among
  234
+countries not thus excluded.  In such case, this License incorporates
  235
+the limitation as if written in the body of this License.
  236
+
  237
+  9. The Free Software Foundation may publish revised and/or new versions
  238
+of the General Public License from time to time.  Such new versions will
  239
+be similar in spirit to the present version, but may differ in detail to
  240
+address new problems or concerns.
  241
+
  242
+Each version is given a distinguishing version number.  If the Program
  243
+specifies a version number of this License which applies to it and "any
  244
+later version", you have the option of following the terms and conditions
  245
+either of that version or of any later version published by the Free
  246
+Software Foundation.  If the Program does not specify a version number of
  247
+this License, you may choose any version ever published by the Free Software
  248
+Foundation.
  249
+
  250
+  10. If you wish to incorporate parts of the Program into other free
  251
+programs whose distribution conditions are different, write to the author
  252
+to ask for permission.  For software which is copyrighted by the Free
  253
+Software Foundation, write to the Free Software Foundation; we sometimes
  254
+make exceptions for this.  Our decision will be guided by the two goals
  255
+of preserving the free status of all derivatives of our free software and
  256
+of promoting the sharing and reuse of software generally.
  257
+
  258
+			    NO WARRANTY
  259
+
  260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  268
+REPAIR OR CORRECTION.
  269
+
  270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  278
+POSSIBILITY OF SUCH DAMAGES.
  279
+
  280
+		     END OF TERMS AND CONDITIONS
  281
+
  282
+	    How to Apply These Terms to Your New Programs
  283
+
  284
+  If you develop a new program, and you want it to be of the greatest
  285
+possible use to the public, the best way to achieve this is to make it
  286
+free software which everyone can redistribute and change under these terms.
  287
+
  288
+  To do so, attach the following notices to the program.  It is safest
  289
+to attach them to the start of each source file to most effectively
  290
+convey the exclusion of warranty; and each file should have at least
  291
+the "copyright" line and a pointer to where the full notice is found.
  292
+
  293
+    <one line to give the program's name and a brief idea of what it does.>
  294
+    Copyright (C) <year>  <name of author>
  295
+
  296
+    This program is free software; you can redistribute it and/or modify
  297
+    it under the terms of the GNU General Public License as published by
  298
+    the Free Software Foundation; either version 2 of the License, or
  299
+    (at your option) any later version.
  300
+
  301
+    This program is distributed in the hope that it will be useful,
  302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
  303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  304
+    GNU General Public License for more details.
  305
+
  306
+    You should have received a copy of the GNU General Public License along
  307
+    with this program; if not, write to the Free Software Foundation, Inc.,
  308
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  309
+
  310
+Also add information on how to contact you by electronic and paper mail.
  311
+
  312
+If the program is interactive, make it output a short notice like this
  313
+when it starts in an interactive mode:
  314
+
  315
+    Gnomovision version 69, Copyright (C) year name of author
  316
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  317
+    This is free software, and you are welcome to redistribute it
  318
+    under certain conditions; type `show c' for details.
  319
+
  320
+The hypothetical commands `show w' and `show c' should show the appropriate
  321
+parts of the General Public License.  Of course, the commands you use may
  322
+be called something other than `show w' and `show c'; they could even be
  323
+mouse-clicks or menu items--whatever suits your program.
  324
+
  325
+You should also get your employer (if you work as a programmer) or your
  326
+school, if any, to sign a "copyright disclaimer" for the program, if
  327
+necessary.  Here is a sample; alter the names:
  328
+
  329
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  330
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
  331
+
  332
+  <signature of Ty Coon>, 1 April 1989
  333
+  Ty Coon, President of Vice
  334
+
  335
+This General Public License does not permit incorporating your program into
  336
+proprietary programs.  If your program is a subroutine library, you may
  337
+consider it more useful to permit linking proprietary applications with the
  338
+library.  If this is what you want to do, use the GNU Lesser General
  339
+Public License instead of this License.
35  java/LICENSE
... ...
@@ -0,0 +1,35 @@
  1
+Copyright (c) 2005-2009 Citrix Systems, Inc.
  2
+
  3
+This library is free software; you can redistribute it and/or modify it under
  4
+the terms of version 2 of the GNU General Public License as published by the
  5
+Free Software Foundation, with the additional linking exception as follows:
  6
+
  7
+  Linking this library statically or dynamically with other modules is
  8
+  making a combined work based on this library. Thus, the terms and
  9
+  conditions of the GNU General Public License cover the whole combination.
  10
+
  11
+  As a special exception, the copyright holders of this library give you
  12
+  permission to link this library with independent modules to produce an
  13
+  executable, regardless of the license terms of these independent modules,
  14
+  and to copy and distribute the resulting executable under terms of your
  15
+  choice, provided that you also meet, for each linked independent module,
  16
+  the terms and conditions of the license of that module. An independent
  17
+  module is a module which is not derived from or based on this library. If
  18
+  you modify this library, you may extend this exception to your version of
  19
+  the library, but you are not obligated to do so. If you do not wish to do
  20
+  so, delete this exception statement from your version.
  21
+
  22
+This program is distributed in the hope that it will be useful, but WITHOUT
  23
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  24
+FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  25
+details.
  26
+
  27
+You should have received a copy of the GNU General Public License along with
  28
+this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
  29
+Street, Fifth Floor, Boston, MA 02110-1301 USA.
  30
+
  31
+
  32
+This library may be accompanied by pedagogical examples.  These do not form
  33
+part of this library, and are licensed for redistribution and modification
  34
+under less restrictive terms.  Such examples are licensed clearly at the top
  35
+of each file.
12  java/OMakefile
... ...
@@ -0,0 +1,12 @@
  1
+.PHONY: XenServerConsole.jar
  2
+XenServerConsole.jar:
  3
+	ant all
  4
+
  5
+.PHONY: clean
  6
+clean:
  7
+	ant clean
  8
+
  9
+.PHONY: install
  10
+install:
  11
+	mkdir -p $(DEBUGDIST)/www
  12
+	$(IDATA) XenServerConsole.jar $(DEBUGDIST)/www
30  java/build.xml
... ...
@@ -0,0 +1,30 @@
  1
+<!--
  2
+ Copyright (c) 2009 Citrix Systems, Inc.
  3
+ 
  4
+ Permission to use, copy, modify, and distribute this software for any
  5
+ purpose with or without fee is hereby granted.
  6
+-->
  7
+<project name="XenServerConsole" default="all">
  8
+    <target name="all">
  9
+        <javac srcdir="." destdir="." source="1.5"
  10
+            includes="**/*.java" />
  11
+        <jar destfile="XenServerConsole.jar" basedir="."
  12
+            includes="**/*.class **/*.properties **/*.png">
  13
+        </jar>
  14
+        <zip destfile="XenServerConsole.zip" basedir="." 
  15
+            includes="XenServerConsole.jar, Console.html"/>
  16
+
  17
+        <zip destfile="XenServerConsole-src.zip" basedir="." 
  18
+            includes="**/*.java **/*.properties **/*.png **/*.html build.xml LICENSE GPL-2"/>
  19
+    </target>
  20
+    
  21
+    <target name="clean">
  22
+        <delete>
  23
+            <fileset dir="." includes="**/*.class"/>
  24
+        </delete>
  25
+        <delete file="./XenServerConsole.jar"/>
  26
+        <delete file="./XenServerConsole.zip"/>
  27
+        <delete file="./XenServerConsole-src.zip"/>
  28
+    </target>
  29
+   
  30
+</project>
43  java/com/citrix/xenserver/console/ConnectionListener.java
... ...
@@ -0,0 +1,43 @@
  1
+/*
  2
+ * Copyright (c) 2005-2009 Citrix Systems, Inc.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it
  5
+ * under the terms of version 2 of the GNU General Public License as published
  6
+ * by the Free Software Foundation, with the additional linking exception as
  7
+ * follows:
  8
+ * 
  9
+ *   Linking this library statically or dynamically with other modules is
  10
+ *   making a combined work based on this library. Thus, the terms and
  11
+ *   conditions of the GNU General Public License cover the whole combination.
  12
+ * 
  13
+ *   As a special exception, the copyright holders of this library give you
  14
+ *   permission to link this library with independent modules to produce an
  15
+ *   executable, regardless of the license terms of these independent modules,
  16
+ *   and to copy and distribute the resulting executable under terms of your
  17
+ *   choice, provided that you also meet, for each linked independent module,
  18
+ *   the terms and conditions of the license of that module. An independent
  19
+ *   module is a module which is not derived from or based on this library. If
  20
+ *   you modify this library, you may extend this exception to your version of
  21
+ *   the library, but you are not obligated to do so. If you do not wish to do
  22
+ *   so, delete this exception statement from your version.
  23
+ * 
  24
+ * This program is distributed in the hope that it will be useful, but WITHOUT
  25
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  26
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  27
+ * more details.
  28
+ * 
  29
+ * You should have received a copy of the GNU General Public License along
  30
+ * with this program; if not, write to the Free Software Foundation, Inc., 51
  31
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  32
+ */
  33
+package com.citrix.xenserver.console;
  34
+
  35
+public interface ConnectionListener {
  36
+    public void ConnectionMade();
  37
+
  38
+    public void ConnectionLost(String reason);
  39
+
  40
+    public void ConnectionClosed();
  41
+
  42
+    public void ConnectionFailed(String reason);
  43
+}
37  java/com/citrix/xenserver/console/ConsoleListener.java
... ...
@@ -0,0 +1,37 @@
  1
+/*
  2
+ * Copyright (c) 2005-2009 Citrix Systems, Inc.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it
  5
+ * under the terms of version 2 of the GNU General Public License as published
  6
+ * by the Free Software Foundation, with the additional linking exception as
  7
+ * follows:
  8
+ * 
  9
+ *   Linking this library statically or dynamically with other modules is
  10
+ *   making a combined work based on this library. Thus, the terms and
  11
+ *   conditions of the GNU General Public License cover the whole combination.
  12
+ * 
  13
+ *   As a special exception, the copyright holders of this library give you
  14
+ *   permission to link this library with independent modules to produce an
  15
+ *   executable, regardless of the license terms of these independent modules,
  16
+ *   and to copy and distribute the resulting executable under terms of your
  17
+ *   choice, provided that you also meet, for each linked independent module,
  18
+ *   the terms and conditions of the license of that module. An independent
  19
+ *   module is a module which is not derived from or based on this library. If
  20
+ *   you modify this library, you may extend this exception to your version of
  21
+ *   the library, but you are not obligated to do so. If you do not wish to do
  22
+ *   so, delete this exception statement from your version.
  23
+ * 
  24
+ * This program is distributed in the hope that it will be useful, but WITHOUT
  25
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  26
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  27
+ * more details.
  28
+ * 
  29
+ * You should have received a copy of the GNU General Public License along
  30
+ * with this program; if not, write to the Free Software Foundation, Inc., 51
  31
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  32
+ */
  33
+package com.citrix.xenserver.console;
  34
+
  35
+public interface ConsoleListener {
  36
+    public void writeline(String line);
  37
+}
231  java/com/citrix/xenserver/console/Initialize.java
... ...
@@ -0,0 +1,231 @@
  1
+/*
  2
+ * Copyright (c) 2005-2009 Citrix Systems, Inc.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it
  5
+ * under the terms of version 2 of the GNU General Public License as published
  6
+ * by the Free Software Foundation, with the additional linking exception as
  7
+ * follows:
  8
+ * 
  9
+ *   Linking this library statically or dynamically with other modules is
  10
+ *   making a combined work based on this library. Thus, the terms and
  11
+ *   conditions of the GNU General Public License cover the whole combination.
  12
+ * 
  13
+ *   As a special exception, the copyright holders of this library give you
  14
+ *   permission to link this library with independent modules to produce an
  15
+ *   executable, regardless of the license terms of these independent modules,
  16
+ *   and to copy and distribute the resulting executable under terms of your
  17
+ *   choice, provided that you also meet, for each linked independent module,
  18
+ *   the terms and conditions of the license of that module. An independent
  19
+ *   module is a module which is not derived from or based on this library. If
  20
+ *   you modify this library, you may extend this exception to your version of
  21
+ *   the library, but you are not obligated to do so. If you do not wish to do
  22
+ *   so, delete this exception statement from your version.
  23
+ * 
  24
+ * This program is distributed in the hope that it will be useful, but WITHOUT
  25
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  26
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  27
+ * more details.
  28
+ * 
  29
+ * You should have received a copy of the GNU General Public License along
  30
+ * with this program; if not, write to the Free Software Foundation, Inc., 51
  31
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  32
+ */
  33
+package com.citrix.xenserver.console;
  34
+
  35
+import javax.swing.BorderFactory;
  36
+import javax.swing.JApplet;
  37
+import javax.swing.JPanel;
  38
+import javax.swing.JScrollPane;
  39
+import javax.swing.JTextArea;
  40
+import javax.swing.SwingUtilities;
  41
+import javax.swing.UIManager;
  42
+
  43
+import java.awt.BorderLayout;
  44
+import java.awt.Color;
  45
+import java.net.URL;
  46
+
  47
+import java.util.logging.Logger;
  48
+import java.util.logging.Level;
  49
+
  50
+public class Initialize extends JApplet implements ConnectionListener,
  51
+        ConsoleListener {
  52
+    private static final Logger logger = Logger.getLogger(Initialize.class.getName());
  53
+
  54
+    static final long serialVersionUID = 0;
  55
+    static public URL path;
  56
+
  57
+    private Main main;
  58
+    private VNCControls controls;
  59
+    private JPanel background = new JPanel(new BorderLayout(), true);
  60
+    private JPanel errorPanel = new JPanel(true);
  61
+    private Thread t;
  62
+    public JTextArea console = new JTextArea();
  63
+    
  64
+    private int retries = 5;
  65
+    private boolean connecting = false;
  66
+
  67
+    private boolean logOnConsole = false;
  68
+    private boolean hideCADButton = false;
  69
+
  70
+    private String[] getArgs() {
  71
+        String[] args;
  72
+        if ("true".equals(getParameter("USEURL"))) {
  73
+            args = new String[3];
  74
+            args[0] = getParameter("URL");
  75
+            args[1] = getParameter("SESSION");
  76
+            args[2] = getParameter("USEURL");
  77
+        } else {
  78
+            args = new String[4];
  79
+            args[0] = getParameter("IPADDRESS");
  80
+            args[1] = getParameter("PASSWORD");
  81
+            args[2] = getParameter("USEURL");
  82
+            args[3] = getParameter("PORT");
  83
+        }
  84
+        return args;
  85
+    }
  86
+
  87
+    public void init() {
  88
+        try {           
  89
+            logOnConsole = Boolean.valueOf(getParameter("CONSOLELOGGING"));
  90
+            hideCADButton = Boolean.valueOf(getParameter("HIDECAD"));
  91
+            path = getDocumentBase();
  92
+            writeline("");
  93
+            writeline("Loading UI...");
  94
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  95
+            writeline("Initializing...");
  96
+            String[] args = getArgs();
  97
+            Color c;
  98
+            if (getParameter("BACKCOLOR") != null) {
  99
+                String s = getParameter("BACKCOLOR");
  100
+                String[] vals = s.split(":");
  101
+                if (vals.length == 3 && vals[0].length() == 2
  102
+                        && vals[1].length() == 2 && vals[2].length() == 2) {
  103
+                    c = new Color(Integer.parseInt(vals[0], 16), Integer
  104
+                            .parseInt(vals[1], 16), Integer.parseInt(vals[2],
  105
+                            16));
  106
+                } else {
  107
+                    c = Color.WHITE;
  108
+                }
  109
+            } else {
  110
+                c = Color.WHITE;
  111
+            }
  112
+            this.setBackground(c);
  113
+            writeline("Starting main...");
  114
+            main = new Main(args, this, this);
  115
+            writeline("Creating controls...");
  116
+            controls = new VNCControls(main, background, c, !hideCADButton);
  117
+            writeline("Adding controls...");
  118
+            background.add(controls);
  119
+            this.add(background);
  120
+
  121
+            errorPanel.setBackground(c);
  122
+            errorPanel.setLayout(new BorderLayout());
  123
+            console.setBackground(Color.white);
  124
+            console.setEditable(false);
  125
+            JScrollPane areaScrollPane = new JScrollPane(console);
  126
+            areaScrollPane
  127
+                    .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  128
+            areaScrollPane.setBorder(BorderFactory.createLineBorder(
  129
+                    Color.BLACK, 1));
  130
+            errorPanel.add(areaScrollPane, BorderLayout.CENTER);
  131
+        } catch (Exception e) {
  132
+            writeline(e.getMessage());
  133
+        }
  134
+
  135
+    }
  136
+
  137
+    public void start() {
  138
+        writeline("Starting...");
  139
+        main.connect();
  140
+    }
  141
+
  142
+    public void stop() {
  143
+        writeline("Stopping...");
  144
+        if (main != null && main.stream_ != null && main.stream_.isConnected()) {
  145
+            main.stream_.disconnect();
  146
+        }
  147
+    }
  148
+
  149
+    public void destroy() {
  150
+        writeline("Destroying...");
  151
+    }
  152
+
  153
+    public void ConnectionClosed() {
  154
+        writeline("Connection closed");
  155
+        if (retries > 0) {
  156
+
  157
+            controls.consolePanel.remove(main.canvas_);
  158
+            controls.consolePanel.setLayout(new BorderLayout());
  159
+            controls.consolePanel.add(errorPanel);
  160
+            controls.invalidate();
  161
+            controls.validate();
  162
+            controls.consolePanel.invalidate();
  163
+            controls.consolePanel.validate();
  164
+
  165
+            t = new Thread(new Runnable() {
  166
+                public void run() {
  167
+
  168
+                    writeline("Reconnecting in 5 seconds...");
  169
+                    try {
  170
+                        Thread.sleep(5000);
  171
+                    } catch (Exception e) {
  172
+                        writeline(e.getMessage());
  173
+                    }
  174
+                    writeline("Retry ".concat(Integer.toString(6 - retries))
  175
+                            .concat(" out of 5"));
  176
+                    main.connect();
  177
+                    retries--;
  178
+                };
  179
+            });
  180
+            t.start();
  181
+        }
  182
+    }
  183
+
  184
+    public void ConnectionLost(String reason) {
  185
+        if (main != null) {
  186
+            if (reason != null) {
  187
+                writeline("Connection lost: ".concat(reason));
  188
+            } else {
  189
+                writeline("Connection lost");
  190
+            }
  191
+            if (!connecting) {
  192
+                connecting = true;
  193
+                ConnectionClosed();
  194
+            }
  195
+        }
  196
+    }
  197
+
  198
+    public void ConnectionMade() {
  199
+        controls.consolePanel.remove(errorPanel);
  200
+        controls.setupConsole();
  201
+        controls.consolePanel.getParent().repaint();
  202
+        controls.consolePanel.invalidate();
  203
+        controls.consolePanel.validate();
  204
+        main.canvas_.requestFocusInWindow();
  205
+        connecting = false;
  206
+        retries = 5;
  207
+    }
  208
+
  209
+    public void ConnectionFailed(String reason) {
  210
+        if (main != null) {
  211
+            writeline("Connection failed: ".concat(reason));
  212
+            // if(!connecting)
  213
+            // {
  214
+            connecting = true;
  215
+            ConnectionClosed();
  216
+            // }
  217
+        }
  218
+    }
  219
+
  220
+    public void writeline(final String line) {
  221
+        SwingUtilities.invokeLater(new Runnable() {
  222
+            public void run() {
  223
+                if (logOnConsole && line != null) {
  224
+                    console.append(line);
  225
+                    console.append("\n");
  226
+                }
  227
+                System.out.println(line);
  228
+            }
  229
+        });
  230
+    }
  231
+}
117  java/com/citrix/xenserver/console/KeyMap.java
... ...
@@ -0,0 +1,117 @@
  1
+/*
  2
+ * Copyright (c) 2005-2009 Citrix Systems, Inc.
  3
+ *
  4
+ * This library is free software; you can redistribute it and/or modify it
  5
+ * under the terms of version 2 of the GNU General Public License as published
  6
+ * by the Free Software Foundation, with the additional linking exception as
  7
+ * follows:
  8
+ * 
  9
+ *   Linking this library statically or dynamically with other modules is
  10
+ *   making a combined work based on this library. Thus, the terms and
  11
+ *   conditions of the GNU General Public License cover the whole combination.
  12
+ * 
  13
+ *   As a special exception, the copyright holders of this library give you
  14
+ *   permission to link this library with independent modules to produce an
  15
+ *   executable, regardless of the license terms of these independent modules,
  16
+ *   and to copy and distribute the resulting executable under terms of your
  17
+ *   choice, provided that you also meet, for each linked independent module,
  18
+ *   the terms and conditions of the license of that module. An independent
  19
+ *   module is a module which is not derived from or based on this library. If
  20
+ *   you modify this library, you may extend this exception to your version of
  21
+ *   the library, but you are not obligated to do so. If you do not wish to do
  22
+ *   so, delete this exception statement from your version.
  23
+ * 
  24
+ * This program is distributed in the hope that it will be useful, but WITHOUT
  25
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  26
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  27
+ * more details.
  28
+ * 
  29
+ * You should have received a copy of the GNU General Public License along
  30
+ * with this program; if not, write to the Free Software Foundation, Inc., 51
  31
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  32
+ */
  33
+package com.citrix.xenserver.console;
  34
+
  35
+import java.awt.event.KeyEvent;
  36
+import java.io.BufferedReader;
  37
+import java.io.InputStreamReader;
  38
+import java.io.IOException;
  39
+import java.util.HashMap;
  40
+import java.util.Map;
  41
+import java.util.logging.Logger;
  42
+import java.util.logging.Level;
  43
+
  44
+public class KeyMap {
  45
+    private static final Logger logger = Logger.getLogger(KeyMap.class.getName());
  46
+
  47
+    public static KeyMap getInstance() {
  48
+        return instance_;
  49
+    }
  50
+
  51
+    static KeyMap instance_ = new KeyMap();
  52
+
  53
+    Map<Integer, Integer> map_ = new HashMap<Integer, Integer>();
  54
+
  55
+    public KeyMap() {
  56
+        BufferedReader reader = null;
  57
+        try {
  58
+            reader = new BufferedReader(new InputStreamReader(getClass()
  59
+                    .getResourceAsStream("KeyMap.properties")));
  60
+            String line;
  61
+            while ((line = reader.readLine()) != null) {
  62
+                line = line.trim();
  63
+                if (line.length() == 0 || line.startsWith("#")) {
  64
+                    continue;
  65
+                }
  66
+                int index = line.indexOf("=0x");
  67
+                if (index == -1) {
  68
+                    throw new IOException("malformed line: " + line);
  69
+                }
  70
+                String keycode_str = line.substring(0, index);
  71
+                int keycode = KeyEvent.class.getField(keycode_str).getInt(null);
  72
+                int keysym = Integer.parseInt(line.substring(index + 3), 16);
  73
+                if (map_.containsKey(keycode)) {
  74
+                    throw new IOException("Duplicate entry " + line);
  75
+                }
  76
+                map_.put(keycode, keysym);
  77
+            }
  78
+        } catch (Throwable t) {
  79
+            logger.log(Level.WARNING, t.getMessage(), t);
  80
+        }
  81
+    }
  82
+
  83
+    int unicodeToKeysym(int c) {
  84
+        if (c < 0x20) {
  85
+            // The Ctrl- block. By the RFB spec, these should be
  86
+            // transmitted as separate Ctrl and lower-case letter
  87
+            // keystrokes. We've already sent the down-Ctrl, so now we
  88
+            // just need to send the code for the letter. Add 0x60 to move
  89
+            // from the 0-0x1f ASCII range into 0x60-0x7f.
  90
+            return c + 0x60;
  91
+        } else if ((c <= 0x7e) || ((0xa0 <= c) && (c <= 0xff))) {
  92
+            return c;
  93
+        }
  94
+        return -1;
  95
+    }
  96
+
  97
+    public int getKeysym(KeyEvent event) {
  98
+        int result = getMappedKey(event.getKeyCode());
  99
+        if (result == -1) {
  100
+            char c = event.getKeyChar();
  101
+            return c == KeyEvent.CHAR_UNDEFINED ? -1 : unicodeToKeysym(c);
  102
+        } else {
  103
+            return result;
  104
+        }
  105
+    }
  106
+
  107
+    /**
  108
+     * @param keycode
  109
+     *            One of the KeyEvent VK_ constants.
  110
+     * @return The keysym for that code, if it is in the map, or -1 otherwise.
  111
+     */
  112
+    public int getMappedKey(int keycode) {
  113
+        Integer ks = map_.get(keycode);
  114
+        return ks == null ? -1 : ks;
  115
+    }
  116
+
  117
+}
170  java/com/citrix/xenserver/console/KeyMap.properties
... ...
@@ -0,0 +1,170 @@
  1
+VK_SHIFT=0xffe1
  2
+VK_CONTROL=0xffe3
  3
+VK_CAPS_LOCK=0xffe5
  4
+VK_META=0xffe7
  5
+VK_ALT=0xffe9
  6
+# XK_Alt_R
  7
+VK_ALT_GRAPH=0xffea
  8
+# XK_Multi_key
  9
+VK_COMPOSE=0xff20
  10
+# XK_Win_L.  VK_WINDOWS is also sent for the right Windows key.
  11
+VK_WINDOWS=0xff5b
  12
+# XK_App
  13
+VK_CONTEXT_MENU=0xff5d
  14
+
  15
+VK_BACK_SPACE=0xff08
  16
+VK_TAB=0xff09
  17
+VK_CLEAR=0xff0b
  18
+VK_ENTER=0xff0d
  19
+VK_PAUSE=0xff13
  20
+VK_SCROLL_LOCK=0xff14
  21
+VK_ESCAPE=0xff1b
  22
+VK_DELETE=0xffff
  23
+
  24
+VK_HOME=0xff50
  25
+VK_LEFT=0xff51
  26
+VK_UP=0xff52
  27
+VK_RIGHT=0xff53
  28
+VK_DOWN=0xff54
  29
+VK_PAGE_UP=0xff55
  30
+VK_PAGE_DOWN=0xff56
  31
+VK_END=0xff57
  32
+VK_BEGIN=0xff58
  33
+
  34
+VK_PRINTSCREEN=0xff61
  35
+VK_INSERT=0xff63
  36
+VK_UNDO=0xff65
  37
+# XK_Redo
  38
+VK_AGAIN=0xff66
  39
+VK_FIND=0xff68
  40
+VK_CANCEL=0xff69
  41
+VK_HELP=0xff6a
  42
+# XK_Mode_switch.  I've no idea whether this is right.
  43
+VK_MODECHANGE=0xff7e
  44
+VK_NUM_LOCK=0xff7f
  45
+
  46
+VK_KP_LEFT=0xff96
  47
+VK_KP_UP=0xff97
  48
+VK_KP_RIGHT=0xff98
  49
+VK_KP_DOWN=0xff99
  50
+
  51
+VK_MULTIPLY=0xffaa
  52
+VK_ADD=0xffab
  53
+VK_SEPARATOR=0xffac
  54
+VK_SUBTRACT=0xffad
  55
+VK_DECIMAL=0xffae
  56
+VK_DIVIDE=0xffaf
  57
+
  58
+VK_NUMPAD0=0xffb0
  59
+VK_NUMPAD1=0xffb1
  60
+VK_NUMPAD2=0xffb2
  61
+VK_NUMPAD3=0xffb3
  62
+VK_NUMPAD4=0xffb4
  63
+VK_NUMPAD5=0xffb5
  64
+VK_NUMPAD6=0xffb6
  65
+VK_NUMPAD7=0xffb7
  66
+VK_NUMPAD8=0xffb8
  67
+VK_NUMPAD9=0xffb9
  68
+
  69
+VK_F1=0xffbe
  70
+VK_F2=0xffbf
  71
+VK_F3=0xffc0
  72
+VK_F4=0xffc1
  73
+VK_F5=0xffc2
  74
+VK_F6=0xffc3
  75
+VK_F7=0xffc4
  76
+VK_F8=0xffc5
  77
+VK_F9=0xffc6
  78
+VK_F10=0xffc7
  79
+VK_F11=0xffc8
  80
+VK_F12=0xffc9
  81
+VK_F13=0xffca
  82
+VK_F14=0xffcb
  83
+VK_F15=0xffcc
  84
+VK_F16=0xffcd
  85
+VK_F17=0xffce
  86
+VK_F18=0xffcf
  87
+VK_F19=0xffd0
  88
+VK_F20=0xffd1
  89
+VK_F21=0xffd2
  90
+VK_F22=0xffd3
  91
+VK_F23=0xffd4
  92
+VK_F24=0xffd5
  93
+
  94
+VK_DEAD_GRAVE=0xfe50
  95
+VK_DEAD_ACUTE=0xfe51
  96
+VK_DEAD_CIRCUMFLEX=0xfe52
  97
+VK_DEAD_TILDE=0xfe53
  98
+VK_DEAD_MACRON=0xfe54
  99
+VK_DEAD_BREVE=0xfe55
  100
+VK_DEAD_ABOVEDOT=0xfe56
  101
+VK_DEAD_DIAERESIS=0xfe57
  102
+VK_DEAD_ABOVERING=0xfe58
  103
+VK_DEAD_DOUBLEACUTE=0xfe59
  104
+VK_DEAD_CARON=0xfe5a
  105
+VK_DEAD_CEDILLA=0xfe5b
  106
+VK_DEAD_OGONEK=0xfe5c
  107
+VK_DEAD_IOTA=0xfe5d
  108
+VK_DEAD_VOICED_SOUND=0xfe5e
  109
+VK_DEAD_SEMIVOICED_SOUND=0xfe5f
  110
+
  111
+VK_EURO_SIGN=0x20ac
  112
+# XK_exclamdown
  113
+VK_INVERTED_EXCLAMATION_MARK=0x00a1
  114
+
  115
+# replaced by VK_INPUT_METHOD_ON_OFF for Microsoft Windows and Solaris; 
  116
+# might still be used for other platforms
  117
+VK_KANJI=0xff21
  118
+# XK_Muhenkan
  119
+VK_NONCONVERT=0xff22
  120
+# XK_Henkan
  121
+VK_CONVERT=0xff23
  122
+# XK_Romaji
  123
+VK_ROMAN_CHARACTERS=0xff24
  124
+VK_HIRAGANA=0xff25
  125
+VK_KATAKANA=0xff26
  126
+
  127
+# These three are on the Japanese Macintosh keyboard, and select the Japanese
  128
+# input method at the same time as switching mode.  Just sending the XK_ for
  129
+# the mode switch might not be enough.
  130
+VK_JAPANESE_ROMAN=0xff24
  131
+VK_JAPANESE_HIRAGANA=0xff25
  132
+VK_JAPANESE_KATAKANA=0xff26
  133
+
  134
+# XK_Zenkaku
  135
+VK_FULL_WIDTH=0xff28
  136
+# XK_Hankaku
  137
+VK_HALF_WIDTH=0xff29
  138
+
  139
+VK_KANA_LOCK=0xff2d
  140
+# replaced by VK_KANA_LOCK for Microsoft Windows and Solaris; 
  141
+# might still be used on other platforms
  142
+# XK_Kana_Shift
  143
+VK_KANA=0xff2e
  144
+# XK_Eisu_Shift
  145
+VK_ALPHANUMERIC=0xff2f
  146
+
  147
+# XK_Kanji_Bangou
  148
+VK_CODE_INPUT=0xff37
  149
+# XK_Mae_Koho
  150
+VK_PREVIOUS_CANDIDATE=0xff3e
  151
+# XK_Zen_Koho
  152
+VK_ALL_CANDIDATES=0xff3d
  153
+
  154
+# According to Java: Japanese PC 106 keyboard: kanji. Japanese Solaris
  155
+# keyboard: nihongo.
  156
+# I'm sending XK_Kanji
  157
+VK_INPUT_METHOD_ON_OFF=0xff21
  158
+
  159
+#
  160
+# No known XK_ constants
  161
+#
  162
+
  163
+#VK_FINAL                    = 0x0018;
  164
+#VK_CUT                      = 0xFFD1;
  165
+#VK_COPY                     = 0xFFCD;
  166
+#VK_PASTE                    = 0xFFCF;
  167
+#VK_PROPS                    = 0xFFCA;
  168
+#VK_STOP                     = 0xFFC8;
  169
+# Japanese Solaris keyboard: kakutei
  170
+#VK_ACCEPT
108  java/com/citrix/xenserver/console/Main.java
... ...
@@ -0,0 +1,108 @@
  1
+/*
  2
+ * Copyright (c) 2005-2009 Citrix Systems, Inc.
  3
+ *