summaryrefslogtreecommitdiff
path: root/NET/worlds/console/Window.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/Window.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/Window.java')
-rw-r--r--NET/worlds/console/Window.java372
1 files changed, 372 insertions, 0 deletions
diff --git a/NET/worlds/console/Window.java b/NET/worlds/console/Window.java
new file mode 100644
index 0000000..beb4994
--- /dev/null
+++ b/NET/worlds/console/Window.java
@@ -0,0 +1,372 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.scape.Camera;
+/* */ import java.awt.Component;
+/* */ import java.awt.Dimension;
+/* */ import java.awt.Point;
+/* */ import java.awt.TextArea;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class Window
+/* */ {
+/* */ private static Window activeWindow;
+/* */ private int hWndGamma;
+/* */ private int hWndFrame;
+/* */ private static int hInstGamma;
+/* */ private static int hWndFrameStatic;
+/* */ public static final int NORMAL = 0;
+/* */ public static final int MINIMIZED = 1;
+/* */ public static final int MAXIMIZED = 2;
+/* */ private int windowInstancePtr;
+/* */
+/* */ public Window(String frameTitle, Point loc, Dimension dim, Camera cam, boolean interceptEvents)
+/* */ throws WindowNotFoundException
+/* */ {
+/* 97 */ nativeInit();
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* 111 */ if (hWndFrameStatic != 0) {
+/* 112 */ this.hWndFrame = hWndFrameStatic;
+/* */ } else {
+/* 114 */ this.hWndFrame = findWindow(frameTitle);
+/* */ }
+/* 116 */ if (this.hWndFrame != 0)
+/* 117 */ this.hWndGamma = findOrMakeChildWindow(this.hWndFrame, loc.x, loc.y,
+/* 118 */ dim.width, dim.height);
+/* 119 */ if (this.hWndGamma == 0) {
+/* 120 */ throw new WindowNotFoundException("No such window");
+/* */ }
+/* */
+/* 123 */ if (hWndFrameStatic == 0) {
+/* 124 */ hWndFrameStatic = this.hWndFrame;
+/* */ }
+/* 126 */ hInstGamma = install(interceptEvents);
+/* 127 */ maybeResize(dim.width, dim.height);
+/* 128 */ if (interceptEvents) {
+/* 129 */ activeWindow = this;
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public void hookChatLine(Component chatLine)
+/* */ throws WindowNotFoundException
+/* */ {
+/* 140 */ assert (activeWindow == this);
+/* 141 */ Dimension dim = chatLine.getSize();
+/* */ try {
+/* 143 */ Point loc = chatLine.getLocationOnScreen();
+/* 144 */ int hwndChatLine = findChildWindow(hWndFrameStatic, loc.x, loc.y,
+/* 145 */ dim.width, dim.height);
+/* 146 */ if (hwndChatLine != 0) {
+/* 147 */ setChatLine(hwndChatLine);
+/* 148 */ return;
+/* */ }
+/* */ }
+/* */ catch (Exception localException) {
+/* 152 */ throw new WindowNotFoundException();
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */ private static native void setChatLine(int paramInt);
+/* */
+/* */
+/* */
+/* */ public static native int getVoiceChatWParam();
+/* */
+/* */
+/* */
+/* */ public static native int getVoiceChatLParam();
+/* */
+/* */
+/* */
+/* */ public static native void resetVoiceChatMsg();
+/* */
+/* */
+/* */
+/* */ public static native void doMicrosoftVMHacks();
+/* */
+/* */
+/* */
+/* */ public static native boolean usingMicrosoftVMHacks();
+/* */
+/* */
+/* */
+/* */ public static native boolean getActivated();
+/* */
+/* */
+/* */ public static native boolean isActivated();
+/* */
+/* */
+/* */ public static native int getGammaProcessID();
+/* */
+/* */
+/* */ public native void dispose();
+/* */
+/* */
+/* */ public static Window getMainWindow()
+/* */ {
+/* 196 */ return activeWindow;
+/* */ }
+/* */
+/* */
+/* */
+/* */ public native int getHwnd();
+/* */
+/* */
+/* */
+/* */ public void hideNativeWindow()
+/* */ {
+/* 207 */ if (this.hWndGamma != 0)
+/* 208 */ nativeHideChildWindow(this.hWndGamma);
+/* */ }
+/* */
+/* */ public void showNativeWindow() {
+/* 212 */ if (this.hWndGamma != 0)
+/* 213 */ nativeShowChildWindow(this.hWndGamma);
+/* */ }
+/* */
+/* */ native void nativeHideChildWindow(int paramInt);
+/* */
+/* */ native void nativeShowChildWindow(int paramInt);
+/* */
+/* */ public static int getHWnd() {
+/* 221 */ return activeWindow == null ? 0 : activeWindow.hWndGamma;
+/* */ }
+/* */
+/* */ public static int getHInst() {
+/* 225 */ return hInstGamma;
+/* */ }
+/* */
+/* */
+/* */
+/* */ public native void maybeResize(int paramInt1, int paramInt2);
+/* */
+/* */
+/* */ public native void setDeltaMode(boolean paramBoolean);
+/* */
+/* */
+/* */ public static native int getAndResetUserActionCount();
+/* */
+/* */
+/* */ public native boolean getDeltaMode();
+/* */
+/* */
+/* */ public static native void makeJavaReleaseCapture();
+/* */
+/* */
+/* */ public native void reShape(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
+/* */
+/* */
+/* */ public void setBounds(int x, int y, int width, int height)
+/* */ {
+/* 250 */ reShape(x, y, width, height);
+/* */ }
+/* */
+/* */
+/* */
+/* */ public native int fullWidth();
+/* */
+/* */
+/* */
+/* */ public native int fullHeight();
+/* */
+/* */
+/* */
+/* */ public static native int findWindow(String paramString);
+/* */
+/* */
+/* */
+/* */ public static native int getFrameWindow();
+/* */
+/* */
+/* */
+/* */ public static native void hideCursor();
+/* */
+/* */
+/* */
+/* */ public static native int[] getHiddenCursorDelta();
+/* */
+/* */
+/* */
+/* */ public static native void setCursor(int paramInt);
+/* */
+/* */
+/* */
+/* */ public static native int getWindowState(int paramInt);
+/* */
+/* */
+/* */ public static native void setWindowState(int paramInt1, int paramInt2);
+/* */
+/* */
+/* */ public static native void setForegroundWindow(int paramInt);
+/* */
+/* */
+/* */ public static native void setVideoMode(int paramInt1, int paramInt2, int paramInt3);
+/* */
+/* */
+/* */ public static native void nativeInit();
+/* */
+/* */
+/* */ private native int install(boolean paramBoolean);
+/* */
+/* */
+/* */ static synchronized int findChildWindow(int hWndParent, int x, int y, int w, int h)
+/* */ {
+/* 303 */ return nativeFindChildWindow(hWndParent, x, y, w, h);
+/* */ }
+/* */
+/* */ static synchronized int findOrMakeChildWindow(int hWndParent, int x, int y, int w, int h)
+/* */ {
+/* 308 */ return nativeFindOrMakeChildWindow(hWndParent, x, y, w, h);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public static boolean isLastLineVisible(int hwnd, TextArea ta)
+/* */ {
+/* 316 */ Dimension s = ta.getSize();
+/* */
+/* 318 */ return nativeIsLastLineVisible(hwnd, s.width, s.height) != 0;
+/* */ }
+/* */
+/* */
+/* */ private static native int nativeIsLastLineVisible(int paramInt1, int paramInt2, int paramInt3);
+/* */
+/* */
+/* */ private static native int nativeFindChildWindow(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
+/* */
+/* */
+/* */ private static native int nativeFindOrMakeChildWindow(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
+/* */
+/* */ public static int playVideoClip(Component c, String name)
+/* */ {
+/* 332 */ Point p = c.getLocationOnScreen();
+/* 333 */ Dimension s = c.getSize();
+/* 334 */ return playVideoClip(name, findChildWindow(
+/* 335 */ activeWindow.hWndFrame, p.x, p.y, s.width, s.height));
+/* */ }
+/* */
+/* */
+/* */
+/* */ public static native boolean isVideoPlaying(int paramInt);
+/* */
+/* */
+/* */
+/* */ private static native int playVideoClip(String paramString, int paramInt);
+/* */
+/* */
+/* */
+/* */ public static native void hookWinAPIs(String paramString);
+/* */
+/* */
+/* */ public static native int getWindowWidth(int paramInt);
+/* */
+/* */
+/* */ public static native int getWindowHeight(int paramInt);
+/* */
+/* */
+/* */ public static native void allowFGJavaPalette(boolean paramBoolean);
+/* */
+/* */
+/* */ public static int getFrameHandle()
+/* */ {
+/* 362 */ return hWndFrameStatic;
+/* */ }
+/* */
+/* */ public static native int getSystemMetrics(int paramInt);
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\Window.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file