WKBase.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /*
  2. * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  3. * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  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. *
  14. * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
  15. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  16. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  17. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
  18. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  19. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  20. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  21. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  22. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  23. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  24. * THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifndef WKBase_h
  27. #define WKBase_h
  28. #include <stdint.h>
  29. #if defined(BUILDING_GTK__)
  30. #include <WebKit2/WKBaseGtk.h>
  31. #endif
  32. #if defined(WTF_USE_SOUP)
  33. #include <WebKit2/WKBaseSoup.h>
  34. #endif
  35. #if defined(BUILDING_EFL__)
  36. #include <WebKit2/WKBaseEfl.h>
  37. #endif
  38. #if defined(__APPLE__) && !defined(BUILDING_QT__)
  39. #include <WebKit2/WKBaseMac.h>
  40. #endif
  41. #if defined(SN_TARGET_PSP2) || defined(__ORBIS__)
  42. #include <WebKit2/WKBaseManx.h>
  43. #endif
  44. /* WebKit2 shared types */
  45. typedef uint32_t WKTypeID;
  46. typedef const void* WKTypeRef;
  47. typedef const struct OpaqueWKArray* WKArrayRef;
  48. typedef struct OpaqueWKArray* WKMutableArrayRef;
  49. typedef const struct OpaqueWKDictionary* WKDictionaryRef;
  50. typedef struct OpaqueWKDictionary* WKMutableDictionaryRef;
  51. typedef const struct OpaqueWKBoolean* WKBooleanRef;
  52. typedef const struct OpaqueWKCertificateInfo* WKCertificateInfoRef;
  53. typedef const struct OpaqueWKConnection* WKConnectionRef;
  54. typedef const struct OpaqueWKContextMenuItem* WKContextMenuItemRef;
  55. typedef const struct OpaqueWKData* WKDataRef;
  56. typedef const struct OpaqueWKDouble* WKDoubleRef;
  57. typedef const struct OpaqueWKError* WKErrorRef;
  58. typedef const struct OpaqueWKGraphicsContext* WKGraphicsContextRef;
  59. typedef const struct OpaqueWKImage* WKImageRef;
  60. typedef const struct OpaqueWKPointRef* WKPointRef;
  61. typedef const struct OpaqueWKRectRef* WKRectRef;
  62. typedef const struct OpaqueWKRenderLayer* WKRenderLayerRef;
  63. typedef const struct OpaqueWKRenderObject* WKRenderObjectRef;
  64. typedef const struct OpaqueWKSecurityOrigin* WKSecurityOriginRef;
  65. typedef const struct OpaqueWKSerializedScriptValue* WKSerializedScriptValueRef;
  66. typedef const struct OpaqueWKSizeRef* WKSizeRef;
  67. typedef const struct OpaqueWKString* WKStringRef;
  68. typedef const struct OpaqueWKUInt64* WKUInt64Ref;
  69. typedef const struct OpaqueWKURL* WKURLRef;
  70. typedef const struct OpaqueWKURLRequest* WKURLRequestRef;
  71. typedef const struct OpaqueWKURLResponse* WKURLResponseRef;
  72. typedef const struct OpaqueWKUserContentURLPattern* WKUserContentURLPatternRef;
  73. typedef const struct OpaqueWKWebArchive* WKWebArchiveRef;
  74. typedef const struct OpaqueWKWebArchiveResource* WKWebArchiveResourceRef;
  75. enum WKUserContentInjectedFrames {
  76. kWKInjectInAllFrames,
  77. kWKInjectInTopFrameOnly
  78. };
  79. typedef enum WKUserContentInjectedFrames WKUserContentInjectedFrames;
  80. enum WKUserScriptInjectionTime {
  81. kWKInjectAtDocumentStart,
  82. kWKInjectAtDocumentEnd
  83. };
  84. typedef enum WKUserScriptInjectionTime WKUserScriptInjectionTime;
  85. /* WebKit2 main API types */
  86. typedef const struct OpaqueWKApplicationCacheManager* WKApplicationCacheManagerRef;
  87. typedef const struct OpaqueWKAuthenticationChallenge* WKAuthenticationChallengeRef;
  88. typedef const struct OpaqueWKAuthenticationDecisionListener* WKAuthenticationDecisionListenerRef;
  89. typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
  90. typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
  91. typedef const struct OpaqueWKBatteryManager* WKBatteryManagerRef;
  92. typedef const struct OpaqueWKBatteryStatus* WKBatteryStatusRef;
  93. typedef const struct OpaqueWKResourceCacheManager* WKResourceCacheManagerRef;
  94. typedef const struct OpaqueWKColorPickerResultListener* WKColorPickerResultListenerRef;
  95. typedef const struct OpaqueWKContext* WKContextRef;
  96. typedef const struct OpaqueWKCookieManager* WKCookieManagerRef;
  97. typedef const struct OpaqueWKCredential* WKCredentialRef;
  98. typedef const struct OpaqueWKDatabaseManager* WKDatabaseManagerRef;
  99. typedef const struct OpaqueWKDownload* WKDownloadRef;
  100. typedef const struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
  101. typedef const struct OpaqueWKFrame* WKFrameRef;
  102. typedef const struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
  103. typedef const struct OpaqueWKGeolocationManager* WKGeolocationManagerRef;
  104. typedef const struct OpaqueWKGeolocationPermissionRequest* WKGeolocationPermissionRequestRef;
  105. typedef const struct OpaqueWKGeolocationPosition* WKGeolocationPositionRef;
  106. typedef const struct OpaqueWKGrammarDetail* WKGrammarDetailRef;
  107. typedef const struct OpaqueWKHitTestResult* WKHitTestResultRef;
  108. typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef;
  109. typedef const struct OpaqueWKInspector* WKInspectorRef;
  110. typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef;
  111. typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef;
  112. typedef const struct OpaqueWKNavigationData* WKNavigationDataRef;
  113. typedef const struct OpaqueWKNetworkInfoManager* WKNetworkInfoManagerRef;
  114. typedef const struct OpaqueWKNetworkInfo* WKNetworkInfoRef;
  115. typedef const struct OpaqueWKNotification* WKNotificationRef;
  116. typedef const struct OpaqueWKNotificationManager* WKNotificationManagerRef;
  117. typedef const struct OpaqueWKNotificationPermissionRequest* WKNotificationPermissionRequestRef;
  118. typedef const struct OpaqueWKNotificationProvider* WKNotificationProviderRef;
  119. typedef const struct OpaqueWKOpenPanelParameters* WKOpenPanelParametersRef;
  120. typedef const struct OpaqueWKOpenPanelResultListener* WKOpenPanelResultListenerRef;
  121. typedef const struct OpaqueWKPage* WKPageRef;
  122. typedef const struct OpaqueWKPageGroup* WKPageGroupRef;
  123. typedef const struct OpaqueWKPluginSiteDataManager* WKPluginSiteDataManagerRef;
  124. typedef const struct OpaqueWKPreferences* WKPreferencesRef;
  125. typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
  126. typedef const struct OpaqueWKTextChecker* WKTextCheckerRef;
  127. typedef const struct OpaqueWKVibration* WKVibrationRef;
  128. typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef;
  129. /* WebKit2 Bundle types */
  130. typedef const struct OpaqueWKBundle* WKBundleRef;
  131. typedef const struct OpaqueWKBundleBackForwardList* WKBundleBackForwardListRef;
  132. typedef const struct OpaqueWKBundleBackForwardListItem* WKBundleBackForwardListItemRef;
  133. typedef const struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
  134. typedef const struct OpaqueWKBundleDOMWindowExtension* WKBundleDOMWindowExtensionRef;
  135. typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
  136. typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
  137. typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef;
  138. typedef const struct OpaqueWKBundleNavigationAction* WKBundleNavigationActionRef;
  139. typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
  140. typedef const struct OpaqueWKBundlePage* WKBundlePageRef;
  141. typedef const struct OpaqueWKBundlePageBanner* WKBundlePageBannerRef;
  142. typedef const struct OpaqueWKBundlePageGroup* WKBundlePageGroupRef;
  143. typedef const struct OpaqueWKBundlePageOverlay* WKBundlePageOverlayRef;
  144. typedef const struct OpaqueWKBundleRangeHandle* WKBundleRangeHandleRef;
  145. typedef const struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
  146. #undef WK_EXPORT
  147. #if defined(WK_NO_EXPORT)
  148. #define WK_EXPORT
  149. #elif defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC__)
  150. #define WK_EXPORT __attribute__((visibility("default")))
  151. #elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) || defined(__CC_ARM) || defined(__ARMCC__)
  152. #if BUILDING_WEBKIT
  153. #define WK_EXPORT __declspec(dllexport)
  154. #else
  155. #define WK_EXPORT __declspec(dllimport)
  156. #endif
  157. #else /* !defined(WK_NO_EXPORT) */
  158. #define WK_EXPORT
  159. #endif /* defined(WK_NO_EXPORT) */
  160. #if !defined(WK_INLINE)
  161. #if defined(__cplusplus)
  162. #define WK_INLINE static inline
  163. #elif defined(__GNUC__)
  164. #define WK_INLINE static __inline__
  165. #elif defined(__WIN32__)
  166. #define WK_INLINE static __inline
  167. #else
  168. #define WK_INLINE static
  169. #endif
  170. #endif /* !defined(WK_INLINE) */
  171. #endif /* WKBase_h */