full screen option for enterFullScreenMode:withOptions:

I tried to make a PDFView full screen for a few days.
NSView document doesn’t explain much about the options. They ARE mentioned in the document, but couldn’t figure out what they are and how to use them.

As usual, by trying this and that, I found out a few things.

NSFullScreenModeSetting
Key whose corresponding value specifies the the full screen mode setting.
The corresponding value is an instance of NSDictionary that contains keys specified in Display Mode Standard Properties and Display Mode Optional Properties in Quartz Display Services Reference.
When the NSFullScreenModeApplicationPresentationOptions is specified in the options dictionary specifying this option as well will cause an exception.

NSFullScreenModeWindowLevel
Key whose corresponding value specifies the screen mode window level.
The corresponding value is an instance of NSNumber containing an integer value.

First, for the 1st option, it sounds like that Display Mode Standard Properties and Display Mode Optional Properties can be used. So, the Quartz document has a list of keys and their values.
However, in a sample code, Plasma Exhibits!, it is written as follows :

- (void) initOpenGLFullScreen
{
    fullScreenOptions = [[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
				                     forKey:NSFullScreenModeSetting] retain];

    fullScreen = [[NSScreen mainScreen] retain];
} // initOpenGLFullScreen

- (void) fullScreenEnable
{
    [self enterFullScreenMode:fullScreen
                  withOptions:fullScreenOptions];
} // enableFullScreen

- (void) fullScreenDisable
{
    [self exitFullScreenModeWithOptions:fullScreenOptions];
} // disableFullScreen

So, the fullScreenOptions is just an NSNumber representation of YES for a key NSFullScreenModeSetting.
According to the document, the value should be an NSDictionary of the Quartz option, not the simple boolean value. I’m not sure if Apple’s document is wrong or just misses this simple case.

For the second case, I tried kCGMainMenuWindowLevelKey – 1.
However, when it is used, an NSView child class couldn’t handle mouseDown: message.

How to make a view a full screen was changed recently ( from Mac OS X 10.5 ). Only NSWindow could be in full screen mode previously, but now enterFullScreenMode: can be sent to NSView also now.
So, I believe its documentation is not fully prepared yet and different implementation for pre-10.5 should be written.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: