CodeLite Plugin Internal(2)-Load: 插件加载分析

hat_dll_load 上回书说到接口和众插件之间的关系,这里讲讲插件加载的过程。加载点在系统初始化时Framezhong 调用,上次也说过。这里主要是从PluginManager::Load() 说起。首先读取插件配置文件 config/plugins.xml,并将信息保存到std::map<wxString, PluginInfo> m_pluginsInfo中,这个成员m_pluginsInfo是属于PluginManager,这个map保存了插件名称和Pluginfo的映射关系。接着TagManagerST和LanguageST互相赋值。

现在进入重点循环,针对插件目录下的每个./.so文件,会进行1)加载动态库;2)读插件信息;3)加载插件;4)调用插件相关创建toolbar和menu的函数。下面一一详述:

Continue reading CodeLite Plugin Internal(2)-Load: 插件加载分析 - 全文阅读

CodeLite Plugin Internal(1) – IPlugin interface

icosahedronFeather 所有的CodeLite插件都以动态库的形式(. or .so)保存在/plugins下,通过程序初始化时调用Frame::LoadPlugins加载[CodeLite的初始化分析在另外一篇文章中已有详述,请在ide.cbforge.com站内参阅]。插件相关的配置保存在/config/plugins.xml文件。文件为XML格式,每一插件项都保存有以下几项:SerializedObject Name, Name,Author,Description and Version。关于插件的实现我们会分几篇文章分析,这个第一篇主要关注接口的实现。

is the interface that defines a for CodeLite. Each must implement the pure virtual methods of this interface. The gains access to CodeLite data by using the m_mgr member.

Continue reading CodeLite Plugin Internal(1) – IPlugin interface - 全文阅读

CodeLite Initializaion analysis - 初始化流程分析(1)

china-03_03 转载请注明出处,该文章来源于cbforge.com by Bryan Wu. 的主应用程序类实现在文件 /liteeditor/app.cpp中,系统初始化时,从继承的App类会调用OnInit成员函数,bool App::OnInit()

  1. If it is Linux or MAC system, block signal pipe first;
  2. wxSocketBase::Initialize();
  3. 打开fatal exception handler,假如系统crash,会调用::OnFatalException,在此处可以采集一些调试信息;
  4. InitXmlResource:通过wxMemoryFSHandler加载资源文件到内存,包括很多PNG文件和xml文件;
  5. 调用wxCmdLineParser解析命令行参数,命令行描述如下:

    假如是h,会打印帮助并推出,如果有b,重新设置basedir。static const wxCmdLineEntryDesc cmdLineDesc[] = {
        {wxCMD_LINE_SWITCH, “v“, “version”, “Print current version”, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        {wxCMD_LINE_SWITCH, “h“, “help”, “Print usage”, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        {wxCMD_LINE_OPTION, “l“, “line”, “Open the file at a given line number”, wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL },
        {wxCMD_LINE_OPTION, “b“, “basedir”,  “The base directory of CodeLite”, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
        {wxCMD_LINE_PARAM,  NULL, NULL, “Input file”, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE|wxCMD_LINE_PARAM_OPTIONAL },
        {wxCMD_LINE_NONE }
    };

     

  6. 设置各种目录,包括homeDir,installPath,CurDir,StartupDir等;
  7. Load Menu resource, rc/menu.xrc
  8. Initialize the configuration file locater,ConfFileLocator::Instance()->Initialize
  9. 初始化Manager类,该类从Singleton Pattern template而来;
  10. read the last frame size from the configuration file and initialise editor configuration files;
  11. 加入SingleInstance为真,我们需要通过调用wxSingleInstanceChecker来检查CodeLite运行实例是否唯一;
  12. Update PATH environment variable with the install directory and default installation (if exists)
  13. 显示,图片存储在 /images/splashscreen.png(可选,配置在GeneralInfo中)
  14. 重头戏来了,Frame::Initialize,初始化Frame中会包括很多内容,下面详述;
  15. update the accelerators table;
  16. 显示由第14步初始化的Frame并置为top window;
  17. 刚才第5步中解析的结果中如果有line,和input file,会依次打开并跳转至line-1行;
  18. 最后一步:通过wxLogMessage打印Install path和Startup Path信息,Over。

Continue reading CodeLite Initializaion analysis - 初始化流程分析(1) - 全文阅读

CodeLite IDE介绍

codeliteBryan @ CBForge:

 本来打算整合cscope到code::blocks IDE中实现函数调用查找等功能,代码写了一半,发现CodeLite已经整合的很好了。:(

而且CodeLite IDE是一个轻量级的C、C++开发环境,其中很多功能非常适合开发一个开源版本的sourceinsight。

下面转载一篇介绍CodeLite的文章给大家。 Continue reading CodeLite IDE介绍 - 全文阅读

Code::Blocks中Plugin的实现原理

Generic-plugin转载另一篇不错的代码分析文章,首先Bryan@cbforge(cbforge at gmail dot com)通过阅读CB源代码针对插件的实现有如下一些补充:

1)CB在系统初始化时,在InitFrame时调用MainFrame::ScanForPlugins来调用PluginManager的接口函数实现插件初始化;

2)除了本例中的binary ,CB还支持 ,这是一个轻量级的插件功能,通过squirrel来支持;

3) /debugger 实现了对其他编译器、调试器的统一接口;

Continue reading Code::Blocks中Plugin的实现原理 - 全文阅读

C::B IDE Plugin插件简介

Author: Bryan Wu@CBForge (cbforge at gmail dot com)转载请保留

plugins 众所周知CB的一个优点就是开放式架构提供灵活的插件开发和支持,我们也相信在今后的发展上插件对CB的贡献会越来越大。

下面是现有核心插件和贡献插件的简介列表:

 

Core Plugins 核心插件(系统初始化时会自动加载,由CB官方开发团队维护)

The core plugins are installed by default and offer the basic functions of Code::Blocks. The core plugins are maintained / developed by the official development team.

Autosave

Saves project files between intervals.

Class Wizard

Provides wizard for creating new classes.

Code Completion[这个插件非常重要,现在处于重写阶段,估计很快会合大家见面]

Provides functionality and class browser.

Continue reading C::B IDE Plugin插件简介 - 全文阅读

Contact us

Admin: Bryan Wu