diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/IEWebControlImp.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/console/IEWebControlImp.java')
| -rw-r--r-- | NET/worlds/console/IEWebControlImp.java | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/NET/worlds/console/IEWebControlImp.java b/NET/worlds/console/IEWebControlImp.java new file mode 100644 index 0000000..e06310a --- /dev/null +++ b/NET/worlds/console/IEWebControlImp.java @@ -0,0 +1,130 @@ +package NET.worlds.console; + +class IEWebControlImp extends WebControlImp { + private int nativeIEInstance; + private int m_hwnd; + private boolean detached; + + private native boolean nativeInit(int var1, boolean var2); + + private native void nativeDestroy(); + + private native void nativeSetURL(String var1, String var2); + + private native void nativeGoBack(); + + private native void nativeGoForward(); + + private native void nativeStop(); + + private native void nativeRefresh(); + + private native void nativeHome(); + + private native void nativePrint(int var1, int var2); + + private native void nativeResize(int var1, int var2, int var3, int var4); + + private native void nativeAddToolbar(); + + private native int nativeGetHWND(); + + public IEWebControlImp(int hwnd, boolean toolbar, boolean isBanner) throws NoWebControlException { + super(hwnd); + this.m_hwnd = hwnd; + this.nativeIEInstance = 0; + this.detached = false; + if (!this.nativeInit(hwnd, isBanner)) { + this.detached = true; + throw new NoWebControlException("Could not initialize IE control"); + } else { + if (toolbar) { + this.nativeAddToolbar(); + } + } + } + + @Override + public void finalize() { + this.detach(); + } + + @Override + public void renderTo(int dc) { + this.nativePrint(dc, this.m_hwnd); + } + + @Override + public boolean setURL(String pURL) { + pURL = processURL(pURL); + if (pURL == null) { + return false; + } else { + this.nativeSetURL(pURL, null); + return true; + } + } + + @Override + public boolean setURL(String pURL, String pPostData) { + pURL = processURL(pURL); + if (pURL == null) { + return false; + } else { + if (pPostData != null) { + pPostData = processURL(pPostData); + if (pPostData == null) { + return false; + } + } + + this.nativeSetURL(pURL, pPostData); + return true; + } + } + + @Override + public void detach() { + if (!this.detached) { + this.nativeDestroy(); + super.detach(); + this.nativeIEInstance = 0; + this.detached = true; + } + } + + @Override + public void resize(int w, int h, int xPer, int yPer) { + this.nativeResize(w, h, xPer, yPer); + } + + @Override + public void goBack() { + this.nativeGoBack(); + } + + @Override + public void goForward() { + this.nativeGoForward(); + } + + @Override + public void stop() { + this.nativeStop(); + } + + @Override + public void refresh() { + this.nativeRefresh(); + } + + @Override + public void home() { + this.nativeHome(); + } + + @Override + public int getHWND() { + return this.nativeGetHWND(); + } +} |