Commit 35ea7324 authored by Felix Paul Kühne's avatar Felix Paul Kühne

add basic support to passthrough the base CALayer from the browser

parent c371c0de
......@@ -33,7 +33,6 @@
//from Microsoft SDK (rather then from Mozilla SDK),
//#include it indirectly via <npfunctions.h>
#include <npfunctions.h>
#include <npruntime.h>
static void RuntimeNPClassDeallocate(NPObject *npobj);
......
......@@ -120,6 +120,9 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
}
ppsz_argv[ppsz_argc++] = "--no-one-instance";
#endif
#ifdef XP_MACOSX
ppsz_argv[ppsz_argc++] = "--vout=vmem";
#endif
/* common settings */
......@@ -274,6 +277,13 @@ void VlcPluginBase::setWindow(const NPWindow &window)
npwindow = window;
}
#if defined(XP_MACOSX)
NPError VlcPluginBase::get_root_layer(void *value)
{
return NPERR_GENERIC_ERROR;
}
#endif
bool VlcPluginBase::handle_event(void *event)
{
return false;
......
......@@ -162,6 +162,10 @@ public:
virtual bool handle_event(void *event);
#if defined(XP_MACOSX)
virtual NPError get_root_layer(void *value);
#endif
virtual void toggle_fullscreen() = 0;
virtual void set_fullscreen(int) = 0;
virtual int get_fullscreen() = 0;
......
......@@ -48,13 +48,13 @@ public:
void update_controls() {/* STUB */}
void popup_menu() {/* STUB */}
virtual bool handle_event(void *event);
bool handle_event(void *event);
NPError get_root_layer(void *value);
private:
void set_player_window();
unsigned int i_width, i_height;
int i_last_position;
};
#endif /* __VLCPLUGIN_MAC_H__ */
......@@ -102,6 +102,11 @@ bool VlcPluginMac::destroy_windows()
return true;
}
NPError VlcPluginMac::get_root_layer(void *value)
{
return NPERR_GENERIC_ERROR;
}
bool VlcPluginMac::handle_event(void *event)
{
NPCocoaEvent* cocoaEvent = (NPCocoaEvent*)event;
......
......@@ -172,6 +172,15 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
}
break;
}
#if defined(XP_MACOSX)
case NPPVpluginCoreAnimationLayer:
{
if( instance )
return p_plugin->get_root_layer(&value);;
break;
}
#endif
default:
;
......
......@@ -121,6 +121,11 @@ void VlcWindowlessMac::drawNoPlayback(CGContextRef cgContext)
CGContextRestoreGState(cgContext);
}
NPError VlcWindowlessMac::get_root_layer(void *value)
{
return NPERR_GENERIC_ERROR;
}
bool VlcWindowlessMac::handle_event(void *event)
{
NPCocoaEvent* cocoaEvent = (NPCocoaEvent*)event;
......
......@@ -32,6 +32,7 @@ public:
VlcWindowlessMac(NPP instance, NPuint16_t mode);
bool handle_event(void *event);
NPError get_root_layer(void *value);
protected:
void drawBackground(CGContextRef cgContext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment