- Add off-screen rendering support for Mac OS-X (issue #540).

- Add patch for ninja build support on Mac OS-X.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@624 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-05-16 16:56:38 +00:00
parent 808e89e01e
commit fb2d3f9490
38 changed files with 2236 additions and 594 deletions

View File

@ -37,7 +37,9 @@
#include "include/internal/cef_types_mac.h"
#include "include/internal/cef_types_wrappers.h"
///
// Atomic increment and decrement.
///
inline long CefAtomicIncrement(long volatile *pDest) { // NOLINT(runtime/int)
return __sync_add_and_fetch(pDest, 1);
}
@ -45,11 +47,15 @@ inline long CefAtomicDecrement(long volatile *pDest) { // NOLINT(runtime/int)
return __sync_sub_and_fetch(pDest, 1);
}
///
// Handle types.
///
#define CefWindowHandle cef_window_handle_t
#define CefCursorHandle cef_cursor_handle_t
///
// Critical section wrapper.
///
class CefCriticalSection {
public:
CefCriticalSection() {
@ -72,6 +78,7 @@ class CefCriticalSection {
pthread_mutexattr_t attr_;
};
struct CefWindowInfoTraits {
typedef cef_window_info_t struct_type;
@ -92,10 +99,14 @@ struct CefWindowInfoTraits {
target->m_nWidth = src->m_nWidth;
target->m_nHeight = src->m_nHeight;
target->m_bHidden = src->m_bHidden;
target->m_bWindowRenderingDisabled = src->m_bWindowRenderingDisabled;
target->m_bTransparentPainting = src->m_bTransparentPainting;
}
};
///
// Class representing window information.
///
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
public:
typedef CefStructBase<CefWindowInfoTraits> parent;
@ -113,8 +124,18 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
m_nHeight = height;
m_bHidden = false;
}
void SetAsOffScreen(NSView* parent) {
m_bWindowRenderingDisabled = true;
m_ParentView = parent;
}
void SetTransparentPainting(int transparentPainting) {
m_bTransparentPainting = transparentPainting;
}
};
struct CefPrintInfoTraits {
typedef cef_print_info_t struct_type;
@ -127,9 +148,31 @@ struct CefPrintInfoTraits {
}
};
///
// Class representing print context information.
///
typedef CefStructBase<CefPrintInfoTraits> CefPrintInfo;
struct CefKeyInfoTraits {
typedef cef_key_info_t struct_type;
static inline void init(struct_type* s) {}
static inline void clear(struct_type* s) {}
static inline void set(const struct_type* src, struct_type* target,
bool copy) {
target->keyCode = src->keyCode;
target->character = src->character;
target->characterNoModifiers = src->characterNoModifiers;
}
};
///
// Class representing key information.
///
typedef CefStructBase<CefKeyInfoTraits> CefKeyInfo;
#endif // OS_MACOSX
#endif // CEF_INCLUDE_INTERNAL_CEF_MAC_H_