| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include <CoreFoundation/CoreFoundation.h> | 36 #include <CoreFoundation/CoreFoundation.h> |
| 37 #include <npfunctions.h> | 37 #include <npfunctions.h> |
| 38 #include <AGL/agl.h> | 38 #include <AGL/agl.h> |
| 39 #include <vector> | 39 #include <vector> |
| 40 | 40 |
| 41 // Just for o3d::Event::Button at the moment. | 41 // Just for o3d::Event::Button at the moment. |
| 42 #include "core/cross/event.h" | 42 #include "core/cross/event.h" |
| 43 | 43 |
| 44 namespace o3d { | 44 namespace o3d { |
| 45 | 45 |
| 46 class DisplayMode; |
| 47 |
| 46 // RenderTimer maintains an animation timer (nominally running at 60fps) | 48 // RenderTimer maintains an animation timer (nominally running at 60fps) |
| 47 // | 49 // |
| 48 // Keeps track of the current NPP instances running in the browser and then | 50 // Keeps track of the current NPP instances running in the browser and then |
| 49 // renders each one during each timer callback. | 51 // renders each one during each timer callback. |
| 50 class RenderTimer { | 52 class RenderTimer { |
| 51 public: | 53 public: |
| 52 RenderTimer() {} | 54 RenderTimer() {} |
| 53 | 55 |
| 54 void Start(); | 56 void Start(); |
| 55 void Stop(); | 57 void Stop(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 | 78 |
| 77 void* SafariBrowserWindowForWindowRef(WindowRef theWindow); | 79 void* SafariBrowserWindowForWindowRef(WindowRef theWindow); |
| 78 | 80 |
| 79 void* SelectedTabForSafariBrowserWindow(void* cocoaWindow); | 81 void* SelectedTabForSafariBrowserWindow(void* cocoaWindow); |
| 80 | 82 |
| 81 void ReleaseSafariBrowserWindow(void* browserWindow); | 83 void ReleaseSafariBrowserWindow(void* browserWindow); |
| 82 | 84 |
| 83 | 85 |
| 84 // Some miscellaneous helper functions... | 86 // Some miscellaneous helper functions... |
| 85 | 87 |
| 88 void GetCurrentDisplayMode(DisplayMode *mode); |
| 86 | 89 |
| 87 void CFReleaseIfNotNull(CFTypeRef cf); | 90 void CFReleaseIfNotNull(CFTypeRef cf); |
| 88 | 91 |
| 89 | 92 |
| 90 // Converts an old style Mac HFS path eg "HD:Users:xxx:file.zip" into a standard | 93 // Converts an old style Mac HFS path eg "HD:Users:xxx:file.zip" into a standard |
| 91 // Posix path eg "/Users/xxx/file.zip" Assumes UTF8 in and out, returns a block | 94 // Posix path eg "/Users/xxx/file.zip" Assumes UTF8 in and out, returns a block |
| 92 // of memory allocated with new, so you'll want to delete this at some point. | 95 // of memory allocated with new, so you'll want to delete this at some point. |
| 93 // Returns NULL in the event of an error. | 96 // Returns NULL in the event of an error. |
| 94 char* CreatePosixFilePathFromHFSFilePath(const char* hfsPath); | 97 char* CreatePosixFilePathFromHFSFilePath(const char* hfsPath); |
| 95 | 98 |
| 96 bool HandleMacEvent(EventRecord* the_event, NPP instance); | 99 bool HandleMacEvent(EventRecord* the_event, NPP instance); |
| 97 | 100 |
| 98 o3d::Event::Button MacOSMouseButtonNumberToO3DButton(int inButton); | 101 o3d::Event::Button MacOSMouseButtonNumberToO3DButton(int inButton); |
| 99 | 102 |
| 100 bool GetBrowserVersionInfo(int *returned_major, | 103 bool GetBrowserVersionInfo(int *returned_major, |
| 101 int *returned_minor, | 104 int *returned_minor, |
| 102 int *returned_bugfix); | 105 int *returned_bugfix); |
| 103 | 106 |
| 104 bool UseSoftwareRenderer(); | 107 bool UseSoftwareRenderer(); |
| 105 | 108 |
| 106 } // namespace o3d | 109 } // namespace o3d |
| 107 | 110 |
| 108 #endif // O3D_PLUGIN_MAC_PLUGIN_MAC_H_ | 111 #endif // O3D_PLUGIN_MAC_PLUGIN_MAC_H_ |
| OLD | NEW |