From 627083adaf1b38c17f42c72650c47103f17313ce Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 20 Oct 2011 20:52:46 +0200 Subject: NEWT/OSX: Attempt to stabilize native parenting (ie w/ AWT) ; Add windowRepaint() callback - act on positionChanged(..) only for realized windows, otherwise we could end in an AWT deadlock (AWT parent window). - add view parenting calls (addSubView/removeFromSuperview) - attachToParent after view configuration - allow concurrently view draw - add windowRepaint() callback (native -> java) - add more debug tracing --- src/newt/native/NewtMacWindow.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/newt/native/NewtMacWindow.h') diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h index 648b68275..e649fdb13 100644 --- a/src/newt/native/NewtMacWindow.h +++ b/src/newt/native/NewtMacWindow.h @@ -80,6 +80,10 @@ - (void) rightMouseDown: (NSEvent*) theEvent; - (void) resetCursorRects; +- (void) viewWillDraw; +- (void) drawRect:(NSRect)dirtyRect; +- (void) viewDidHide; +- (void) viewDidUnhide; - (BOOL) acceptsFirstResponder; @end @@ -101,6 +105,16 @@ + (BOOL) initNatives: (JNIEnv*) env forClass: (jobject) clazz; +- (id) initWithContentRect: (NSRect) contentRect + styleMask: (NSUInteger) windowStyle + backing: (NSBackingStoreType) bufferingType + defer: (BOOL) deferCreation + screen:(NSScreen *)screen; + +- (void) updateInsets: (JNIEnv*) env; +- (void) attachToParent: (NSWindow*) parent; +- (void) detachFromParent: (NSWindow*) parent; + - (NSPoint) newtScreenWinPos2OSXScreenPos: (NSPoint) p; - (NSPoint) newtClientWinPos2OSXScreenPos: (NSPoint) p; - (NSPoint) getLocationOnScreen: (NSPoint) p; @@ -111,8 +125,6 @@ - (void) setMouseConfined:(BOOL)v; - (void) setMousePosition:(NSPoint)p; -- (void) updateInsets: (JNIEnv*) env; - - (BOOL) becomeFirstResponder; - (BOOL) resignFirstResponder; - (void) becomeKeyWindow; @@ -122,10 +134,4 @@ - (void) windowDidResignKey: (NSNotification *) notification; - (void) sendFocusLost; -- (id) initWithContentRect: (NSRect) contentRect - styleMask: (NSUInteger) windowStyle - backing: (NSBackingStoreType) bufferingType - defer: (BOOL) deferCreation - screen:(NSScreen *)screen; - @end -- cgit v1.2.3