Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrushforth committed Jan 11, 2020
2 parents 63520a0 + f907026 commit 16cea41
Show file tree
Hide file tree
Showing 82 changed files with 1,065 additions and 15,032 deletions.
534 changes: 165 additions & 369 deletions buildSrc/android.gradle

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javafx.scene.Node;

public class DalvikInput {
/*
public static void onMultiTouchEvent(final int count, final int[] actions,
final int[] ids, final int[] touchXs, final int[] touchYs) {
Expand Down Expand Up @@ -71,4 +72,5 @@ public static void setActiveNode (Node n) {
public static native void onSurfaceRedrawNeededNative();
public static native void onConfigurationChangedNative(int flag);
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void gotTouchEventFromNative(int count, int[] actions, int[] ids,
touchState.addPoint(p);
}
}
instance.gotTouchEvent(touchState);
Platform.runLater(() -> instance.gotTouchEvent(touchState));
}

private void gotTouchEvent(TouchState touchState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ protected Screen[] staticScreen_getScreens() {
0, 0, ns.getWidth(), ns.getHeight(),
0, 0, ns.getWidth(), ns.getHeight(),
0, 0, ns.getWidth(), ns.getHeight(),
ns.getDPI(), ns.getDPI(),
ns.getScale(), ns.getScale(),
ns.getScale(), ns.getScale());
ns.getWidth(), ns.getHeight(),
1.f, 1.f, ns.getScale(), ns.getScale());
// Move the cursor to the middle of the screen
MouseState mouseState = new MouseState();
mouseState.setX(ns.getWidth() / 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,8 @@ private com.sun.javafx.geom.Shape doConfigShape() {
* The size of a tab stop in spaces.
* Values less than 1 are treated as 1.
*
* @return the {@code tabSize} property
*
* @defaultValue 8
*
* @since 14
Expand Down
26 changes: 22 additions & 4 deletions modules/javafx.graphics/src/main/native-glass/mac/GlassDialogs.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -69,6 +69,24 @@ static BOOL doPerformKeyEquivalent(NSEvent* theEvent, NSWindow* panel)
return false;
}

/*
* Function to determine whether or not to use raw NSPanel classes
* (either NSSavePanel or NSOpenPanel).
*
* Return: YES if we need to use the raw NSPanel classes; NO if we
* can use the Glass subclasses
*/
static BOOL useNSPanel()
{
// As of macOS 10.15 all file dialogs are out of process, so we
// effectively can't subclass them.
if (@available(macOS 10.15, *)) {
return YES;
} else {
return [GlassApplication isSandboxed];
}
}

@interface GlassSavePanel : NSSavePanel
@end

Expand Down Expand Up @@ -485,7 +503,7 @@ static jobject convertNSURLtoFile(JNIEnv *env, NSURL *url)
GLASS_ASSERT_MAIN_JAVA_THREAD(env);
GLASS_POOL_ENTER;
{
NSOpenPanel *panel = [GlassApplication isSandboxed] ? [NSOpenPanel openPanel] : [GlassOpenPanel openPanel];
NSOpenPanel *panel = useNSPanel() ? [NSOpenPanel openPanel] : [GlassOpenPanel openPanel];
[panel setAllowsMultipleSelection:(jMultipleMode==JNI_TRUE)];
[panel setTitle:[GlassHelper nsStringWithJavaString:jTitle withEnv:env]];
NSString *folder = [GlassHelper nsStringWithJavaString:jFolder withEnv:env];
Expand Down Expand Up @@ -561,7 +579,7 @@ static jobject convertNSURLtoFile(JNIEnv *env, NSURL *url)
GLASS_ASSERT_MAIN_JAVA_THREAD(env);
GLASS_POOL_ENTER;
{
NSSavePanel *panel = [GlassApplication isSandboxed] ? [NSSavePanel savePanel] : [GlassSavePanel savePanel];
NSSavePanel *panel = useNSPanel() ? [NSSavePanel savePanel] : [GlassSavePanel savePanel];
[panel setTitle:[GlassHelper nsStringWithJavaString:jTitle withEnv:env]];
NSString *folder = [GlassHelper nsStringWithJavaString:jFolder withEnv:env];
if ([folder length] > 0)
Expand Down Expand Up @@ -633,7 +651,7 @@ static jobject convertNSURLtoFile(JNIEnv *env, NSURL *url)
GLASS_ASSERT_MAIN_JAVA_THREAD(env);
GLASS_POOL_ENTER;
{
NSOpenPanel *panel = [GlassApplication isSandboxed] ? [NSOpenPanel openPanel] : [GlassOpenPanel openPanel];
NSOpenPanel *panel = useNSPanel() ? [NSOpenPanel openPanel] : [GlassOpenPanel openPanel];
[panel setTitle:[GlassHelper nsStringWithJavaString:jTitle withEnv:env]];
NSString *folder = [GlassHelper nsStringWithJavaString:jFolder withEnv:env];
if ([folder length] > 0)
Expand Down
16 changes: 16 additions & 0 deletions modules/javafx.graphics/src/main/native-glass/monocle/EGL.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@

#include <stdlib.h>

//Builtin library entrypoint
JNIEXPORT jint JNICALL
JNI_OnLoad_glass_monocle(JavaVM *vm, void * reserved) {
fprintf(stderr, "In JNI_OnLoad_glass)monocle\n");
#ifdef JNI_VERSION_1_8
//min. returned JNI_VERSION required by JDK8 for builtin libraries
JNIEnv *env;
if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_8) != JNI_OK) {
return JNI_VERSION_1_4;
}
return JNI_VERSION_1_8;
#else
return JNI_VERSION_1_4;
#endif
}

void setEGLAttrs(jint *attrs, int *eglAttrs) {
int index = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
*/

#include <android/native_window_jni.h>
// #include "activity.h"
#include "dalvikInput.h"
#include "nativeBridge.h"
#include "com_sun_glass_ui_monocle_AndroidScreen.h"
#include "Monocle.h"
#include "logging.h"


/*
Expand Down Expand Up @@ -69,7 +67,7 @@ JNIEXPORT jint JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getHeight
JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getNativeHandle
(JNIEnv *env, jobject obj) {
ANativeWindow* androidWindow = android_getNativeWindow(env);
return androidWindow;
return (jlong)androidWindow;
}

/*
Expand All @@ -79,9 +77,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getNativeH
*/
JNIEXPORT jfloat JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getDensity
(JNIEnv *env, jobject obj) {
jfloat answer = android_getDensity();
LOGI("DENSITY", "GETDENSITY, answer = %f\n",answer);
return answer;
return android_getDensity(env);
}


Expand Down
Loading

0 comments on commit 16cea41

Please sign in to comment.