Bring the NPAPI BrowserAdapter port into the repo as source (render/adapter/)
instead of relying on the out-of-tree ref-BrowserAdapter clone, restore the
reproducible build scripts, and update docs to the self-contained state.
render/adapter/ — imported the isis-project BrowserAdapter + AdapterBase source
(Apache-2.0, @@@LICENSE headers preserved) with the Jihad port applied:
- self-contained coexistence: MIME application/x-jihad-browser + YAP name
jihad-browser (BrowserAdapterJihad.so runs alongside the stock adapter)
- dstBuffer raw-blit handlePaint (+ rotation guard, pinch-zoom, scroll bar)
and single-tap -> asyncCmdClickAt, ported from Atlas (Herrie82, Apache-2.0)
Modified file carries an Apache-2.0 s4(b) change notice; NOTICE already
attributes isis + Atlas. Rebuild from render/adapter/ is byte-identical to
the on-device BrowserAdapterJihad.so (verified). build-adapter-{pdk,arm}.sh
now compile from render/adapter/.
.gitignore — un-exclude the reproducible build scripts/mozconfigs/OE recipes/
engine patches/READMEs under build/ (~59 small text files); keep excluding the
heavy/third-party parts: engine objects, device-bundle/ + *.tar.gz, toolchain,
device sysroot, and vendored adapter deps.
docs/readmes/kits — README, DEVICE-HANDOFF, DEVICE-BUILD, impl-overview,
cavekit-{overview,ipc-contract,device-build}, app/README,
render/browserserver/README, and new packaging/README describe the
self-contained coexistence model and the on-device working state (renders
example.com/slack.com, load-completion, refresh glyph). Drop the dead
../enyo-1.0 script tag from app/index.html.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MYQTq14u2BT67nroRijWA
99 lines
2.5 KiB
C++
99 lines
2.5 KiB
C++
/* @@@LICENSE
|
|
*
|
|
* Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
LICENSE@@@ */
|
|
|
|
#include "BrowserAdapterManager.h"
|
|
|
|
#include "BrowserAdapter.h"
|
|
|
|
BrowserAdapterManager* BrowserAdapterManager::instance()
|
|
{
|
|
static BrowserAdapterManager* s_instance = 0;
|
|
if (G_UNLIKELY(s_instance == 0)) {
|
|
|
|
s_instance = new BrowserAdapterManager;
|
|
}
|
|
|
|
return s_instance;
|
|
}
|
|
|
|
BrowserAdapterManager::BrowserAdapterManager()
|
|
: m_adapterList(0)
|
|
{
|
|
}
|
|
|
|
BrowserAdapterManager::~BrowserAdapterManager()
|
|
{
|
|
g_list_free(m_adapterList);
|
|
}
|
|
|
|
void BrowserAdapterManager::registerAdapter(BrowserAdapter* adapter)
|
|
{
|
|
m_adapterList = g_list_prepend(m_adapterList, adapter);
|
|
}
|
|
|
|
void BrowserAdapterManager::unregisterAdapter(BrowserAdapter* adapter)
|
|
{
|
|
m_adapterList = g_list_remove(m_adapterList, adapter);
|
|
}
|
|
|
|
void BrowserAdapterManager::adapterActivated(BrowserAdapter* adapter, bool activated)
|
|
{
|
|
if (activated) {
|
|
|
|
GList* head = g_list_first(m_adapterList);
|
|
if (head && head->data != adapter) {
|
|
|
|
m_adapterList = g_list_remove(m_adapterList, adapter);
|
|
m_adapterList = g_list_prepend(m_adapterList, adapter);
|
|
}
|
|
|
|
// Freeze all the other adapters and thaw this one
|
|
for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
|
|
|
|
BrowserAdapter* a = (BrowserAdapter*) iter->data;
|
|
if (a == adapter)
|
|
continue;
|
|
|
|
a->freeze();
|
|
}
|
|
|
|
adapter->thaw();
|
|
}
|
|
/*
|
|
// if we are really concerned about memory we should enable this
|
|
else {
|
|
adapter->freeze();
|
|
}
|
|
*/
|
|
}
|
|
void BrowserAdapterManager::inactiveAdaptersActivate()
|
|
{
|
|
|
|
for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
|
|
|
|
BrowserAdapter* a = (BrowserAdapter*) iter->data;
|
|
//thaw the first frozen adapter that is encountered
|
|
if(a->isFrozen()) {
|
|
|
|
a->thaw();
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|