Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8253356: JavaFX Terminology Refresh #368

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -56,7 +56,7 @@

static UIImageView * dragImage = nil;// Image(s) shown during drag and drop

static UIView * dragViewParent;// parental UIView of all GlassWindows (aka masterHostView); do not retain
static UIView * dragViewParent;// parental UIView of all GlassWindows (aka mainHostView); do not retain
static UIView * dragSourceView;// GlassView where drag operation started

static jobject lastJavaViewDragTarget = NULL; // last view where mouse occured during dragging session
Expand Down
Expand Up @@ -307,7 +307,7 @@ - (void)mouseMove:(CGPoint)p

- (void)mousePress
{
touch = [[UITouch alloc] initInView:[GlassWindow getMasterWindowHost] :touchLocation];
touch = [[UITouch alloc] initInView:[GlassWindow getMainWindowHost] :touchLocation];
UIEvent *eventDown = [[UIEvent alloc] initWithTouch:touch];

[touch.view touchesBegan:[eventDown allTouches] withEvent:eventDown];
Expand Down Expand Up @@ -363,7 +363,7 @@ - (void)captureScreen {
// On iOS 4 and later, use UIGraphicsBeginImageContextWithOptions to take the scale into consideration
// Set the scale parameter to your OpenGL ES view's contentScaleFactor
// so that you get a high-resolution snapshot when its value is greater than 1.0
CGFloat scale = [GlassWindow getMasterWindowHost].contentScaleFactor;
CGFloat scale = [GlassWindow getMainWindowHost].contentScaleFactor;
NSInteger widthInPoints = width / scale;
NSInteger heightInPoints = height / scale;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(widthInPoints, heightInPoints), NO, scale);
Expand Down Expand Up @@ -412,7 +412,7 @@ - (jint *)getScreenPixels {
}

- (void)keyPress:(NSString *)chr {
UIView *subview = [[[GlassWindow getMasterWindowHost] subviews] objectAtIndex:0];
UIView *subview = [[[GlassWindow getMainWindowHost] subviews] objectAtIndex:0];
if (subview != NULL) {
subview = [[subview subviews] objectAtIndex:0];
if (subview != NULL) {
Expand Down
Expand Up @@ -741,7 +741,7 @@ -(BOOL)textFieldShouldReturn:(UITextField *)textField{
unicode:(char)13
modifiers:0];

[[GlassWindow getMasterWindow] resignFocusOwner];
[[GlassWindow getMainWindow] resignFocusOwner];

return YES;
}
Expand Down
Expand Up @@ -72,11 +72,11 @@
}

// Toplevel containers of all GlassWindows
// once we support multiple screens on iOS - there will be one masterWindow/
// masterWindowHost per screen; These windows are not part of FX/Glass window hierarchy, they
// once we support multiple screens on iOS - there will be one mainWindow/
// mainWindowHost per screen; These windows are not part of FX/Glass window hierarchy, they
// serve us as OS containers. They allow us to easily change orientation for all GlassWindows, etc.
+(GlassMainWindow *) getMasterWindow;
+(GlassMainView *) getMasterWindowHost;
+(GlassMainWindow *) getMainWindow;
+(GlassMainView *) getMainWindowHost;

- (void)setEnabled:(BOOL)enabled; // see isFocusable
- (void)_setTransparent:(BOOL)state;
Expand Down
48 changes: 24 additions & 24 deletions modules/javafx.graphics/src/main/native-glass/ios/GlassWindow.m
Expand Up @@ -105,10 +105,10 @@ - (void) dealloc {
@end

//Toplevel containers of all GlassWindows
//once we support multiple screens on iOS - there will be one masterWindow/
//masterWindowHost per screen
static GlassMainWindow * masterWindow = nil;
static GlassMainView * masterWindowHost = nil;
//once we support multiple screens on iOS - there will be one mainWindow/
//mainWindowHost per screen
static GlassMainWindow * mainWindow = nil;
static GlassMainView * mainWindowHost = nil;

@interface GlassWindow (JavaAdditions)
- (void)displaySubviews;
Expand Down Expand Up @@ -206,12 +206,12 @@ static inline void setWindowFrame(GlassWindow *window, CGFloat x, CGFloat y, CGF

@implementation GlassWindow

+(GlassMainWindow *) getMasterWindow {
return masterWindow;
+(GlassMainWindow *) getMainWindow {
return mainWindow;
}

+(GlassMainView *) getMasterWindowHost {
return masterWindowHost;
+(GlassMainView *) getMainWindowHost {
return mainWindowHost;
}

- (BOOL) canBecomeFirstResponder {return YES;}
Expand Down Expand Up @@ -283,8 +283,8 @@ - (void) close {

[self windowWillClose];

[masterWindowHost release];
[masterWindow release];//decrease retaincount
[mainWindowHost release];
[mainWindow release];//decrease retaincount
}


Expand Down Expand Up @@ -828,7 +828,7 @@ jlong _1createWindow(JNIEnv *env, jobject jWindow, jlong jOwnerPtr, jlong jScree
}


if (masterWindow == nil) {
if (mainWindow == nil) {
//We have to remove rootViewController of splashscreen UIWindow in order to avoid
//StatusBar orientation change ...
UIWindow *splashScreen = [[UIApplication sharedApplication] keyWindow];
Expand All @@ -838,26 +838,26 @@ jlong _1createWindow(JNIEnv *env, jobject jWindow, jlong jOwnerPtr, jlong jScree
CGRect applicationFrame = [screen bounds];
GLASS_LOG("FRAME: %@", applicationFrame);

masterWindow = [[GlassMainWindow alloc] initWithFrame:applicationFrame];
masterWindowHost = [[GlassMainView alloc] initWithFrame:CGRectMake(0.0, 0.0, applicationFrame.size.width, applicationFrame.size.height)];
mainWindow = [[GlassMainWindow alloc] initWithFrame:applicationFrame];
mainWindowHost = [[GlassMainView alloc] initWithFrame:CGRectMake(0.0, 0.0, applicationFrame.size.width, applicationFrame.size.height)];

// Set GlassViewController - responsible for orientation change, etc.
GlassViewController *rvc = [[GlassViewController alloc] init];
[rvc setView:masterWindowHost];
[masterWindow setRootViewController:rvc];
[rvc setView:mainWindowHost];
[mainWindow setRootViewController:rvc];
[rvc release];

[masterWindow setHidden:NO];
[masterWindowHost setHidden:NO];
[mainWindow setHidden:NO];
[mainWindowHost setHidden:NO];
} else {
masterWindow = [masterWindow retain];//increase retain count per each GlassWindow
masterWindowHost = [masterWindowHost retain];
mainWindow = [mainWindow retain];//increase retain count per each GlassWindow
mainWindowHost = [mainWindowHost retain];
}

[masterWindow setAutoresizesSubviews:YES];
[masterWindowHost setAutoresizesSubviews:NO];
[mainWindow setAutoresizesSubviews:YES];
[mainWindowHost setAutoresizesSubviews:NO];

[masterWindow makeKeyWindow];
[mainWindow makeKeyWindow];

GLASS_LOG("GlassWindow _1createWindow");
window = [[GlassWindow alloc] initWithScreen:screen jwindow:jWindow];
Expand All @@ -880,14 +880,14 @@ jlong _1createWindow(JNIEnv *env, jobject jWindow, jlong jOwnerPtr, jlong jScree
[window _setTransparent:NO];
}

[masterWindowHost addSubview:window];
[mainWindowHost addSubview:window];

if (jOwnerPtr != 0L)
{
GLASS_LOG("Adding %p window as usbview of owner window %lld", window, jOwnerPtr);
window->owner = (UIWindow*)jlong_to_ptr(jOwnerPtr);
} else {
NSArray *views = [masterWindowHost subviews];
NSArray *views = [mainWindowHost subviews];
// if there exists any secondary stage, its owner is primary stage internally if
// not set explicitly
if ([views count] > 1) {
Expand Down
8 changes: 4 additions & 4 deletions modules/javafx.web/src/ios/native/WebViewImpl.m
Expand Up @@ -62,8 +62,8 @@ jstring createJString(JNIEnv *env, NSString *nsStr) {

@implementation WebViewImpl

@synthesize window; //known as masterWindow in glass
@synthesize windowView; //known as masterWindowHost in glass
@synthesize window; //known as mainWindow in glass
@synthesize windowView; //known as mainWindowHost in glass

- (void)setWidth:(CGFloat)value {
width = value;
Expand Down Expand Up @@ -141,8 +141,8 @@ - (void) initWebViewImpl {
loadingLabel.textAlignment = UITextAlignmentCenter;
//[loadingLabel.layer setAnchorPoint:CGPointMake(0.0f, 0.0f)];

window = [self getWindow]; //known as masterWindow in glass
windowView = [[window rootViewController] view]; //known as masterWindowHost in glass
window = [self getWindow]; //known as mainWindow in glass
windowView = [[window rootViewController] view]; //known as mainWindowHost in glass
}

- (JNIEnv *)getJNIEnv {
Expand Down