本文整理汇总了C++中PluginView类的典型用法代码示例。如果您正苦于以下问题:C++ PluginView类的具体用法?C++ PluginView怎么用?C++ PluginView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
Widget* FrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
/* Check if we want to embed a GtkWidget, fallback to plugins later */
CString urlString = url.string().utf8();
CString mimeTypeString = mimeType.utf8();
ASSERT(paramNames.size() == paramValues.size());
GOwnPtr<GHashTable> hash(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
for (unsigned i = 0; i < paramNames.size(); ++i) {
g_hash_table_insert(hash.get(),
g_strdup(paramNames[i].utf8().data()),
g_strdup(paramValues[i].utf8().data()));
}
GtkWidget* gtkWidget = 0;
g_signal_emit_by_name(getViewFromFrame(m_frame), "create-plugin-widget",
mimeTypeString.data(), urlString.data(), hash.get(), >kWidget);
if (gtkWidget)
return new GtkPluginWidget(gtkWidget);
PluginView* pluginView = PluginView::create(core(m_frame), pluginSize, element, url, paramNames, paramValues, mimeType, loadManually);
if (pluginView->status() == PluginStatusLoadedSuccessfully)
return pluginView;
return 0;
}
示例2: NPN_UserAgent
const char* NPN_UserAgent(NPP instance)
{
PluginView* view = pluginViewForInstance(instance);
if (!view)
return PluginView::userAgentStatic();
return view->userAgent();
}
示例3: instantiateView
PluginView * Plugin::createView( QWidget * parent )
{
PluginView * pv = instantiateView( parent );
if( pv != NULL )
{
pv->setModel( this );
}
return pv;
}
示例4: handlesPageScaleGesture
bool WebFrame::handlesPageScaleGesture() const
{
if (!m_coreFrame->document()->isPluginDocument())
return 0;
PluginDocument* pluginDocument = static_cast<PluginDocument*>(m_coreFrame->document());
PluginView* pluginView = static_cast<PluginView*>(pluginDocument->pluginWidget());
return pluginView && pluginView->handlesPageScaleFactor();
}
示例5: requiresUnifiedScaleFactor
bool WebFrame::requiresUnifiedScaleFactor() const
{
if (!m_coreFrame->document()->isPluginDocument())
return 0;
PluginDocument* pluginDocument = static_cast<PluginDocument*>(m_coreFrame->document());
PluginView* pluginView = static_cast<PluginView*>(pluginDocument->pluginWidget());
return pluginView && pluginView->requiresUnifiedScaleFactor();
}
示例6: KURL
Widget* WebFrame::createJavaAppletWidget(const IntSize& pluginSize, Element* element, const KURL& /*baseURL*/, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
PluginView* pluginView = PluginView::create(core(this), pluginSize, element, KURL(), paramNames, paramValues, "application/x-java-applet", false);
// Check if the plugin can be loaded successfully
if (pluginView->plugin() && pluginView->plugin()->load())
return pluginView;
return pluginView;
}
示例7: NPN_InvalidateRect
void NPN_InvalidateRect(NPP instance, NPRect* invalidRect)
{
PluginView* view = pluginViewForInstance(instance);
#if defined(XP_UNIX)
// NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
// on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
if (!view)
return;
#endif
view->invalidateRect(invalidRect);
}
示例8: NPN_ScheduleTimer
uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat,
void (*timerFunc)(NPP npp, uint32 timerID))
{
//SAMSUNG FIX >> Crash in channel.pandora.tv
PluginView* view = pluginViewForInstance(instance);
if (!view)
return 0 ;
return view->scheduleTimer(instance, interval, repeat != 0, timerFunc);
//SAMSUNG FIX <<
}
示例9: USE
NPObject* PlatformBridge::pluginScriptableObject(Widget* widget)
{
#if USE(V8)
if (!widget->isPluginView())
return 0;
PluginView* pluginView = static_cast<PluginView*>(widget);
return pluginView->getNPObject();
#else
return 0;
#endif
}
示例10: ASSERT
PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget)
{
ASSERT(widget);
#if PLATFORM(CHROMIUM)
if (widget->isFrameView())
return 0;
NPObject* npObject = ChromiumBridge::pluginScriptableObject(widget);
if (!npObject)
return 0;
#elif PLATFORM(ANDROID)
if (!widget->isPluginView())
return 0;
PluginView* pluginView = static_cast<PluginView*>(widget);
NPObject* npObject = pluginView->getNPObject();
if (!npObject)
return 0;
#endif
// Frame Memory Management for NPObjects
// -------------------------------------
// NPObjects are treated differently than other objects wrapped by JS.
// NPObjects can be created either by the browser (e.g. the main
// window object) or by the plugin (the main plugin object
// for a HTMLEmbedElement). Further, unlike most DOM Objects, the frame
// is especially careful to ensure NPObjects terminate at frame teardown because
// if a plugin leaks a reference, it could leak its objects (or the browser's objects).
//
// The Frame maintains a list of plugin objects (m_pluginObjects)
// which it can use to quickly find the wrapped embed object.
//
// Inside the NPRuntime, we've added a few methods for registering
// wrapped NPObjects. The purpose of the registration is because
// javascript garbage collection is non-deterministic, yet we need to
// be able to tear down the plugin objects immediately. When an object
// is registered, javascript can use it. When the object is destroyed,
// or when the object's "owning" object is destroyed, the object will
// be un-registered, and the javascript engine must not use it.
//
// Inside the javascript engine, the engine can keep a reference to the
// NPObject as part of its wrapper. However, before accessing the object
// it must consult the _NPN_Registry.
v8::Local<v8::Object> wrapper = createV8ObjectForNPObject(npObject, 0);
// Track the plugin object. We've been given a reference to the object.
m_pluginObjects.set(widget, npObject);
return V8ScriptInstance::create(wrapper);
}
示例11: bindingRootObject
PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(WebCore::Widget* widget)
{
if (widget->isPluginView()) {
PluginView* pluginView = static_cast<PluginView*>(widget);
return pluginView->bindingInstance();
}
QWidget* platformWidget = widget->platformWidget();
if (!platformWidget)
return 0;
return JSC::Bindings::QtInstance::getQtInstance(platformWidget, bindingRootObject(), QScriptEngine::QtOwnership);
}
示例12: pluginViewForFrame
void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
bool found;
if (pluginView)
found = pluginView->findString(string, core(options), maxMatchCount);
else
found = m_webPage->corePage()->findString(string, core(options));
m_webPage->drawingArea()->dispatchAfterEnsuringUpdatedScrollPosition(WTF::bind(&FindController::updateFindUIAfterPageScroll, this, found, string, options, maxMatchCount));
}
示例13: pluginViewForFrame
void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
WebCore::FindOptions coreOptions = core(options);
// iOS will reveal the selection through a different mechanism, and
// we need to avoid sending the non-painted selection change to the UI process
// so that it does not clear the selection out from under us.
#if PLATFORM(IOS)
coreOptions = static_cast<FindOptions>(coreOptions | DoNotRevealSelection);
#endif
willFindString();
bool foundStringStartsAfterSelection = false;
if (!pluginView) {
if (Frame* selectedFrame = frameWithSelection(m_webPage->corePage())) {
FrameSelection& fs = selectedFrame->selection();
if (fs.selectionBounds().isEmpty()) {
m_findMatches.clear();
int indexForSelection;
m_webPage->corePage()->findStringMatchingRanges(string, core(options), maxMatchCount, m_findMatches, indexForSelection);
m_foundStringMatchIndex = indexForSelection;
foundStringStartsAfterSelection = true;
}
}
}
bool found;
if (pluginView)
found = pluginView->findString(string, coreOptions, maxMatchCount);
else
found = m_webPage->corePage()->findString(string, coreOptions);
if (found) {
didFindString();
if (!foundStringStartsAfterSelection) {
if (options & FindOptionsBackwards)
m_foundStringMatchIndex--;
else
m_foundStringMatchIndex++;
}
}
RefPtr<WebPage> protectedWebPage = m_webPage;
m_webPage->drawingArea()->dispatchAfterEnsuringUpdatedScrollPosition([protectedWebPage, found, string, options, maxMatchCount] () {
protectedWebPage->findController().updateFindUIAfterPageScroll(found, string, options, maxMatchCount);
});
}
示例14: PluginView
void PluginKateHtmlTools::addView(Kate::MainWindow *win)
{
// TODO: doesn't this have to be deleted?
PluginView *view = new PluginView ();
(void) new KAction ( i18n("HT&ML Tag..."), /*"edit_HTML_tag",*/ ALT + Key_Minus, this,
SLOT( slotEditHTMLtag() ), view->actionCollection(), "edit_HTML_tag" );
view->setInstance (new KInstance("kate"));
view->setXMLFile( "plugins/katehtmltools/ui.rc" );
win->guiFactory()->addClient (view);
view->win = win;
m_views.append (view);
}
示例15: PluginView
void KatePluginHelloWorld::addView(Kate::MainWindow *win)
{
// TODO: doesn't this have to be deleted?
PluginView *view = new PluginView ();
(void) new KAction ( i18n("Insert Hello World"), 0, this,
SLOT( slotInsertHello() ), view->actionCollection(),
"edit_insert_helloworld" );
view->setInstance (new KInstance("kate"));
view->setXMLFile("plugins/katehelloworld/ui.rc");
win->guiFactory()->addClient (view);
view->win = win;
m_views.append (view);
}