Grabbing events from a full-screen Carbon Window
Grabbing events from a full-screen Carbon Window
- Subject: Grabbing events from a full-screen Carbon Window
- From: "Douglas A. Welton" <email@hidden>
- Date: Mon, 15 Sep 2003 14:00:09 -0400
Yo all,
I have built a subclass of NSMovie to handle transitioning to/from Full
Screen playback. The single, new method that I added to the NSMovieView
class is listed below.
I use the QuickTime function BeginFullScreen() to initiate fullscreen mode.
That results in QuickTime passing a WindowRef back to me so that I can 3do
stuff2 to the window. After going into fullscreen mode, I use the WindowRef
to initialize a new NSWindow object, which now contains the playing movie.
My issues come about when I try to handle events from that new NSWindow.
Page 12 of the 3Integrating Carbon and Cocoa in Your Applications2 document
make my request seem like a no brainer...
What I want to do is to establish the same context menu (and eventually
other event handling) for my new window as already exist on the original
NSMovieView.
Does anyone see anything that I obviously doing wrong? Is my approach
bogus? Any/all suggestions will be appreciated.
later,
douglas
----
#import "el_MovieView.h"
@implementation el_MovieView
- (void) Set_Fullscreen_Mode: (BOOL) Activate
{
OSErr Return_Code;
long Fullscreen_Flags = fullScreenAllowEvents;
Movie Quicktime_Movie = [[self movie] QTMovie];
Rect Window_Bounds;
Rect Old_Window_Bounds;
RgnHandle Movie_Region;
Rect Work_Rectangle;
NSRect Movie_Rectangle;
Handle Movie_Rect_Handle = NewHandle (10 );
short m_right, m_bottom;
if ( Activate )
{
Return_Code = BeginFullScreen( &Restore_State,
NULL, 0, 0,
&Fullscreen_Window,
NULL,
Fullscreen_Flags );
GetMovieBox( Quicktime_Movie, &Old_Window_Bounds );
Movie_Region = GetMovieDisplayClipRgn( Quicktime_Movie );
SetMovieDisplayClipRgn( Quicktime_Movie, NULL );
GetMovieGWorld( Quicktime_Movie, &Old_GWorld, NULL);
New_GWorld = GetWindowPort( Fullscreen_Window );
SetMovieGWorld( Quicktime_Movie, New_GWorld, GetGWorldDevice(
New_GWorld ));
GetWindowPortBounds( Fullscreen_Window, &Window_Bounds );
SetMovieBox( Quicktime_Movie, &Window_Bounds );
Cocoa_Fullscreen_Window = [[[NSWindow alloc] initWithWindowRef:
Fullscreen_Window] retain];
// NSLog( @"Window Color %@", [Cocoa_Fullscreen_Window
backgroundColor] );
NSLog( @"Window level %i", [Cocoa_Fullscreen_Window level] );
NSLog( @"Window Frame %@",
NSStringFromRect([Cocoa_Fullscreen_Window frame]) );
NSLog( @"Content Frame %@",
NSStringFromRect([[Cocoa_Fullscreen_Window contentView] frame]) );
[[Cocoa_Fullscreen_Window contentView] setMenu: [self menu]];
}
else
{
SetMovieGWorld( Quicktime_Movie, Old_GWorld, NULL);
Return_Code = EndFullScreen( Restore_State, 0L );
SetMovieBox( Quicktime_Movie, &Old_Window_Bounds );
}
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.