]>
Commit | Line | Data |
---|---|---|
e6d0212c DM |
1 | Index: new/java/src/com/tigervnc/vncviewer/VncViewer.java |
2 | =================================================================== | |
085cabef DM |
3 | --- new.orig/java/src/com/tigervnc/vncviewer/VncViewer.java 2013-05-10 07:41:18.000000000 +0200 |
4 | +++ new/java/src/com/tigervnc/vncviewer/VncViewer.java 2013-05-10 07:41:18.000000000 +0200 | |
e6d0212c DM |
5 | @@ -27,11 +27,15 @@ |
6 | ||
7 | package com.tigervnc.vncviewer; | |
8 | ||
9 | +import netscape.javascript.*; | |
10 | import java.awt.*; | |
11 | import java.awt.event.*; | |
12 | import java.io.*; | |
13 | import java.net.*; | |
14 | ||
15 | +import java.awt.Graphics; | |
16 | +import java.applet.Applet; | |
17 | + | |
18 | public class VncViewer extends java.applet.Applet | |
19 | implements java.lang.Runnable, WindowListener, ComponentListener { | |
20 | ||
085cabef DM |
21 | @@ -94,6 +98,9 @@ |
22 | ||
23 | String PVECert; | |
e6d0212c DM |
24 | |
25 | + JSObject jswin; | |
26 | + String myid; | |
27 | + | |
28 | // Reference to this applet for inter-applet communication. | |
29 | public static java.applet.Applet refApplet; | |
30 | ||
085cabef | 31 | @@ -129,6 +136,11 @@ |
e6d0212c DM |
32 | |
33 | refApplet = this; | |
34 | ||
35 | + if (inAnApplet) { | |
36 | + jswin = JSObject.getWindow(this); | |
37 | + myid = getParameter("id"); | |
38 | + } | |
39 | + | |
40 | if (inSeparateFrame) { | |
41 | vncFrame = new Frame("TigerVNC"); | |
42 | if (!inAnApplet) { | |
085cabef | 43 | @@ -159,6 +171,9 @@ |
e6d0212c DM |
44 | |
45 | rfbThread = new Thread(this); | |
46 | rfbThread.start(); | |
47 | + | |
48 | + String[] myparam = { myid, "init"}; | |
49 | + jswin.call("PVE_vnc_console_event", myparam); | |
50 | } | |
51 | ||
52 | public void update(Graphics g) { | |
085cabef | 53 | @@ -1002,6 +1017,8 @@ |
e6d0212c DM |
54 | |
55 | if (inAnApplet) { | |
56 | showMessage("Disconnected"); | |
57 | + String[] myparam = { myid, "disconnect"}; | |
58 | + jswin.call("PVE_vnc_console_event", myparam); | |
59 | } else { | |
60 | System.exit(0); | |
61 | } | |
085cabef | 62 | @@ -1019,6 +1036,8 @@ |
e6d0212c DM |
63 | // vncContainer null, applet not inited, |
64 | // can not present the error to the user. | |
65 | Thread.currentThread().stop(); | |
66 | + String[] myparam = { myid, "error", str}; | |
67 | + jswin.call("PVE_vnc_console_event", myparam); | |
68 | } else { | |
69 | System.exit(1); | |
70 | } | |
085cabef | 71 | @@ -1040,6 +1059,8 @@ |
e6d0212c DM |
72 | rfb.close(); |
73 | ||
74 | if (inAnApplet) { | |
75 | + String[] myparam = { myid, "error", str}; | |
76 | + jswin.call("PVE_vnc_console_event", myparam); | |
77 | showMessage(str); | |
78 | } else { | |
79 | System.exit(1); | |
085cabef | 80 | @@ -1109,6 +1130,9 @@ |
e6d0212c DM |
81 | rfb.close(); |
82 | if (inSeparateFrame) | |
83 | vncFrame.dispose(); | |
84 | + | |
85 | + String[] myparam = { myid, "destroy"}; | |
86 | + jswin.call("PVE_vnc_console_event", myparam); | |
87 | } | |
88 | ||
89 | // | |
085cabef | 90 | @@ -1157,6 +1181,8 @@ |
e6d0212c DM |
91 | if (!inAnApplet) { |
92 | System.exit(0); | |
93 | } | |
94 | + String[] myparam = { myid, "close"}; | |
95 | + jswin.call("PVE_vnc_console_event", myparam); | |
96 | } | |
97 | ||
98 | // | |
99 | Index: new/java/src/com/tigervnc/vncviewer/Makefile | |
100 | =================================================================== | |
085cabef DM |
101 | --- new.orig/java/src/com/tigervnc/vncviewer/Makefile 2013-05-10 07:41:18.000000000 +0200 |
102 | +++ new/java/src/com/tigervnc/vncviewer/Makefile 2013-05-10 07:43:17.000000000 +0200 | |
103 | @@ -4,7 +4,7 @@ | |
e6d0212c DM |
104 | |
105 | CP = cp | |
106 | JC = javac | |
085cabef DM |
107 | -JCFLAGS = -target 1.7 -classpath ../../../ |
108 | +JCFLAGS = -target 1.7 -classpath ../../../ -Djava.ext.dirs=/usr/share/icedtea-web/ | |
e6d0212c DM |
109 | JAR = jar |
110 | ARCHIVE = VncViewer.jar | |
111 | MANIFEST = MANIFEST.MF |