Mac: Fix 10.6 SDK compile errors due to delegate protocol requirement.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@287 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-09-16 16:17:19 +00:00
parent 44946a7752
commit a412f079d7
3 changed files with 42 additions and 3 deletions

View File

@ -40,9 +40,13 @@
// Use the existing CrAppProtocol definition.
#include "base/message_pump_mac.h"
// Use the existing empty protocol definitions.
#import "base/mac/cocoa_protocols.h"
#else // BUILDING_CEF_SHARED
#import <AppKit/AppKit.h>
#import <Cocoa/Cocoa.h>
// Copy of CrAppProtocol definition from base/message_pump_mac.h.
@protocol CrAppProtocol
@ -50,6 +54,40 @@
- (BOOL)isHandlingSendEvent;
@end
// The Mac OS X 10.6 SDK introduced new protocols used for delegates. These
// protocol defintions were not present in earlier releases of the Mac OS X
// SDK. In order to support building against the new SDK, which requires
// delegates to conform to these protocols, and earlier SDKs, which do not
// define these protocols at all, this file will provide empty protocol
// definitions when used with earlier SDK versions.
#if !defined(MAC_OS_X_VERSION_10_6) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
#define DEFINE_EMPTY_PROTOCOL(p) \
@protocol p \
@end
DEFINE_EMPTY_PROTOCOL(NSAlertDelegate)
DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate)
DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate)
DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate)
DEFINE_EMPTY_PROTOCOL(NSMenuDelegate)
DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate)
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource)
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate)
DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate)
DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate)
DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource)
DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate)
DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate)
DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate)
DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
#undef DEFINE_EMPTY_PROTOCOL
#endif
#endif // BUILDING_CEF_SHARED
// All CEF client applications must subclass NSApplication and implement this