1 /* 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 14 * its contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #ifndef JAVASCRIPTGLUE_H 30 #define JAVASCRIPTGLUE_H 31 32 #ifndef __CORESERVICES__ 33 #include <CoreServices/CoreServices.h> 34 #endif 35 36 #ifndef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER 37 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER 38 #endif 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 /* typedefs/structs */ 45 typedef enum { 46 kJSFlagNone = 0, 47 kJSFlagDebug = 1 << 0, 48 kJSFlagConvertAssociativeArray = 1 << 1 /* associative arrays will be converted to dictionaries */ 49 } JSFlags; 50 51 typedef struct OpaqueJSTypeRef *JSTypeRef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 52 typedef JSTypeRef JSObjectRef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 53 typedef JSTypeRef JSRunRef DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 54 typedef CFTypeID JSTypeID DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 55 56 typedef void (*JSObjectDisposeProcPtr)(void *data) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 57 typedef CFArrayRef (*JSObjectCopyPropertyNamesProcPtr)(void *data) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 58 typedef JSObjectRef (*JSObjectCopyPropertyProcPtr)(void *data, CFStringRef propertyName) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 59 typedef void (*JSObjectSetPropertyProcPtr)(void *data, CFStringRef propertyName, JSObjectRef jsValue) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 60 typedef JSObjectRef (*JSObjectCallFunctionProcPtr)(void *data, JSObjectRef thisObj, CFArrayRef args) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 61 typedef CFTypeRef (*JSObjectCopyCFValueProcPtr)(void *data) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 62 typedef UInt8 (*JSObjectEqualProcPtr)(void *data1, void *data2) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 63 64 struct JSObjectCallBacks { 65 JSObjectDisposeProcPtr dispose; 66 JSObjectEqualProcPtr equal; 67 JSObjectCopyCFValueProcPtr copyCFValue; 68 JSObjectCopyPropertyProcPtr copyProperty; 69 JSObjectSetPropertyProcPtr setProperty; 70 JSObjectCallFunctionProcPtr callFunction; 71 JSObjectCopyPropertyNamesProcPtr copyPropertyNames; 72 } DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 73 74 typedef struct JSObjectCallBacks JSObjectCallBacks, *JSObjectCallBacksPtr DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 75 76 void JSSetCFNull(CFTypeRef nullRef) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 77 CFTypeRef JSGetCFNull(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 78 79 JSTypeRef JSRetain(JSTypeRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 80 void JSRelease(JSTypeRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 81 JSTypeID JSGetTypeID(JSTypeRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 82 CFIndex JSGetRetainCount(JSTypeRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 83 CFStringRef JSCopyDescription(JSTypeRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 84 UInt8 JSEqual(JSTypeRef ref1, JSTypeRef ref2) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 85 86 JSObjectRef JSObjectCreate(void *data, JSObjectCallBacksPtr callBacks) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 87 JSObjectRef JSObjectCreateWithCFType(CFTypeRef inRef) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 88 CFTypeRef JSObjectCopyCFValue(JSObjectRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 89 void *JSObjectGetData(JSObjectRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 90 91 CFArrayRef JSObjectCopyPropertyNames(JSObjectRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 92 JSObjectRef JSObjectCopyProperty(JSObjectRef ref, CFStringRef propertyName) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 93 void JSObjectSetProperty(JSObjectRef ref, CFStringRef propertyName, JSObjectRef value) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 94 JSObjectRef JSObjectCallFunction(JSObjectRef ref, JSObjectRef thisObj, CFArrayRef args) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 95 96 JSRunRef JSRunCreate(CFStringRef jsSource, JSFlags inFlags) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 97 CFStringRef JSRunCopySource(JSRunRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 98 JSObjectRef JSRunCopyGlobalObject(JSRunRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 99 JSObjectRef JSRunEvaluate(JSRunRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 100 bool JSRunCheckSyntax(JSRunRef ref) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 101 102 void JSCollect(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 103 104 void JSTypeGetCFArrayCallBacks(CFArrayCallBacks *outCallBacks) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 105 106 CFMutableArrayRef JSCreateCFArrayFromJSArray(CFArrayRef array) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 107 CFMutableArrayRef JSCreateJSArrayFromCFArray(CFArrayRef array) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 108 109 void JSLockInterpreter(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 110 void JSUnlockInterpreter(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER; 111 112 #ifdef __cplusplus 113 } 114 #endif 115 116 #endif 117