https://bugs.webkit.org/show_bug.cgi?id=76485
Reviewed by Anders Carlsson.
Source/JavaScriptCore:
* wtf/Compiler.h:
Add OBJC_CLASS macro which helps reduce code when forward declaring an
objective-c class in a header which can be included from both Objective-C
and non-Objective-C files.
Source/WebCore:
* accessibility/AccessibilityObject.h:
* bindings/js/ScriptController.h:
* bridge/objc/objc_utility.h:
* page/DragClient.h:
* page/EditorClient.h:
* platform/AutodrainedPool.h:
* platform/ContextMenuItem.h:
* platform/Cursor.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/KURL.h:
* platform/Pasteboard.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformMenuDescription.h:
* platform/PlatformScreen.h:
* platform/SharedBuffer.h:
* platform/Widget.h:
* platform/cf/SchedulePair.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/FontPlatformData.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/Icon.h:
* platform/graphics/Image.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/mac/TileCache.h:
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerProxy.h:
* platform/mac/ClipboardMac.h:
* platform/mac/LocalCurrentGraphicsContext.h:
* platform/mac/PasteboardHelper.h:
* platform/mac/PopupMenuMac.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/WebCoreSystemInterface.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceRequest.h:
* platform/network/cf/ResourceResponse.h:
* rendering/RenderThemeMac.h:
Deploy OBJC_CLASS for a little code reduction.
Source/WebKit2:
* WebProcess/WebCoreSupport/WebDragClient.h:
Deploy OBJC_CLASS for a little code reduction.
* config.h:
Remove duplicate copy of OBJC_CLASS.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105203
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-17 Sam Weinig <sam@webkit.org>
+
+ Add helper macro for forward declaring objective-c classes
+ https://bugs.webkit.org/show_bug.cgi?id=76485
+
+ Reviewed by Anders Carlsson.
+
+ * wtf/Compiler.h:
+ Add OBJC_CLASS macro which helps reduce code when forward declaring an
+ objective-c class in a header which can be included from both Objective-C
+ and non-Objective-C files.
+
2012-01-17 Filip Pizlo <fpizlo@apple.com>
DFG should be able to do JS and custom getter caching
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define FINAL
#endif
+/* OBJC_CLASS */
+
+#ifndef OBJC_CLASS
+#ifdef __OBJC__
+#define OBJC_CLASS @class
+#else
+#define OBJC_CLASS class
+#endif
+#endif
+
#endif /* WTF_Compiler_h */
+2012-01-17 Sam Weinig <sam@webkit.org>
+
+ Add helper macro for forward declaring objective-c classes
+ https://bugs.webkit.org/show_bug.cgi?id=76485
+
+ Reviewed by Anders Carlsson.
+
+ * accessibility/AccessibilityObject.h:
+ * bindings/js/ScriptController.h:
+ * bridge/objc/objc_utility.h:
+ * page/DragClient.h:
+ * page/EditorClient.h:
+ * platform/AutodrainedPool.h:
+ * platform/ContextMenuItem.h:
+ * platform/Cursor.h:
+ * platform/DragData.h:
+ * platform/DragImage.h:
+ * platform/KURL.h:
+ * platform/Pasteboard.h:
+ * platform/PlatformKeyboardEvent.h:
+ * platform/PlatformMenuDescription.h:
+ * platform/PlatformScreen.h:
+ * platform/SharedBuffer.h:
+ * platform/Widget.h:
+ * platform/cf/SchedulePair.h:
+ * platform/graphics/BitmapImage.h:
+ * platform/graphics/FontPlatformData.h:
+ * platform/graphics/GraphicsContext3D.h:
+ * platform/graphics/GraphicsLayer.h:
+ * platform/graphics/Icon.h:
+ * platform/graphics/Image.h:
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+ * platform/graphics/ca/PlatformCAAnimation.h:
+ * platform/graphics/ca/mac/TileCache.h:
+ * platform/graphics/mac/ColorMac.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerProxy.h:
+ * platform/mac/ClipboardMac.h:
+ * platform/mac/LocalCurrentGraphicsContext.h:
+ * platform/mac/PasteboardHelper.h:
+ * platform/mac/PopupMenuMac.h:
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/network/ResourceHandle.h:
+ * platform/network/ResourceHandleClient.h:
+ * platform/network/ResourceHandleInternal.h:
+ * platform/network/cf/AuthenticationChallenge.h:
+ * platform/network/cf/ResourceError.h:
+ * platform/network/cf/ResourceRequest.h:
+ * platform/network/cf/ResourceResponse.h:
+ * rendering/RenderThemeMac.h:
+ Deploy OBJC_CLASS for a little code reduction.
+
2012-01-17 Andreas Kling <awesomekling@apple.com>
SpaceSplitString: Share equivalent string piece vectors.
#include "AccessibilityObjectWrapper.h"
#endif
+#if PLATFORM(MAC)
+
typedef struct _NSRange NSRange;
-#ifdef __OBJC__
-@class NSArray;
-@class NSAttributedString;
-@class NSData;
-@class NSMutableAttributedString;
-@class NSString;
-@class NSValue;
-@class NSView;
-@class WebAccessibilityObjectWrapper;
-#else
-class NSArray;
-class NSAttributedString;
-class NSData;
-class NSMutableAttributedString;
-class NSString;
-class NSValue;
-class NSView;
-#if PLATFORM(GTK)
+OBJC_CLASS NSArray;
+OBJC_CLASS NSAttributedString;
+OBJC_CLASS NSData;
+OBJC_CLASS NSMutableAttributedString;
+OBJC_CLASS NSString;
+OBJC_CLASS NSValue;
+OBJC_CLASS NSView;
+OBJC_CLASS WebAccessibilityObjectWrapper;
+
+typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper;
+
+#elif PLATFORM(GTK)
typedef struct _AtkObject AtkObject;
typedef struct _AtkObject AccessibilityObjectWrapper;
-#elif PLATFORM(MAC)
-class WebAccessibilityObjectWrapper;
#else
class AccessibilityObjectWrapper;
#endif
-#endif
-
-#if PLATFORM(MAC)
-typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper;
-#endif
namespace WebCore {
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-
-#ifdef __OBJC__
-@class WebScriptObject;
-#else
-class WebScriptObject;
-#endif
+OBJC_CLASS WebScriptObject;
#endif
struct NPObject;
#include <runtime/Error.h>
#include <runtime/JSObject.h>
-#ifdef __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
+OBJC_CLASS NSString;
namespace JSC {
namespace Bindings {
#include "IntPoint.h"
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class DOMElement;
-@class NSURL;
-@class NSString;
-@class NSPasteboard;
-#else
-class DOMElement;
-class NSURL;
-class NSString;
-class NSPasteboard;
-#endif
+OBJC_CLASS DOMElement;
+OBJC_CLASS NSURL;
+OBJC_CLASS NSString;
+OBJC_CLASS NSPasteboard;
#endif
namespace WebCore {
#include <wtf/Vector.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSAttributedString;
-@class NSPasteboard;
-@class NSString;
-@class NSURL;
-#else
-class NSAttributedString;
-class NSPasteboard;
-class NSString;
-class NSURL;
-#endif
+OBJC_CLASS NSAttributedString;
+OBJC_CLASS NSPasteboard;
+OBJC_CLASS NSString;
+OBJC_CLASS NSURL;
#endif
namespace WebCore {
#include <wtf/Noncopyable.h>
-#ifdef __OBJC__
-@class NSAutoreleasePool;
-#else
-class NSAutoreleasePool;
-#endif
+OBJC_CLASS NSAutoreleasePool;
namespace WebCore {
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-
-#ifdef __OBJC__
-@class NSMenuItem;
-#else
-class NSMenuItem;
-#endif
+OBJC_CLASS NSMenuItem;
#elif PLATFORM(WIN)
typedef struct tagMENUITEMINFOW MENUITEMINFO;
#elif PLATFORM(GTK)
#endif
#if PLATFORM(MAC) && !PLATFORM(IOS)
-#ifdef __OBJC__
-@class NSCursor;
-#else
-class NSCursor;
-#endif
+OBJC_CLASS NSCursor;
#endif
#if PLATFORM(WX)
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
+
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <AppKit/NSDragging.h>
typedef id <NSDraggingInfo> DragDataRef;
-@class NSPasteboard;
#else
typedef void* DragDataRef;
-class NSPasteboard;
#endif
+
+OBJC_CLASS NSPasteboard;
+
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QMimeData;
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSImage;
-#else
-class NSImage;
-#endif
+OBJC_CLASS NSImage;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPixmap;
#endif
#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
-#ifdef __OBJC__
-@class NSURL;
-#else
-class NSURL;
-#endif
+OBJC_CLASS NSURL;
#endif
#if PLATFORM(QT)
// knowledge of the frame and editor or moved into the editing directory.
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSFileWrapper;
-@class NSPasteboard;
-@class NSArray;
-#else
-class NSFileWrapper;
-class NSPasteboard;
-class NSArray;
-#endif
+OBJC_CLASS NSFileWrapper;
+OBJC_CLASS NSPasteboard;
+OBJC_CLASS NSArray;
#endif
#if PLATFORM(WIN)
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSEvent;
-#else
-class NSEvent;
-#endif
+OBJC_CLASS NSEvent;
#endif
#if PLATFORM(WIN)
#define PlatformMenuDescription_h
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSMutableArray;
-#else
-class NSMutableArray;
-#endif
+OBJC_CLASS NSMutableArray;
#elif PLATFORM(QT)
#include <qlist.h>
#elif PLATFORM(GTK)
#include <wtf/RefPtr.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
- @class NSScreen;
- @class NSWindow;
-#else
- class NSScreen;
- class NSWindow;
-#endif
+OBJC_CLASS NSScreen;
+OBJC_CLASS NSWindow;
#endif
typedef uint32_t PlatformDisplayID;
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#ifndef SharedBuffer_h
#define SharedBuffer_h
#endif
#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
-#ifdef __OBJC__
-@class NSData;
-#else
-class NSData;
-#endif
-
+OBJC_CLASS NSData;
#endif
namespace WebCore {
#endif
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSView;
-@class NSWindow;
-#else
-class NSView;
-class NSWindow;
-#endif
+OBJC_CLASS NSView;
+OBJC_CLASS NSWindow;
typedef NSView *PlatformWidget;
#endif
#include <wtf/RetainPtr.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSRunLoop;
-#else
-class NSRunLoop;
-#endif
+OBJC_CLASS NSRunLoop;
#endif
namespace WebCore {
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSImage;
-#else
-class NSImage;
-#endif
+OBJC_CLASS NSImage;
#endif
#if PLATFORM(WIN)
#endif
#if OS(DARWIN)
-#ifdef __OBJC__
-@class NSFont;
-#else
-class NSFont;
-#endif
+OBJC_CLASS NSFont;
typedef struct CGFont* CGFontRef;
typedef const struct __CTFont* CTFontRef;
#if PLATFORM(MAC)
#include <OpenGL/OpenGL.h>
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class CALayer;
-@class WebGLLayer;
-#else
-class CALayer;
-class WebGLLayer;
-#endif
+OBJC_CLASS CALayer;
+OBJC_CLASS WebGLLayer;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QPainter;
#include <wtf/PassOwnPtr.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class CALayer;
-#else
-class CALayer;
-#endif
+OBJC_CLASS CALayer;
typedef CALayer PlatformLayer;
#elif PLATFORM(WIN)
typedef struct _CACFLayer PlatformLayer;
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSImage;
-#else
-class NSImage;
-#endif
+OBJC_CLASS NSImage;
#elif PLATFORM(WIN)
typedef struct HICON__* HICON;
#elif PLATFORM(QT)
#include <wtf/text/WTFString.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSImage;
-#else
-class NSImage;
-#endif
+OBJC_CLASS NSImage;
#endif
#if USE(CG)
#include "GraphicsLayer.h"
#endif
-#ifdef __OBJC__
-@class AVPlayer;
-@class QTMovie;
-#else
-class AVPlayer;
-class QTMovie;
-#endif
+OBJC_CLASS AVPlayer;
+OBJC_CLASS QTMovie;
+
class AVCFPlayer;
class QTMovieGWorld;
class QTMovieVisualContext;
#include "MediaPlayerPrivateAVFoundation.h"
-#ifdef __OBJC__
-@class AVAsset;
-@class AVPlayer;
-@class AVPlayerItem;
-@class AVPlayerLayer;
-@class AVAssetImageGenerator;
-@class WebCoreAVFMovieObserver;
-#else
-class AVAsset;
-class AVPlayer;
-class AVPlayerItem;
-class AVPlayerLayer;
-class AVAssetImageGenerator;
-class WebCoreAVFMovieObserver;
+OBJC_CLASS AVAsset;
+OBJC_CLASS AVPlayer;
+OBJC_CLASS AVPlayerItem;
+OBJC_CLASS AVPlayerLayer;
+OBJC_CLASS AVAssetImageGenerator;
+OBJC_CLASS WebCoreAVFMovieObserver;
+
+#ifndef __OBJC__
typedef struct objc_object *id;
#endif
#include <wtf/Vector.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class CAPropertyAnimation;
-#else
-class CAPropertyAnimation;
-#endif
+OBJC_CLASS CAPropertyAnimation;
typedef CAPropertyAnimation* PlatformAnimationRef;
#elif PLATFORM(WIN)
typedef struct _CACFAnimation* CACFAnimationRef;
#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class CALayer;
-@class WebTileCacheLayer;
-@class WebTileLayer;
-#else
-class CALayer;
-class WebTileCacheLayer;
-class WebTileLayer;
-#endif
+OBJC_CLASS CALayer;
+OBJC_CLASS WebTileCacheLayer;
+OBJC_CLASS WebTileLayer;
namespace WebCore {
#include "Color.h"
-#ifdef __OBJC__
-@class NSColor;
-#else
-class NSColor;
-#endif
+OBJC_CLASS NSColor;
namespace WebCore {
#ifdef __OBJC__
#import <QTKit/QTTime.h>
-@class QTMovie;
-@class QTMovieView;
-@class QTMovieLayer;
-@class QTVideoRendererWebKitOnly;
-@class WebCoreMovieObserver;
#else
-class NSDictionary;
-class NSMutableDictionary;
-class QTMovie;
-class QTMovieView;
class QTTime;
-class QTMovieLayer;
-class QTVideoRendererWebKitOnly;
-class WebCoreMovieObserver;
#endif
+OBJC_CLASS NSDictionary;
+OBJC_CLASS NSMutableDictionary;
+OBJC_CLASS QTMovie;
+OBJC_CLASS QTMovieView;
+OBJC_CLASS QTMovieLayer;
+OBJC_CLASS QTVideoRendererWebKitOnly;
+OBJC_CLASS WebCoreMovieObserver;
+
#ifndef DRAW_FRAME_RATE
#define DRAW_FRAME_RATE 0
#endif
#ifndef MediaPlayerProxy_h
#define MediaPlayerProxy_h
-#ifdef __OBJC__
-@class WebMediaPlayerProxy;
-#else
-class WebMediaPlayerProxy;
-#endif
+OBJC_CLASS WebMediaPlayerProxy;
enum MediaPlayerProxyNotificationType {
#include "Clipboard.h"
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSImage;
-@class NSPasteboard;
-#else
-class NSImage;
-class NSPasteboard;
-#endif
+OBJC_CLASS NSImage;
+OBJC_CLASS NSPasteboard;
namespace WebCore {
#include "skia/ext/skia_utils_mac.h"
#endif
-#ifdef __OBJC__
-@class NSGraphicsContext;
-#else
-class NSGraphicsContext;
-#endif
+OBJC_CLASS NSGraphicsContext;
namespace WebCore {
#import <wtf/Forward.h>
-#ifdef __OBJC__
-@class DOMDocumentFragment;
-#else
-class DOMDocumentFragment;
-#endif
+OBJC_CLASS DOMDocumentFragment;
namespace WebCore {
#include <wtf/RefCounted.h>
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class NSPopUpButtonCell;
-#else
-class NSPopUpButtonCell;
-#endif
+OBJC_CLASS NSPopUpButtonCell;
namespace WebCore {
#include "Timer.h"
#include <wtf/RetainPtr.h>
-#ifdef __OBJC__
-@class WebScrollAnimationHelperDelegate;
-@class WebScrollbarPainterControllerDelegate;
-@class WebScrollbarPainterDelegate;
-#else
-class WebScrollAnimationHelperDelegate;
-class WebScrollbarPainterControllerDelegate;
-class WebScrollbarPainterDelegate;
-#endif
+OBJC_CLASS WebScrollAnimationHelperDelegate;
+OBJC_CLASS WebScrollbarPainterControllerDelegate;
+OBJC_CLASS WebScrollbarPainterDelegate;
typedef id ScrollbarPainterController;
typedef const struct _CFURLRequest* CFURLRequestRef;
#endif
-#ifdef __OBJC__
-@class AVAsset;
-@class NSArray;
-@class NSButtonCell;
-@class NSControl;
-@class NSCursor;
-@class NSData;
-@class NSDate;
-@class NSEvent;
-@class NSFont;
-@class NSHTTPCookie;
-@class NSImage;
-@class NSMenu;
-@class NSMutableURLRequest;
-@class NSString;
-@class NSTextFieldCell;
-@class NSURL;
-@class NSURLConnection;
-@class NSURLRequest;
-@class NSURLResponse;
-@class NSView;
-@class NSWindow;
-@class QTMovie;
-@class QTMovieView;
-#else
-class AVAsset;
-class NSArray;
-class NSButtonCell;
-class NSControl;
-class NSCursor;
-class NSData;
-class NSDate;
-class NSEvent;
-class NSFont;
-class NSHTTPCookie;
-class NSImage;
-class NSMenu;
-class NSMutableArray;
-class NSMutableURLRequest;
-class NSURL;
-class NSURLRequest;
-class NSString;
-class NSTextFieldCell;
-class NSURLConnection;
-class NSURLResponse;
-class NSView;
-class NSWindow;
-class QTMovie;
-class QTMovieView;
-#endif
+OBJC_CLASS AVAsset;
+OBJC_CLASS NSArray;
+OBJC_CLASS NSButtonCell;
+OBJC_CLASS NSControl;
+OBJC_CLASS NSCursor;
+OBJC_CLASS NSData;
+OBJC_CLASS NSDate;
+OBJC_CLASS NSEvent;
+OBJC_CLASS NSFont;
+OBJC_CLASS NSHTTPCookie;
+OBJC_CLASS NSImage;
+OBJC_CLASS NSMenu;
+OBJC_CLASS NSMutableURLRequest;
+OBJC_CLASS NSString;
+OBJC_CLASS NSTextFieldCell;
+OBJC_CLASS NSURL;
+OBJC_CLASS NSURLConnection;
+OBJC_CLASS NSURLRequest;
+OBJC_CLASS NSURLResponse;
+OBJC_CLASS NSView;
+OBJC_CLASS NSWindow;
+OBJC_CLASS QTMovie;
+OBJC_CLASS QTMovieView;
extern "C" {
#endif
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSData;
-@class NSError;
-@class NSURLConnection;
-@class WebCoreResourceHandleAsDelegate;
-#else
-class NSData;
-class NSError;
-class NSURLConnection;
-class WebCoreResourceHandleAsDelegate;
+OBJC_CLASS NSData;
+OBJC_CLASS NSError;
+OBJC_CLASS NSURLConnection;
+OBJC_CLASS WebCoreResourceHandleAsDelegate;
+#ifndef __OBJC__
typedef struct objc_object *id;
#endif
#endif
#endif
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSCachedURLResponse;
-#else
-class NSCachedURLResponse;
-#endif
+OBJC_CLASS NSCachedURLResponse;
#endif
namespace WebCore {
#endif
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSURLAuthenticationChallenge;
-@class NSURLConnection;
-#else
-class NSURLAuthenticationChallenge;
-class NSURLConnection;
-#endif
+OBJC_CLASS NSURLAuthenticationChallenge;
+OBJC_CLASS NSURLConnection;
#endif
// The allocations and releases in ResourceHandleInternal are
#include <wtf/RefPtr.h>
#if USE(CFNETWORK)
+
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
+
#else
+
#ifndef __OBJC__
typedef struct objc_object *id;
-class NSURLAuthenticationChallenge;
-#else
-@class NSURLAuthenticationChallenge;
#endif
+
+OBJC_CLASS NSURLAuthenticationChallenge;
+
#endif
namespace WebCore {
#include <wincrypt.h> // windows.h must be included before wincrypt.h.
#endif
-#ifdef __OBJC__
-@class NSError;
-#else
-class NSError;
+#if PLATFORM(MAC)
+OBJC_CLASS NSError;
#endif
namespace WebCore {
typedef const struct _CFURLRequest* CFURLRequestRef;
#endif
-#ifdef __OBJC__
-@class NSURLRequest;
-#else
-class NSURLRequest;
-#endif
+OBJC_CLASS NSURLRequest;
#if USE(CFURLSTORAGESESSIONS) && (defined(BUILDING_ON_SNOW_LEOPARD) || defined(BUILDING_ON_LEOPARD))
typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
typedef struct _CFURLResponse* CFURLResponseRef;
#endif
-#ifdef __OBJC__
-@class NSURLResponse;
-#else
-class NSURLResponse;
-#endif
+OBJC_CLASS NSURLResponse;
namespace WebCore {
#import <wtf/HashMap.h>
#import <wtf/RetainPtr.h>
-class RenderProgress;
-#ifdef __OBJC__
-@class WebCoreRenderThemeNotificationObserver;
-#else
-class WebCoreRenderThemeNotificationObserver;
-#endif
+OBJC_CLASS WebCoreRenderThemeNotificationObserver;
namespace WebCore {
+class RenderProgress;
class RenderStyle;
class RenderThemeMac : public RenderTheme {
+2012-01-17 Sam Weinig <sam@webkit.org>
+
+ Add helper macro for forward declaring objective-c classes
+ https://bugs.webkit.org/show_bug.cgi?id=76485
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebDragClient.h:
+ Deploy OBJC_CLASS for a little code reduction.
+
+ * config.h:
+ Remove duplicate copy of OBJC_CLASS.
+
2012-01-17 Martin Robinson <mrobinson@igalia.com>
[GTK] [WK2] WebKitPrivate should include the entire WebKit2 C API
#include <WebCore/DragClient.h>
#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class WKPasteboardFilePromiseOwner;
-@class WKPasteboardOwner;
-#else
-class WKPasteboardFilePromiseOwner;
-class WKPasteboardOwner;
-#endif
+OBJC_CLASS WKPasteboardFilePromiseOwner;
+OBJC_CLASS WKPasteboardOwner;
#endif
namespace WebKit {
#if PLATFORM(MAC)
-#ifdef __OBJC__
-#define OBJC_CLASS @class
-#else
-#define OBJC_CLASS class
-#endif
-
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#define ENABLE_WEB_PROCESS_SANDBOX 1
#endif