Firefox Plugins-II

Chapter 3:Plug-in API

5: typedef struct _NPWindow

6: NPError NPP_SetWindow(NPP instance, NPWindow *window);

 

The NPWindow Structure

When a plug-in is loaded, it is drawn into a target area. This target is either the windowed plug-in's native window, or the drawable of a windowless plug-in. The NPWindow structure represents either the native window or a drawable. This structure contains information about coordinate position, size, the state of the plug-in (windowed or windowless), and some platform-specific information.

NOTE: When a plug-in is drawn to a window, the plug-in is responsible for preserving state information and ensuring that the original state is restored.

For windowless plug-ins, the browser calls the NPP_SetWindow method with an NPWindow structure that represents a drawable. For windowed plug-ins, the browser calls the NPP_SetWindow method with an NPWindow structure that represents a window.

//The NPWindow Structure


typedef enum {

NPWindowTypeWindow = 1,
NPWindowTypeDrawable

} NPWindowType;



typedef struct _NPWindow
{
void* window; /* Platform-specific handle */
uint32 x; /* Position of top-left corner */
uint32 y; /* relative to a Netscape page */
uint32 width; /* Maximum window size */
uint32 height;
NPRect clipRect; /* Clipping rectangle in port coordinates */

#ifdef XP_UNIX
void * ws_info; /* Platform-dependent additional data */
#endif /* XP_UNIX */

NPWindowType type; /* Whether this is a window or a drawable */
} NPWindow;

The type field indicates the NPWindow type of the target area:

  • NPWindowType Window: Windowed plug-in. The window field holds a platform-specific handle to a window.
  • NPWindowType Drawable: Windowless plug-in. The window field holds a platform-specific handle to a drawable
由type来决定这个Plugin是一个windowed还是一个windowless

Drawing Plug-ins

This section describes the methods and processes you use in drawing both windowed and windowless plug-ins. Processes that apply to only one of these plug-in types are described in the following sections.

The plug-in uses these methods to draw plug-ins and to handle events:

Plug-in methods, called by the browser:

  • NPP_HandleEvent : Deliver a platform-specific event to the instance.
  • NPP_Print : Request a platform-specific print operation for the instance.
  • NPP_SetWindow : Set the window in which a plug-in draws.

Browser-side methods, called by the plug-in:

 

Printing the Plug-in

The browser calls the NPP_Print method to ask the plug-in instance to print itself.

void NPP_Print(NPP instance, NPPrint *printInfo);

 

The PrintInfo parameter determines the print mode. It is set to either NP_FULL to indicate full-page plug-in printing, or NP_EMBED if this is an embedded plug-in printed as part of the window in which it is embedded.

  • An embedded plug-in shares printing with the browser. The plug-in prints the part of the page it occupies, and the browser handles the rest of the printing process, including displaying print dialog boxes, getting the printer device context, and, of course, printing the rest of the page.

An embedded plug-in can set the pluginPrinted field in its PrintInfo parameter to false (the default). This is a field of the _NPFullPrint substructure of the NPPrint structure. The browser displays the necessary print dialog boxes and calls NPP_Print again. This time, PrintInfo->mode should be set to NP_EMBED .

  • A full-page plug-in handles the print dialog boxes and printing process as it sees fit. In this case, before the browser displays any print dialog boxes, NPP_Print is called with PrintInfo->mode equal to NP_FULL . On Mac OS, full-page printing requires that the field PrintInfo contain a standard Mac OS THPrint (see Printing.h ).

Of course, NPP_Print is also called with PrintInfo->mode equal to NP_EMBED when the instance is embedded. In this case, platformPrint->embedPrint.window contains the window in which the plug-in should print.

 

NPP_Print这个函数内部看情形应该对传入的printInfo进行详细的分析然后做出不同的事情来才行。

For windowed plug-ins on MS Windows and Unix, the window->window
 field is a handle to a subwindow of the Netscape window hierarchy.

之前说送入window,再回过头来看,这个Window还得是浏览器所属的才行?是这个意思吧


多源动态最优潮流的分布鲁棒优化方法(IEEE118节点)(Matlab代码实现)内容概要:本文介绍了基于Matlab实现的多源动态最优潮流的分布鲁棒优化方法,适用于IEEE118节点电力系统。该方法旨在应对电力系统中源荷不确定性带来的挑战,通过构建分布鲁棒优化模型,有效处理多源输入下的动态最优潮流问题,提升系统运行的安全性和经济性。文中详细阐述了模型的数学 formulation、求解算法及仿真验证过程,并提供了完整的Matlab代码实现,便于读者复现与应用。该研究属于电力系统优化调度领域的高水平技术复现,具有较强的工程实用价值。; 适合人群:具备电力系统基础知识和Matlab编程能力的研究生、科研人员及从事电力系统优化调度的工程技术人员,尤其适合致力于智能电网、鲁棒优化、能源调度等领域研究的专业人士。; 使用场景及目标:①用于电力系统多源环境下动态最优潮流的建模与求解;②支撑含可再生能源接入的电网调度决策;③作为鲁棒优化方法在实际电力系统中应用的教学与科研案例;④为IEEE118节点系统的仿真研究提供可复现的技术支持。; 阅读建议:建议结合提供的Matlab代码逐模块分析,重点关注不确定变量的分布鲁棒建模、目标函数构造及求解器调用方式。读者应具备一定的凸优化和电力系统分析基础,推荐配合YALMIP工具包与主流求解器(如CPLEX、Gurobi)进行调试与扩展实验。
内容概要:本文系统介绍了物联网与云计算的基本概念、发展历程、技术架构、应用场景及产业生态。文章阐述了物联网作为未来互联网的重要组成部分,通过RFID、传感器网络、M2M通信等技术实现物理世界与虚拟世界的深度融合,并展示了其在智能交通、医疗保健、能源管理、环境监测等多个领域的实际应用案例。同时,文章强调云计算作为物联网的支撑平台,能够有效应对海量数据处理、资源弹性调度和绿色节能等挑战,推动物联网规模化发展。文中还详细分析了物联网的体系结构、标准化进展(如IEEE 1888、ITU-T、ISO/IEC等)、关键技术(中间件、QoS、路由协议)以及中国运营商在M2M业务中的实践。; 适合人群:从事物联网、云计算、通信网络及相关信息技术领域的研究人员、工程师、高校师生以及政策制定者。; 使用场景及目标:①了解物联网与云计算的技术融合路径及其在各行业的落地模式;②掌握物联网体系结构、标准协议与关键技术实现;③为智慧城市、工业互联网、智能物流等应用提供技术参考与方案设计依据;④指导企业和政府在物联网战略布局中的技术选型与生态构建。; 阅读建议:本文内容详实、覆盖面广,建议结合具体应用场景深入研读,关注技术标准与产业协同发展趋势,同时结合云计算平台实践,理解其对物联网数据处理与服务能力的支撑作用。
### 下载 Kylin Firefox Flash Plugins 的 Deb 包 根据提供的引用内容和相关信息,可以确定以下步骤用于下载适用于 Kylin 系统的 Firefox 浏览器及其 Flash 插件的 Deb 包。 #### 1. 麒麟版 Firefox 浏览器资源文件 在引用[^3]中提到,麒麟版 Firefox 浏览器的资源文件可以通过以下地址访问: - **项目地址**: [https://gitcode.com/open-source-toolkit/98036](https://gitcode.com/open-source-toolkit/98036) 此仓库提供了多个版本的 Firefox 安装包,适用于不同的硬件架构。然而,该仓库并未明确列出包含 Flash 插件的安装包。 #### 2. Flash 插件的安装方式 Flash 插件通常需要单独安装,并不直接集成在 Firefox 的 Deb 包中。引用[^1]和[^2]分别描述了手动安装 Flash 插件的方法。以下是可能的解决方案: - **方法一**: 手动下载并安装 Flash 插件 根据引用,可以从 Adobe 官方网站下载适用于 Linux 的 Flash Player 插件: ```bash wget https://get.adobe.com/flashplayer/?loc=cn ``` 下载后解压并复制 `libflashplayer.so` 文件到 Firefox 插件目录,例如 `/usr/lib/firefox-addons/plugins`。 - **方法二**: 使用 PPA 或软件源安装 在 Ubuntu 或基于 Debian 的系统中,可以尝试通过 PPA 安装 Flash 插件: ```bash sudo apt update sudo apt install adobe-flashplugin ``` #### 3. 寻找集成 Flash 插件的 Deb 包 如果需要一个已经集成 Flash 插件的 Deb 包,可以尝试以下方法: - 搜索第三方仓库或社区支持的 Deb 包。 - 在引用的项目页面中提交 Issue,询问是否提供包含 Flash 插件的 Firefox 版本。 #### 4. 注意事项 - 确保系统的硬件架构与下载的 Deb 包匹配。例如,AMD64 架构应选择 `_amd64.deb` 文件。 - 安装过程中可能会遇到依赖问题,可以使用以下命令解决: ```bash sudo apt-get install -f ``` ### 示例代码:安装 Flash 插件 ```bash # 下载 Flash 插件 wget https://get.adobe.com/flashplayer/?loc=cn -O flash_player.tar.gz # 解压插件 tar -xvzf flash_player.tar.gz # 复制插件到 Firefox 插件目录 sudo cp libflashplayer.so /usr/lib/firefox-addons/plugins # 重启浏览器 pkill firefox ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值