/* */ 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 */