XPCOM指南-5_使用XPCOM实用工具简化你的生活

本章回顾你已经在教程第一部分建立的代码 (see webLock1.cpp in the previous chapter) 并且使用 XPCOM 工具类让代码更容易更有效同时,介绍一个在XPCOMGecko API中广泛使用基本的字符串类型

作为起点,第一部分描述可以替代webLock1.cpp中的很多代码的C++ 很多用来完成软件组织和组件注册的代码都可以缩减为精简的数据结构和宏代码继续阅读

XPCOM指南-4_创建组件的代码

本章会讲述一些基本代码,这些代码用于处理你的组件与XPCOM之间的关系。  如何发现和注册组件是本指南的第一节的目标。在后续的章节里,我们就可以专注WebLock本生的功能开发了。

为了创建组件库并把它加载进XPCOM,你需要编写大量的代码。 一个XPCOM组件至少需要实现XPCOM必须的3个接口,而且往往还要其它的接口。 这一章你将会看到更多的代码,然而这些并不是整个WebLock组件代码。“Using XPCOM Utilities to Make Things Easier”展示了更加简单,更加优雅的方式创建XPCOM组件(使用泛型和宏),这一章的目的是为了学习基础知识,因为这对你深入了解XPCOM是很有帮助的。 继续阅读

XPCOM指南-3_组件的内部结构

前面章节从客户使用角度描述了XPCOM组件,本章从开发者角度讨论组件。 请仔细阅读,XPCOM组件是怎么实现的,你可以略过本章到下一章节,从下一章节开始将会一步一步创建WebLock组件。

1. C++创建组件

让我们用C++开始XPCOM之旅吧。 XPCOM的大多数组件是用C++写的,然后编译为共享库(在windows下是DLLUnix下是DSO)。 继续阅读

XPCOM指南-2_使用XPCOM组件

在Mozilla里组件是怎样获取和使用的呢? 在Mozilla里组件的使用分为三个部分:一个是Mozilla怎么找到这些二进制组件,另外两个对应了客户端访问XPCOM组件的两种方式。

1. 发现Mozilla组件

本书在编写时试图提供已冻结的XPCOM组件和他们的接口的参考信息。 Mozilla嵌入跟踪了当前冻结的接口。 继续阅读

XPCOM指南-1_XPCOM概述

原文:An_Overview_of_XPCOM

本章为XPCOM的快速导览,对XPCOM和组件开发的基础思想和技术做了说明,这些说明从较高层次来描述的,只是为了熟悉一下本指南需要的一些背景知识。

1. XPCOM 解决方案

XPCOM ( Cross Platform Component Object Model),是一个跨平台的软件框架,它使开发人员把一个大的软件工程分解成各个小的独立的模块,然后再运行时再组装在一起,这就是组件化的思想。 继续阅读

Register XPCOM Component in Gecko17

Like description in “Creating_XPCOM_Components“, there have three method register the XPCOM component in XPCOM system.   But in Gecko17 there have some change,we must edit the chrome.manifests file for registration the component.  The file put on application’s root directory, the directory is same as application.ini file.  See chrome.manifests .

#chrome.manifests
content	test	chrome/content/
locale	test	en-US	chrome/locale/en-US/
skin	test	classic/1.0	chrome/skin/
manifest components/samplecomp.manifest

Look above snippet text, the highlight text shows the components that you want to register. Detail about chrome.manifests,see “Chrome registration“.

The directory list:

test
 + chrome
 + components
 + default
 + xulrunner
 - application.ini
 - chrome.manifests
 - xulrunner-stub.exe

Mozilla World – Build XULRunner in windows

You can see the link, ” Build in window “.

1. Install build prerequisites

  1. Install vs2010
  2. Download Mozilla-source and decompress.
  3. Download and Install MozillaBuild, a package of additional build tools.
  4. Into MozillaBuild, run “start-msvc10.bat”,then MSYS command will prompt properly configured. All further commands should be executed in this command prompt window.

2. Build

  1. In MSYS command,into source directory, at root directory,Create a file: “.moconfig” in ,file content like below:
# My first mozilla config

mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-xulrunner
mk_add_options MOZ_BUILD_PROJECTS="xulrunner"

#Global options
ac_add_options --enable-debug
ac_add_options --disable-optimize

#XULRunner options
ac_add_app_options xulrunner --enable-application=xulrunner

#ac_add_options --enable-debug-symbols[=DBG]
ac_add_options --disable-static
ac_add_options --enable-shared
ac_add_options --enable-extensions=default
ac_add_options --disable-tests
ac_add_options --disable-webgl
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
  1. Run command “make -f client.mk build”,start build.
  2. Wait 1 hours,then build OK.

Hello,world

非常庆幸,Sourceforge提供了这样一个永久,无限,免费空间。 非常幸运能够成功的创建好站点。

我已年过三十,在 Code 这条路上已经走了十余载,幸好生活和工作并没有磨灭掉我对Coder的兴趣与能力,但愿我能够一直Code下去,直到我不再能敲动键盘,而原因只是因为兴趣和对生活的热爱 :)

我会把我的这个兴趣的成果都记录在这个站点上,为什么不呢?