Commit 37350bde authored by Jean-Paul Saman's avatar Jean-Paul Saman

mozilla: Make fullscreen work

parent 8308fdd2
......@@ -636,6 +636,7 @@ void Private_URLNotify(NPP instance, const char* url,
void Private_Print(NPP instance, NPPrint* platformPrint);
NPError Private_GetValue(NPP instance, NPPVariable variable, void *r_value);
NPError Private_SetValue(NPP instance, NPPVariable variable, void *r_value);
int16_t Private_HandleEvent(NPP instance, void *event);
#ifdef OJI
JRIGlobalRef Private_GetJavaClass(void);
#endif
......@@ -742,6 +743,13 @@ Private_SetValue(NPP instance, NPPVariable variable, void *r_value)
return NPP_SetValue(instance, variable, r_value);
}
int16_t
Private_HandleEvent(NPP instance, void *event)
{
PLUGINDEBUGSTR("HandleEvent");
return NPP_HandleEvent(instance, event);
}
#ifdef OJI
JRIGlobalRef
Private_GetJavaClass(void)
......@@ -960,6 +968,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->print = NewNPP_PrintProc(Private_Print);
pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue);
pluginFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue);
pluginFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent);
#else
pluginFuncs->newp = (NPP_NewProcPtr)(Private_New);
pluginFuncs->destroy = (NPP_DestroyProcPtr)(Private_Destroy);
......@@ -972,8 +981,8 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->print = (NPP_PrintProcPtr)(Private_Print);
pluginFuncs->getvalue = (NPP_GetValueProcPtr)(Private_GetValue);
pluginFuncs->setvalue = (NPP_SetValueProcPtr)(Private_SetValue);
pluginFuncs->event = (NPP_HandleEventProcPtr)(Private_HandleEvent);
#endif
pluginFuncs->event = NULL;
if( minor >= NPVERS_HAS_NOTIFICATION )
{
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
......
......@@ -262,7 +262,60 @@ int16 NPP_HandleEvent( NPP instance, void * event )
}
return false;
}
#endif /* XP_MACOSX */
#elif defined(XP_UNIX)
int16 NPP_HandleEvent( NPP instance, void *event )
{
static Time lastMouseUp = 0;
if( instance == NULL )
return false;
VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
if( p_plugin == NULL )
return false;
XEvent *xevent = (XEvent *) event;
switch( xevent->type )
{
case ButtonPress:
{
XButtonEvent *btn = (XButtonEvent *) xevent;
if( btn->time - lastMouseUp < 500 /*FIXME: in ms*/ )
p_plugin->toggle_fullscreen();
return true;
}
case ButtonRelease:
{
XButtonEvent *btn = (XButtonEvent *) xevent;
lastMouseUp = btn->time;
return true;
}
default: break;
}
return false;
}
#elif defined(XP_WIN)
#if 0 // FIXME: disabled for now
int16 NPP_HandleEvent( NPP instance, void *event )
{
if( instance == NULL )
return false;
VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
if( p_plugin == NULL )
return false;
switch( event->event )
{
case WM_LBUTTONDBLCLK:
p_plugin->toggle_fullscreen();
return true;
default: break;
}
return false;
}
#endif
#endif /* XP_WIN */
/******************************************************************************
* General Plug-in Calls
......
......@@ -44,7 +44,6 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save );
NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value );
NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value );
NPError NPP_SetWindow( NPP instance, NPWindow* window );
NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
......@@ -70,7 +69,9 @@ void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData );
void NPP_Print( NPP instance, NPPrint* printInfo );
#ifdef XP_MACOSX
#ifdef XP_WIN
void ScheduleAsyncCall(HWND p_hwnd, void (*func)(void *), void *userData);
#else /* XP_WIN */
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
int16 NPP_HandleEvent( NPP instance, void * event );
#else
......@@ -78,8 +79,4 @@ int16_t NPP_HandleEvent( NPP instance, void * event );
#endif
#endif
#ifdef XP_WIN
void ScheduleAsyncCall(HWND p_hwnd, void (*func)(void *), void *userData);
#endif /* XP_WIN */
#endif
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