1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/* */ package NET.worlds.console;
/* */
/* */
/* */ public abstract class RenderCanvasOverlay
/* */ {
/* */ private RenderCanvas canvas;
/* */
/* */ private int xPercent;
/* */
/* */ private int yPercent;
/* */
/* */ private int xFixed;
/* */
/* */ private int yFixed;
/* */
/* */ private boolean isFixed;
/* */ private boolean fullscreen;
/* */ private int hwnd;
/* */ private boolean allowFocus;
/* */
/* */ public RenderCanvasOverlay(RenderCanvas pCanvas, int pX, int pY, boolean pIsFixed, boolean pAllowFocus)
/* */ throws NoWebControlException
/* */ {
/* 24 */ assert ((pX > 0) || (pY > 0));
/* */
/* 26 */ if ((pCanvas == null) || (pCanvas.getWindow() == null)) {
/* 27 */ throw new NoWebControlException("RenderCanvas does not exist");
/* */ }
/* 29 */ this.canvas = pCanvas;
/* 30 */ this.isFixed = pIsFixed;
/* 31 */ this.allowFocus = pAllowFocus;
/* */
/* 33 */ if (this.isFixed) {
/* 34 */ this.xFixed = pX;
/* 35 */ this.yFixed = pY;
/* 36 */ this.xPercent = (this.yPercent = 1);
/* */ } else {
/* 38 */ this.xPercent = pX;
/* 39 */ this.yPercent = pY;
/* */ }
/* */
/* */
/* 43 */ this.fullscreen = false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public RenderCanvasOverlay(RenderCanvas pCanvas)
/* */ {
/* 53 */ assert (pCanvas != null);
/* */
/* 55 */ this.canvas = pCanvas;
/* 56 */ this.xPercent = (this.yPercent = 100);
/* 57 */ this.isFixed = false;
/* 58 */ this.allowFocus = true;
/* */
/* 60 */ this.fullscreen = true;
/* */
/* */
/* 63 */ this.hwnd = this.canvas.getWindow().getHwnd();
/* */ }
/* */
/* */ public void activate() {
/* 67 */ this.canvas.addOverlay(this);
/* */ }
/* */
/* */ int getNativeWindowHandle() {
/* 71 */ assert (this.canvas.getWindow() != null);
/* */
/* 73 */ if (this.hwnd == 0) {
/* 74 */ if (this.fullscreen) {
/* 75 */ this.hwnd = this.canvas.getWindow().getHwnd();
/* */ } else {
/* 77 */ this.hwnd = nativeMakeChild(this.canvas.getWindow().getHwnd(), this.xPercent,
/* 78 */ this.yPercent, this.allowFocus);
/* */ }
/* */ }
/* 81 */ return this.hwnd;
/* */ }
/* */
/* */ int getXPercent() {
/* 85 */ return this.xPercent;
/* */ }
/* */
/* */ int getYPercent() {
/* 89 */ return this.yPercent;
/* */ }
/* */
/* */ int getFixedWidth() {
/* 93 */ return this.xFixed;
/* */ }
/* */
/* */ int getFixedHeight() {
/* 97 */ return this.yFixed;
/* */ }
/* */
/* */
/* 101 */ boolean getIsFixedSize() { return this.isFixed; }
/* */
/* */ void canvasResized(int parentX, int parentY) {
/* */ int w;
/* */ int h;
/* 106 */ if (this.isFixed) {
/* 107 */ int w = this.xFixed;
/* 108 */ int h = this.yFixed;
/* 109 */ if (w > parentX)
/* 110 */ w = parentX;
/* 111 */ if (h > parentY)
/* 112 */ h = parentY;
/* 113 */ this.xPercent =
/* 114 */ ((int)Math.ceil(w / parentX * 100.0D));
/* 115 */ this.yPercent =
/* 116 */ ((int)Math.ceil(h / parentY * 100.0D));
/* */ } else {
/* 118 */ w = (int)(parentX * this.xPercent * 0.01D);
/* 119 */ h = (int)(parentY * this.yPercent * 0.01D);
/* */ }
/* */
/* 122 */ if (this.hwnd != 0) {
/* 123 */ nativeResizeChild(this.hwnd, w, h);
/* */ }
/* */ }
/* */
/* */ boolean isFullscreen() {
/* 128 */ return (this.fullscreen) || ((!this.isFixed) && (this.xPercent == 100) && (this.yPercent == 100));
/* */ }
/* */
/* */
/* */
/* */ protected abstract void handleCommand(int paramInt);
/* */
/* */
/* */ void detach()
/* */ {
/* 138 */ this.canvas.removeOverlay(this);
/* 139 */ if ((!this.fullscreen) && (this.hwnd != 0)) {
/* 140 */ nativeKillChild(this.hwnd);
/* */ }
/* */ }
/* */
/* */ private native int nativeMakeChild(long paramLong, int paramInt1, int paramInt2, boolean paramBoolean);
/* */
/* */ private native void nativeKillChild(long paramLong);
/* */
/* */ private native void nativeResizeChild(int paramInt1, int paramInt2, int paramInt3);
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\RenderCanvasOverlay.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|