Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Mar 12, 2024
1 parent 5b2d278 commit ff8e49f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 75 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ cmake_minimum_required(VERSION 3.19)
# Only generate Debug and Release configuration types.
set(CMAKE_CONFIGURATION_TYPES Debug Release)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")

# Project name.
project(jcef)

Expand Down
12 changes: 6 additions & 6 deletions cmake/DownloadCEF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Visit https://cef-builds.spotifycdn.com/index.html for the list of
# supported platforms and versions.

function(DownloadCEF platform branch version download_dir)
function(DownloadCEF platform version download_dir)
# Specify the binary distribution type and download directory.
set(CEF_DISTRIBUTION "cef_binary_${version}_${platform}")
set(CEF_DOWNLOAD_DIR "${download_dir}")
Expand All @@ -21,19 +21,19 @@ function(DownloadCEF platform branch version download_dir)
set(CEF_DOWNLOAD_FILENAME "${CEF_DISTRIBUTION}.tar.bz2")
set(CEF_DOWNLOAD_PATH "${CEF_DOWNLOAD_DIR}/${CEF_DOWNLOAD_FILENAME}")
if(NOT EXISTS "${CEF_DOWNLOAD_PATH}")
set(CEF_DOWNLOAD_URL "https://mcef-download.cinemamod.com/cef-builds/${branch}/${CEF_DOWNLOAD_FILENAME}")
set(CEF_DOWNLOAD_URL "https://cef-builds.spotifycdn.com/${CEF_DOWNLOAD_FILENAME}")
string(REPLACE "+" "%2B" CEF_DOWNLOAD_URL_ESCAPED ${CEF_DOWNLOAD_URL})

# Download the SHA1 hash for the binary distribution.
# message(STATUS "Downloading ${CEF_DOWNLOAD_PATH}.sha1 from ${CEF_DOWNLOAD_URL_ESCAPED}...")
# file(DOWNLOAD "${CEF_DOWNLOAD_URL_ESCAPED}.sha1" "${CEF_DOWNLOAD_PATH}.sha1")
# file(READ "${CEF_DOWNLOAD_PATH}.sha1" CEF_SHA1)
message(STATUS "Downloading ${CEF_DOWNLOAD_PATH}.sha1 from ${CEF_DOWNLOAD_URL_ESCAPED}...")
file(DOWNLOAD "${CEF_DOWNLOAD_URL_ESCAPED}.sha1" "${CEF_DOWNLOAD_PATH}.sha1")
file(READ "${CEF_DOWNLOAD_PATH}.sha1" CEF_SHA1)

# Download the binary distribution and verify the hash.
message(STATUS "Downloading ${CEF_DOWNLOAD_PATH}...")
file(
DOWNLOAD "${CEF_DOWNLOAD_URL_ESCAPED}" "${CEF_DOWNLOAD_PATH}"
# EXPECTED_HASH SHA1=${CEF_SHA1}
EXPECTED_HASH SHA1=${CEF_SHA1}
SHOW_PROGRESS
)
endif()
Expand Down
43 changes: 6 additions & 37 deletions java/org/cef/browser/CefBrowser_N.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
import org.cef.CefBrowserSettings;
import org.cef.CefClient;
import org.cef.browser.CefDevToolsClient.DevToolsException;
import org.cef.browser.CefRequestContext;
import org.cef.callback.CefDragData;
import org.cef.callback.CefNativeAdapter;
import org.cef.callback.CefPdfPrintCallback;
import org.cef.callback.CefRunFileDialogCallback;
import org.cef.callback.CefStringVisitor;
import org.cef.callback.*;
import org.cef.event.CefKeyEvent;
import org.cef.event.CefMouseEvent;
import org.cef.event.CefMouseWheelEvent;
Expand All @@ -22,16 +17,10 @@
import org.cef.handler.CefWindowHandler;
import org.cef.misc.CefPdfPrintSettings;
import org.cef.network.CefRequest;
import java.util.concurrent.CompletableFuture;

import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.WindowEvent;
import java.awt.*;
import java.util.Vector;

import javax.swing.SwingUtilities;
import java.util.concurrent.CompletableFuture;

/**
* This class represents all methods which are connected to the
Expand Down Expand Up @@ -339,26 +328,6 @@ public CefFrame getFocusedFrame() {
}
}

@Override
public CefFrame getFrame(long identifier) {
try {
return N_GetFrame(identifier);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
}
}

@Override
public CefFrame getFrame(String name) {
try {
return N_GetFrame2(name);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
}
}

@Override
public CefFrame getFrameByIdentifier(String identifier) {
try {
Expand Down Expand Up @@ -871,9 +840,9 @@ private final native void N_Find(
private final native void N_ReplaceMisspelling(String word);
private final native void N_WasResized(int width, int height);
private final native void N_Invalidate();
private final native void N_SendKeyEvent(KeyEvent e);
private final native void N_SendMouseEvent(MouseEvent e);
private final native void N_SendMouseWheelEvent(MouseWheelEvent e);
private final native void N_SendKeyEvent(CefKeyEvent e);
private final native void N_SendMouseEvent(CefMouseEvent e);
private final native void N_SendMouseWheelEvent(CefMouseWheelEvent e);
private final native void N_DragTargetDragEnter(
CefDragData dragData, Point pos, int modifiers, int allowed_ops);
private final native void N_DragTargetDragOver(Point pos, int modifiers, int allowed_ops);
Expand Down
30 changes: 0 additions & 30 deletions native/CefBrowser_N.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,36 +1332,6 @@ Java_org_cef_browser_CefBrowser_1N_N_1GetFocusedFrame(JNIEnv* env,
return jframe.Release();
}

JNIEXPORT jobject JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrame(JNIEnv* env,
jobject obj,
jlong identifier) {
CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
CefRefPtr<CefFrame> frame = browser->GetFrame(identifier);
if (!frame)
return nullptr;
ScopedJNIFrame jframe(env, frame);
return jframe.Release();
}

JNIEXPORT jobject JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrame2(JNIEnv* env,
jobject obj,
jstring name) {
CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj, nullptr);
CefRefPtr<CefFrame> frame = browser->GetFrame(GetJNIString(env, name));
if (!frame)
return nullptr;
ScopedJNIFrame jframe(env, frame);
return jframe.Release();
}

JNIEXPORT jint JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrameCount(JNIEnv* env, jobject obj) {
CefRefPtr<CefBrowser> browser = JNI_GET_BROWSER_OR_RETURN(env, obj, -1);
return (jint)browser->GetFrameCount();
}

JNIEXPORT jobject JNICALL
Java_org_cef_browser_CefBrowser_1N_N_1GetFrameByIdentifier(JNIEnv* env,
jobject obj,
Expand Down

0 comments on commit ff8e49f

Please sign in to comment.