Issues With JAWT_MacOSXDrawingSurfaceInfo
Issues With JAWT_MacOSXDrawingSurfaceInfo
- Subject: Issues With JAWT_MacOSXDrawingSurfaceInfo
- From: "Satisha A M." <email@hidden>
- Date: Thu, 9 Aug 2007 13:38:53 +0530
- Thread-topic: Issues With JAWT_MacOSXDrawingSurfaceInfo
Hello Group,
We have a standalone java application which (among other things) plays
Quicktime videos. On Mac, we were using QT for Java. We are now
replacing this with the native QuickTime framework APIs.
We require the media to play in a child window (java frame) of the main
window. We are facing some problem while getting the child window
reference from the Drawing Surface Information. Whatever the window
reference we are getting from the Drawing Surface Information is the
main window reference. If we set the port of this main window then our
movie start playing in the center of the window, instead of the place
where we actually want to play (centre of the frame, which is in a
corner of the window). The snippet of the code that we used to get the
window reference is below.
The code below works fine on Windows, but not on Mac. The only change in
the code is that in Mac we replaced JAWT_Win32DrawingSurfaceInfo
structure with JAWT_MacOSXDrawingSurfaceInfo structure and used some
Cocoa APIs to get the window reference. We checked if there are any
child window/sub views attached to the main window, but the APIs return
no child window and no sub views.
Is there a solution or workaround for this problem? Are there
alternative approaches in Mac to get the required child window
reference.
Code Snippet:
JAWT awt;
JAWT_DrawingSurface* ds;
JAWT_DrawingSurfaceInfo* dsi;
JAWT_MacOSXDrawingSurfaceInfo *dsi_mac;
jint lock;
/* Get the drawing surface */
ds = awt.GetDrawingSurface(env, canvas);
/* Lock the drawing surface */
lock = ds->Lock(ds);
/* Get the drawing surface info */
dsi = ds->GetDrawingSurfaceInfo(ds);
/* Get the platform-specific drawing info */
dsi_mac = new JAWT_MacOSXDrawingSurfaceInfo;
memset( dsi_mac, 0, sizeof(JAWT_MacOSXDrawingSurfaceInfo));
dsi_mac = (JAWT_MacOSXDrawingSurfaceInfo*)dsi->platformInfo;
NSView *view = dsi_mac->cocoaViewRef;
NSWindow *window = [view window];
WindowRef myWindowRef =(WindowRef) [window windowRef]; // Problem
is, here I am getting Main Window reference
delete dsi_mac;
Thanks in advance...
Satish
______________________________________________________________
DISCLAIMER:
This electronic message and any attachments to this electronic message is
intended for the exclusive use of the addressee(s) named herein and may contain
legally privileged and confidential information. It is the property of Celstream
Technologies Limited. If you are not the intended recipient, you are hereby
strictly notified not to copy, forward, distribute or use this message or any
attachments thereto. If you have received this message in error, please delete
it and all copies thereof, from your system and notify the sender at Celstream
Technologies or email@hidden, immediately.
__________________________________________________________
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden