VBoxIChatTheaterWrapper.m revision e64031e20c39650a7bc902a3e1aba613b9415dee
/* $Id$ */
/** @file
* Qt GUI - iChat Theater cocoa wrapper.
*/
/*
* Copyright (C) 2008 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/* System includes */
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import <InstantMessage/IMService.h>
#import <InstantMessage/IMAVManager.h>
{
}
@end
{
/* Register for notifications of the av manager */
return self;
}
- (void)dealloc
{
[super dealloc];
}
{
}
{
/* Return 32 bit pixel format */
}
{
return NO;
// Lock the pixel buffer's base address so that we can draw into it.
{
// Rarely is a lock refused. Return NO if this happens.
printf ("Warning: could not lock pixel buffer base address in %s - error %ld\n", __func__, (long)err);
return NO;
}
8,
/* Clear background */
/* Center image */
int scaledWidth;
int scaledHeight;
if (aspect > 1.0)
{
scaledWidth = width;
}
else
{
}
/* Here we have to paint the context*/
/* Finished painting */
return YES;
}
{
/* Get the new state */
if (state == IMAVRequested)
{
/* Set some properties on the av manager */
/* Possible values: IMVideoOptimizationDefault, IMVideoOptimizationStills, IMVideoOptimizationReplacement */
/* ToDo: Audio support */
/* Start the streaming of the video */
}
else if (state == IMAVInactive)
{
/* Stop the content propagation */
}
}
@end
void initSharedAVManager ()
{
/* Some other debug tests */
/*
NSProcessInfo *pi = [NSProcessInfo processInfo];
[pi setProcessName:@"My new processName"];
OSErr err;
ProcessSerialNumber PSN;
err = GetCurrentProcess (&PSN);
err = CPSSetProcessName (&PSN,"Evil");
err = CPSEnableForegroundOperation (&PSN,0x03,0x3C,0x2C,0x1103);
err = CPSSetFrontProcess (&PSN);
*/
if (!sharedAVHandler)
}
{
}
#endif /* VBOX_WITH_ICHAT_THEATER */