├── README.md ├── example ├── .DS_Store ├── WebView.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── borg.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── WebView Debug.xcscheme │ │ │ └── WebView Release.xcscheme │ └── xcuserdata │ │ └── borg.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── src │ ├── main.mm │ ├── ofApp.h │ └── ofApp.mm ├── screenshot.jpg └── src ├── ofxWebView.h └── ofxWebView.mm /README.md: -------------------------------------------------------------------------------- 1 | # ofxWebView 2 | 3 | Example of using Cocoa webkit view in oF 4 | 5 | Remeber to add WebKit 6 | 7 | OSX only. 8 | 9 | Test was successful but some font rendering artifacts (glow) visible in some situations. On the whole pretty super useful for extacting html layouts into ofTextures. 10 | 11 | Based on this comment by @admsyn 12 | http://forum.openframeworks.cc/t/using-cef-with-of/18094/15 13 | 14 | 15 | ![Screenshot](screenshot.jpg) -------------------------------------------------------------------------------- /example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/borg/ofxWebView/e70cd2c6677a25383d2aeb8527dec29f28fbcf32/example/.DS_Store -------------------------------------------------------------------------------- /example/WebView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 877BC0681AD31099002CF4DF /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 877BC0671AD31099002CF4DF /* WebKit.framework */; }; 11 | 877BC0711AD331A1002CF4DF /* ofxWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 877BC06F1AD331A1002CF4DF /* ofxWebView.mm */; }; 12 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 13 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 14 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 15 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 16 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 17 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 18 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 19 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 20 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 21 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 22 | E4B69E200A3A1BDC003C02F2 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.mm */; }; 23 | E4B69E210A3A1BDC003C02F2 /* ofApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.mm */; }; 24 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 25 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 26 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 27 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 28 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 29 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 30 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 39 | remoteInfo = openFrameworks; 40 | }; 41 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 44 | proxyType = 1; 45 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 46 | remoteInfo = openFrameworks; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXCopyFilesBuildPhase section */ 51 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 52 | isa = PBXCopyFilesBuildPhase; 53 | buildActionMask = 2147483647; 54 | dstPath = ""; 55 | dstSubfolderSpec = 10; 56 | files = ( 57 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXCopyFilesBuildPhase section */ 62 | 63 | /* Begin PBXFileReference section */ 64 | 877BC0671AD31099002CF4DF /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 65 | 877BC06F1AD331A1002CF4DF /* ofxWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ofxWebView.mm; sourceTree = ""; }; 66 | 877BC0701AD331A1002CF4DF /* ofxWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxWebView.h; sourceTree = ""; }; 67 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 68 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 69 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 70 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 71 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 72 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 73 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 74 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 75 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 76 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 77 | E4B69B5B0A3A1756003C02F2 /* WebViewDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebViewDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | E4B69E1D0A3A1BDC003C02F2 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = main.mm; path = src/main.mm; sourceTree = SOURCE_ROOT; }; 79 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; name = ofApp.mm; path = src/ofApp.mm; sourceTree = SOURCE_ROOT; }; 80 | E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; }; 81 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 82 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 83 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 84 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 85 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 86 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 87 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 88 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 89 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | 877BC0681AD31099002CF4DF /* WebKit.framework in Frameworks */, 98 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */, 99 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 100 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 101 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 102 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 103 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 104 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 105 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 106 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 107 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 108 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 109 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 110 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 111 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 112 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 113 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | /* End PBXFrameworksBuildPhase section */ 118 | 119 | /* Begin PBXGroup section */ 120 | 877BC06C1AD3318B002CF4DF /* ofxWebview */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 877BC06D1AD3318B002CF4DF /* example */, 124 | 877BC06E1AD3318B002CF4DF /* src */, 125 | ); 126 | name = ofxWebview; 127 | path = ../../../addons/ofxWebview; 128 | sourceTree = ""; 129 | }; 130 | 877BC06D1AD3318B002CF4DF /* example */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | ); 134 | path = example; 135 | sourceTree = ""; 136 | }; 137 | 877BC06E1AD3318B002CF4DF /* src */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 877BC06F1AD331A1002CF4DF /* ofxWebView.mm */, 141 | 877BC0701AD331A1002CF4DF /* ofxWebView.h */, 142 | ); 143 | path = src; 144 | sourceTree = ""; 145 | }; 146 | BB4B014C10F69532006C3DED /* addons */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 877BC06C1AD3318B002CF4DF /* ofxWebview */, 150 | ); 151 | name = addons; 152 | sourceTree = ""; 153 | }; 154 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | E7F985F515E0DE99003869B5 /* Accelerate.framework */, 158 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 159 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 160 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 161 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 162 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 163 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 164 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 165 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 166 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 167 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 168 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 169 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 170 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 171 | ); 172 | name = "system frameworks"; 173 | sourceTree = ""; 174 | }; 175 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 179 | ); 180 | name = "3rd party frameworks"; 181 | sourceTree = ""; 182 | }; 183 | E4328144138ABC890047C5CB /* Products */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 187 | ); 188 | name = Products; 189 | sourceTree = ""; 190 | }; 191 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 195 | BBAB23C913894ECA00AA2426 /* system frameworks */, 196 | ); 197 | name = frameworks; 198 | sourceTree = ""; 199 | }; 200 | E4B69B4A0A3A1720003C02F2 = { 201 | isa = PBXGroup; 202 | children = ( 203 | 877BC0671AD31099002CF4DF /* WebKit.framework */, 204 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 205 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 206 | E4B69E1C0A3A1BDC003C02F2 /* src */, 207 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 208 | BB4B014C10F69532006C3DED /* addons */, 209 | E45BE5980E8CC70C009D7055 /* frameworks */, 210 | E4B69B5B0A3A1756003C02F2 /* WebViewDebug.app */, 211 | ); 212 | sourceTree = ""; 213 | }; 214 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | E4B69E1D0A3A1BDC003C02F2 /* main.mm */, 218 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.mm */, 219 | E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */, 220 | ); 221 | path = src; 222 | sourceTree = SOURCE_ROOT; 223 | }; 224 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 228 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 229 | ); 230 | name = openFrameworks; 231 | sourceTree = ""; 232 | }; 233 | /* End PBXGroup section */ 234 | 235 | /* Begin PBXNativeTarget section */ 236 | E4B69B5A0A3A1756003C02F2 /* WebView */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "WebView" */; 239 | buildPhases = ( 240 | E4B69B580A3A1756003C02F2 /* Sources */, 241 | E4B69B590A3A1756003C02F2 /* Frameworks */, 242 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 243 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 249 | ); 250 | name = WebView; 251 | productName = myOFApp; 252 | productReference = E4B69B5B0A3A1756003C02F2 /* WebViewDebug.app */; 253 | productType = "com.apple.product-type.application"; 254 | }; 255 | /* End PBXNativeTarget section */ 256 | 257 | /* Begin PBXProject section */ 258 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 259 | isa = PBXProject; 260 | attributes = { 261 | LastUpgradeCheck = 0460; 262 | }; 263 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "WebView" */; 264 | compatibilityVersion = "Xcode 3.2"; 265 | developmentRegion = English; 266 | hasScannedForEncodings = 0; 267 | knownRegions = ( 268 | English, 269 | Japanese, 270 | French, 271 | German, 272 | ); 273 | mainGroup = E4B69B4A0A3A1720003C02F2; 274 | productRefGroup = E4B69B4A0A3A1720003C02F2; 275 | projectDirPath = ""; 276 | projectReferences = ( 277 | { 278 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 279 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 280 | }, 281 | ); 282 | projectRoot = ""; 283 | targets = ( 284 | E4B69B5A0A3A1756003C02F2 /* WebView */, 285 | ); 286 | }; 287 | /* End PBXProject section */ 288 | 289 | /* Begin PBXReferenceProxy section */ 290 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 291 | isa = PBXReferenceProxy; 292 | fileType = archive.ar; 293 | path = openFrameworksDebug.a; 294 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 295 | sourceTree = BUILT_PRODUCTS_DIR; 296 | }; 297 | /* End PBXReferenceProxy section */ 298 | 299 | /* Begin PBXShellScriptBuildPhase section */ 300 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | ); 307 | outputPaths = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\ncp -f \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n"; 312 | }; 313 | /* End PBXShellScriptBuildPhase section */ 314 | 315 | /* Begin PBXSourcesBuildPhase section */ 316 | E4B69B580A3A1756003C02F2 /* Sources */ = { 317 | isa = PBXSourcesBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | E4B69E200A3A1BDC003C02F2 /* main.mm in Sources */, 321 | 877BC0711AD331A1002CF4DF /* ofxWebView.mm in Sources */, 322 | E4B69E210A3A1BDC003C02F2 /* ofApp.mm in Sources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | /* End PBXSourcesBuildPhase section */ 327 | 328 | /* Begin PBXTargetDependency section */ 329 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 330 | isa = PBXTargetDependency; 331 | name = openFrameworks; 332 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 333 | }; 334 | /* End PBXTargetDependency section */ 335 | 336 | /* Begin XCBuildConfiguration section */ 337 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 338 | isa = XCBuildConfiguration; 339 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 340 | buildSettings = { 341 | ARCHS = "$(NATIVE_ARCH)"; 342 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 343 | COPY_PHASE_STRIP = NO; 344 | DEAD_CODE_STRIPPING = YES; 345 | GCC_AUTO_VECTORIZATION = YES; 346 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 347 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 348 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 349 | GCC_OPTIMIZATION_LEVEL = 0; 350 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 351 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 352 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 353 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 354 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 355 | GCC_WARN_UNUSED_VALUE = NO; 356 | GCC_WARN_UNUSED_VARIABLE = NO; 357 | MACOSX_DEPLOYMENT_TARGET = 10.6; 358 | OTHER_CPLUSPLUSFLAGS = ( 359 | "-D__MACOSX_CORE__", 360 | "-lpthread", 361 | "-mtune=native", 362 | ); 363 | SDKROOT = macosx; 364 | }; 365 | name = Debug; 366 | }; 367 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 370 | buildSettings = { 371 | ARCHS = "$(NATIVE_ARCH)"; 372 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 373 | COPY_PHASE_STRIP = YES; 374 | DEAD_CODE_STRIPPING = YES; 375 | GCC_AUTO_VECTORIZATION = YES; 376 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 377 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 378 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 379 | GCC_OPTIMIZATION_LEVEL = 3; 380 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 381 | GCC_UNROLL_LOOPS = YES; 382 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 383 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 384 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 385 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 386 | GCC_WARN_UNUSED_VALUE = NO; 387 | GCC_WARN_UNUSED_VARIABLE = NO; 388 | MACOSX_DEPLOYMENT_TARGET = 10.6; 389 | OTHER_CPLUSPLUSFLAGS = ( 390 | "-D__MACOSX_CORE__", 391 | "-lpthread", 392 | "-mtune=native", 393 | ); 394 | SDKROOT = macosx; 395 | }; 396 | name = Release; 397 | }; 398 | E4B69B600A3A1757003C02F2 /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | COMBINE_HIDPI_IMAGES = YES; 402 | COPY_PHASE_STRIP = NO; 403 | FRAMEWORK_SEARCH_PATHS = ( 404 | "$(inherited)", 405 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 406 | ); 407 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 410 | GCC_MODEL_TUNING = NONE; 411 | ICON = "$(ICON_NAME_DEBUG)"; 412 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 413 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 414 | INSTALL_PATH = "$(HOME)/Applications"; 415 | LIBRARY_SEARCH_PATHS = ( 416 | "$(inherited)", 417 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 418 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 419 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 420 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 421 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 422 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 423 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 424 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 425 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 426 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 427 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 428 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 429 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 430 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 431 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 432 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 433 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 434 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 435 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 436 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 437 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 438 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 439 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 440 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 441 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 442 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 443 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 444 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 445 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 478 | ); 479 | PRODUCT_NAME = "$(TARGET_NAME)Debug"; 480 | WRAPPER_EXTENSION = app; 481 | }; 482 | name = Debug; 483 | }; 484 | E4B69B610A3A1757003C02F2 /* Release */ = { 485 | isa = XCBuildConfiguration; 486 | buildSettings = { 487 | COMBINE_HIDPI_IMAGES = YES; 488 | COPY_PHASE_STRIP = YES; 489 | FRAMEWORK_SEARCH_PATHS = ( 490 | "$(inherited)", 491 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 492 | ); 493 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 494 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 495 | GCC_MODEL_TUNING = NONE; 496 | ICON = "$(ICON_NAME_RELEASE)"; 497 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 498 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 499 | INSTALL_PATH = "$(HOME)/Applications"; 500 | LIBRARY_SEARCH_PATHS = ( 501 | "$(inherited)", 502 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 503 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 504 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 505 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 506 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 507 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 508 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 509 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 510 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 511 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 512 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 513 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 514 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 515 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 516 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 517 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 518 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 519 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 520 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 521 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 522 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 523 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 524 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 525 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 526 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 527 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 528 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 563 | ); 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | WRAPPER_EXTENSION = app; 566 | }; 567 | name = Release; 568 | }; 569 | /* End XCBuildConfiguration section */ 570 | 571 | /* Begin XCConfigurationList section */ 572 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "WebView" */ = { 573 | isa = XCConfigurationList; 574 | buildConfigurations = ( 575 | E4B69B4E0A3A1720003C02F2 /* Debug */, 576 | E4B69B4F0A3A1720003C02F2 /* Release */, 577 | ); 578 | defaultConfigurationIsVisible = 0; 579 | defaultConfigurationName = Release; 580 | }; 581 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "WebView" */ = { 582 | isa = XCConfigurationList; 583 | buildConfigurations = ( 584 | E4B69B600A3A1757003C02F2 /* Debug */, 585 | E4B69B610A3A1757003C02F2 /* Release */, 586 | ); 587 | defaultConfigurationIsVisible = 0; 588 | defaultConfigurationName = Release; 589 | }; 590 | /* End XCConfigurationList section */ 591 | }; 592 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 593 | } 594 | -------------------------------------------------------------------------------- /example/WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/WebView.xcodeproj/project.xcworkspace/xcuserdata/borg.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/borg/ofxWebView/e70cd2c6677a25383d2aeb8527dec29f28fbcf32/example/WebView.xcodeproj/project.xcworkspace/xcuserdata/borg.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /example/WebView.xcodeproj/xcshareddata/xcschemes/WebView Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /example/WebView.xcodeproj/xcshareddata/xcschemes/WebView Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /example/WebView.xcodeproj/xcuserdata/borg.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SuppressBuildableAutocreation 6 | 7 | E4B69B5A0A3A1756003C02F2 8 | 9 | primary 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /example/src/main.mm: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | #include "ofxWebView.h" 6 | 7 | 8 | 9 | 10 | class ofApp : public ofBaseApp{ 11 | 12 | public: 13 | void setup(); 14 | void update(); 15 | void draw(); 16 | 17 | void keyPressed(int key); 18 | void keyReleased(int key); 19 | void mouseMoved(int x, int y ); 20 | void mouseDragged(int x, int y, int button); 21 | void mousePressed(int x, int y, int button); 22 | void mouseReleased(int x, int y, int button); 23 | void windowResized(int w, int h); 24 | void dragEvent(ofDragInfo dragInfo); 25 | void gotMessage(ofMessage msg); 26 | 27 | 28 | void onPageLoad(WebViewEvent &e); 29 | 30 | ofxWebView webView; 31 | 32 | 33 | ofPoint startPos; 34 | 35 | 36 | ofTexture *bg; 37 | 38 | bool autoRefresh; 39 | 40 | }; 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/src/ofApp.mm: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | /* 4 | Very important. 5 | Make sure to set the Type of this file to Cobjective-C++ Source in the Xcode 6 | Identity and Type inspector over here ----------------------------------------------------------> 7 | Also rename cpp to mm and add WebKit framework 8 | */ 9 | 10 | 11 | //-------------------------------------------------------------- 12 | void ofApp::setup(){ 13 | 14 | ofSetFrameRate(60); 15 | 16 | 17 | ofEnableSmoothing(); 18 | ofEnableAlphaBlending(); 19 | 20 | 21 | 22 | //loading a web URL: 23 | int margin = 0; 24 | webView.setSize(ofGetWidth()/2-margin*2,ofGetHeight()-margin*2); 25 | webView.setPosition(margin,margin); 26 | 27 | ofAddListener(webView.LOAD_URL,this,&ofApp::onPageLoad); 28 | 29 | //doesn't seem to support WebGL 30 | //webView.loadURL("http://threejs.org/examples/#webgl_buffergeometry_rawshader"); 31 | //webView.loadURL("http://localprojects.net"); 32 | webView.loadURL("http://crea.tion.to/"); 33 | 34 | bg = 0; 35 | bg = new ofTexture(); 36 | bg->allocate(webView.getWidth(),webView.getHeight(),GL_RGBA); 37 | bg->clear(); 38 | 39 | 40 | autoRefresh = 0; 41 | 42 | } 43 | 44 | void ofApp::onPageLoad(WebViewEvent &e){ 45 | cout<<"This stuff is being loaded now "<draw(ofGetWidth()/2,webView.getY(),webView.getWidth(),webView.getHeight()); 71 | }else{ 72 | ofDrawBitmapString("Press space to capture browser view as texture", ofGetWidth()/2+10,10); 73 | } 74 | 75 | ofSetWindowTitle(ofToString((int)ofGetFrameRate())); 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::keyPressed(int key){ 80 | if(key ==' '){ 81 | if(bg){ 82 | bg->clear(); 83 | } 84 | webView.toTexture(bg); 85 | } 86 | 87 | if(key=='l'){ 88 | string htm = "Lorem ipsum yada yada"; 89 | webView.setHTML(htm); 90 | } 91 | 92 | if(key == 'f'){ 93 | ofToggleFullscreen(); 94 | } 95 | 96 | if(key =='b'){ 97 | webView.setDrawsBackground( !webView.getDrawBackground()); 98 | } 99 | 100 | if(key == 'r'){ 101 | webView.loadURL("http://localprojects.net"); 102 | } 103 | 104 | if(key =='a'){ 105 | autoRefresh = !autoRefresh; 106 | } 107 | } 108 | 109 | //-------------------------------------------------------------- 110 | void ofApp::keyReleased(int key){ 111 | 112 | } 113 | 114 | //-------------------------------------------------------------- 115 | void ofApp::mouseMoved(int x, int y ){ 116 | 117 | } 118 | 119 | //-------------------------------------------------------------- 120 | void ofApp::mouseDragged(int x, int y, int button){ 121 | 122 | } 123 | 124 | //-------------------------------------------------------------- 125 | void ofApp::mousePressed(int x, int y, int button){ 126 | //startPos.set(x,y); 127 | } 128 | 129 | //-------------------------------------------------------------- 130 | void ofApp::mouseReleased(int x, int y, int button){ 131 | 132 | //ofRectangle r(startPos.x,startPos.y,x,y); 133 | //setWebViewFrame(r); 134 | } 135 | 136 | //-------------------------------------------------------------- 137 | void ofApp::windowResized(int w, int h){ 138 | 139 | } 140 | 141 | //-------------------------------------------------------------- 142 | void ofApp::gotMessage(ofMessage msg){ 143 | cout<<"ofApp::gotMessage "< 25 | #import 26 | 27 | 28 | 29 | 30 | class WebViewEvent : public ofEventArgs { 31 | 32 | public: 33 | 34 | WebViewEvent(){}; 35 | string URL; 36 | 37 | }; 38 | 39 | 40 | 41 | 42 | 43 | class ofxWebView : public ofRectangle { 44 | 45 | public: 46 | 47 | ofxWebView(); 48 | ~ofxWebView(); 49 | 50 | 51 | void loadURL(string url); 52 | void loadFile(string file, bool relativeToData = true);//local html 53 | void setHTML(string htm,string base=""); 54 | 55 | void toTexture(ofTexture *tex); 56 | 57 | void setSize(int w, int h); 58 | ofRectangle getSize(); 59 | void setPosition(int x, int y); 60 | 61 | void setDrawsBackground(bool b); 62 | bool getDrawBackground(); 63 | 64 | ofEvent LOAD_URL; 65 | 66 | bool getAllowPageLoad(); 67 | void setAllowPageLoad(bool s); 68 | 69 | protected: 70 | void setWebViewFrame(ofRectangle frame); 71 | 72 | bool _allowPageLoad; 73 | bool _drawBg; 74 | 75 | //WebListener *webListener; 76 | WebView * webView; 77 | NSWindow * window; 78 | 79 | 80 | }; 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | @interface WebListener: NSObject{ 89 | ofxWebView * _ofView; 90 | } 91 | 92 | - (void) webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener; 93 | 94 | - (void) webView:(WebView *)webView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener; 95 | 96 | 97 | -(void) setOfView: (ofxWebView *) _ofView; 98 | 99 | @end; 100 | 101 | 102 | 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /src/ofxWebView.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * ofxWebView.mm 3 | * WebView 4 | * 5 | * Created by Andreas Borg on 06/04/2015 6 | * Copyright 2015 LocalProjects. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "ofxWebView.h" 11 | 12 | 13 | //TODO: Explore alternative aproaches for conversion that better handle alpha/antialias 14 | //eg. https://gist.github.com/shpakovski/7696268 15 | 16 | //Check if fuzziness is related to rounding error float/int, on set size / image resize 17 | 18 | //-------------------------------------------------------------- 19 | bool NSBitmapToOFTexture(NSBitmapImageRep *uiImage, ofTexture *outTexture, int targetWidth, int targetHeight) { 20 | if(!uiImage) return false; 21 | 22 | CGContextRef spriteContext; 23 | CGImageRef cgImage = uiImage.CGImage; 24 | 25 | int bytesPerPixel = CGImageGetBitsPerPixel(cgImage)/8; 26 | if(bytesPerPixel == 3) bytesPerPixel = 4; 27 | 28 | int width = targetWidth > 0 ? targetWidth : CGImageGetWidth(cgImage); 29 | int height = targetHeight > 0 ? targetHeight : CGImageGetHeight(cgImage); 30 | 31 | // Allocated memory needed for the bitmap context 32 | GLubyte *pixels = (GLubyte *) malloc(width * height * bytesPerPixel); 33 | 34 | // Uses the bitmap creation function provided by the Core Graphics framework. 35 | spriteContext = CGBitmapContextCreate(pixels, width, height, CGImageGetBitsPerComponent(cgImage), width * bytesPerPixel, CGImageGetColorSpace(cgImage), bytesPerPixel == 4 ? kCGImageAlphaPremultipliedLast : kCGImageAlphaNone); 36 | 37 | if(spriteContext == NULL) { 38 | ofLogError("ofxiOSExtras") << "ofxiOSUIImageToOFImage(): CGBitmapContextCreate returned NULL"; 39 | free(pixels); 40 | return false; 41 | } 42 | 43 | // After you create the context, you can draw the sprite image to the context. 44 | ofLogVerbose("ofxiOSExtras") << "ofxiOSUIImageToOFImage(): about to CGContextDrawImage"; 45 | CGContextDrawImage(spriteContext, CGRectMake(0.0, 0.0, (CGFloat)width, (CGFloat)height), cgImage); 46 | 47 | // You don't need the context at this point, so you need to release it to avoid memory leaks. 48 | ofLogVerbose("ofxiOSExtras") << "ofxiOSUIImageToOFImage(): about to CGContextRelease"; 49 | CGContextRelease(spriteContext); 50 | 51 | int glMode; 52 | 53 | switch(bytesPerPixel) { 54 | case 1: 55 | glMode = GL_LUMINANCE; 56 | break; 57 | case 3: 58 | glMode = GL_RGB; 59 | break; 60 | case 4: 61 | default: 62 | glMode = GL_RGBA; break; 63 | } 64 | 65 | outTexture->allocate(width, height, glMode); 66 | outTexture->loadData(pixels, width, height, glMode); 67 | 68 | free(pixels); 69 | 70 | return true; 71 | } 72 | 73 | 74 | 75 | 76 | 77 | @implementation WebListener 78 | 79 | -(void) setOfView: (ofxWebView *) _of{ 80 | _ofView = _of; 81 | 82 | }; 83 | //@synthesize _ofView; 84 | 85 | - (void) webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener{ 86 | 87 | 88 | WebViewEvent e; 89 | e.URL = (string)[[request.URL absoluteString] UTF8String]; 90 | ofNotifyEvent(_ofView->LOAD_URL,e); 91 | 92 | //this allows for blocking in event response 93 | if(_ofView->getAllowPageLoad()){ 94 | [listener use]; 95 | }else{ 96 | [listener ignore]; 97 | } 98 | 99 | } 100 | 101 | 102 | - (void) webView:(WebView *)webView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id )listener{ 103 | 104 | NSLog(@"decidePolicyForNewWindowAction URL %@ ", request.URL); 105 | 106 | //to stop load 107 | //[listener ignore]; 108 | 109 | //or 110 | [listener use]; 111 | 112 | } 113 | 114 | 115 | 116 | @end; 117 | 118 | 119 | 120 | 121 | 122 | //------------------------------------------------------------------ 123 | ofxWebView::ofxWebView() { 124 | window = (NSWindow *)(ofAppGLFWWindow *)ofGetWindowPtr()->getCocoaWindow(); 125 | 126 | NSRect bounds = {0,0,static_cast(ofGetWidth()),static_cast(ofGetHeight())};//[window.contentView bounds] 127 | setPosition(0,0); 128 | setSize(ofGetWidth(),ofGetHeight()); 129 | 130 | _drawBg = false; 131 | 132 | webView = [[WebView alloc] initWithFrame:bounds 133 | frameName:@"OF-frame" 134 | groupName:nil]; 135 | 136 | [webView setWantsLayer:YES]; 137 | [webView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; // stick to the window's size 138 | [webView setDrawsBackground:NO]; // if you want OF to show up behind the web view 139 | [webView setCanDrawConcurrently:YES]; // may speed up rendering, worth profiling 140 | 141 | [webView setHostWindow:window]; 142 | [window.contentView addSubview:webView]; 143 | 144 | [window.contentView setBackgroundColor:[NSColor clearColor]]; 145 | 146 | _allowPageLoad = true; 147 | 148 | WebListener *webListener = [[WebListener alloc] init]; 149 | 150 | [webListener setOfView: this]; 151 | 152 | //more delegate options here https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DisplayWebContent/Concepts/WebKitDesign.html#//apple_ref/doc/uid/20002024-128170 153 | // [webView setPolicyDelegate:webListener]; 154 | //[webView setFrameLoadDelegate:webListener]; 155 | //[webView setResourceLoadDelegate:webListener]; 156 | 157 | 158 | 159 | 160 | } 161 | ofxWebView::~ofxWebView(){ 162 | 163 | // [window.contentView removeView:webView]; 164 | //webView = 0; 165 | }; 166 | 167 | 168 | 169 | bool ofxWebView::getAllowPageLoad(){ 170 | return _allowPageLoad; 171 | 172 | }; 173 | 174 | 175 | void ofxWebView::setAllowPageLoad(bool s){ 176 | _allowPageLoad = s; 177 | }; 178 | 179 | 180 | void ofxWebView::loadURL(string _url){ 181 | NSString *str = [NSString stringWithUTF8String:_url.c_str()]; 182 | NSURL * url = [NSURL URLWithString:str]; 183 | NSURLRequest * req = [NSURLRequest requestWithURL:url]; 184 | [[webView mainFrame] loadRequest:req]; 185 | 186 | 187 | 188 | 189 | }; 190 | 191 | 192 | void ofxWebView::loadFile(string file, bool relativeToData){ 193 | 194 | if(!ofFile::doesFileExist(file,relativeToData)){ 195 | ofLogError()<<"File "<