By Bryan Wu, on 五月 26th, 2009, Category: C++ Programming, Code::Blocks, Open Source
Tags: C++, code blocks, cross platform, FreeBSD, LGPL, Linux, Multimedia library, SDL, windows
SDL - Simple DirectMedia Layer, is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. It is used by MPEG playback software, emulators, and many popular games, including the award winning Linux port of "Civilization: Call To Power."
SDL supports Linux, Windows, Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. The code contains support for AmigaOS, Dreamcast, Atari, AIX, OSF/Tru64, RISC OS, SymbianOS, and OS/2, but these are not officially supported. SDL is written in C, but works with C++ natively, and has bindings to several other languages, including Ada, C#, D, Eiffel, Erlang, Euphoria, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby, Smalltalk, and Tcl. SDL is distributed under GNU LGPL version 2. This license allows you to use SDL freely in commercial programs as long as you link with the dynamic library. – libsdl.org
Continue reading Setting up Code::Blocks to work with SDL - 多媒体编程库 - 全文阅读
By Bryan Wu, on 五月 25th, 2009, Category: C++ Programming, CodeLite IDE, wxWidgets
Tags: accelerator, CodeLite IDE, GUI, plugin, Singleton Pattern, Splash Screen, wxApp, wxFrame, wxGTK, 代码分析, 插件
转载请注明出处,该文章来源于cbforge.com by Bryan Wu. CodeLite IDE的主应用程序类实现在文件 /liteeditor/app.cpp中,系统初始化时,从wxApp继承的App类会调用OnInit成员函数,bool App::OnInit()
- If it is Linux or MAC system, block signal pipe first;
- wxSocketBase::Initialize();
- 打开fatal exception handler,假如系统crash,会调用wxApp::OnFatalException,在此处可以采集一些调试信息;
- InitXmlResource:通过wxMemoryFSHandler加载资源文件到内存,包括很多PNG文件和xml文件;
- 调用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 }
};
- 设置各种目录,包括homeDir,installPath,CurDir,StartupDir等;
- Load Menu resource, rc/menu.xrc
- Initialize the configuration file locater,ConfFileLocator::Instance()->Initialize
- 初始化Manager类,该类从Singleton Pattern template而来;
- read the last frame size from the configuration file and initialise editor configuration files;
- 加入SingleInstance为真,我们需要通过调用wxSingleInstanceChecker来检查CodeLite运行实例是否唯一;
- Update PATH environment variable with the install directory and MinGW default installation (if exists)
- 显示splash screen,图片存储在 /images/splashscreen.png(可选,配置在GeneralInfo中)
- 重头戏来了,Frame::Initialize,初始化Frame中会包括很多内容,下面详述;
- update the accelerators table;
- 显示由第14步初始化的Frame并置为top window;
- 刚才第5步中解析的结果中如果有line,和input file,会依次打开并跳转至line-1行;
- 最后一步:通过wxLogMessage打印Install path和Startup Path信息,Over。
Continue reading CodeLite Initializaion analysis - 初始化流程分析(1) - 全文阅读
By Bryan Wu, on 五月 22nd, 2009, Category: C++ Programming, CodeLite IDE
Tags: C++, CodeLite IDE, Singleton Pattern, Template, 单件模式, 模板, 编程
CodeLite中实现了一个简单的Singleton Pattern模板并有10个模块使用了它,通过源码我们可以看到它并没有考虑多线程安全和垃圾回收等。
Singleton Pattern的作用是保证一个类仅有一个实例,并提供一个访问它的全局访问点。Singleton模式其实是对全局静态变量的一个取代策略,上面提到的Singleton模式的两个作用在C++中是通过如下的机制实现的:1)仅有一个实例,提供一个类的静态成员变量,大家知道类的静态成员变量对于一个类的所有对象而言是惟一的 2)提供一个访问它的全局访问点,也就是提供对应的访问这个静态成员变量的静态成员函数,对类的所有对象而言也是惟一的.在C++中,可以直接使用类域进行访问而不必初始化一个类的对象。
Continue reading Codelite代码分析之 Singleton Pattern Template实现及应用 - 全文阅读
通过点击菜单Workspace->Create New Project,系统会 1)调用:Frame::OnProjectNewProject
2) 该函数中将创建对话框 NewProjectDlg,其中会读取 templates/projects目录下所有项目模板文件和编译器列表
3) 读取从第二步对话框中得到的数据并调用Manager::CreateProject ( ProjectData &data )创建项目。
所有的项目模板文件都是XML格式的,所以如果我们有新模板需求的话,可以定制自己的模板文件供用户使用。
Continue reading CodeLite代码分析之 – Create New Project流程 - 全文阅读
By Bryan Wu, on 五月 20th, 2009, Category: Code Insight, CodeLite IDE, wxWidgets
Tags: Code Insight, CodeLite IDE, Internationalization, wxWidgets, 中文, 国际化
在Codelite BBS上可以看到短时间内他们没有支持多语言的计划,所以只能自己动手啦。
第一步想支持中文的话,需要做3件事:
1)将所有需要支持翻译的字符串(包括在菜单、messagebox等等中的)从现有的wxT()替换成_();
2) 在程序初始化时支持读入和解析;
3)提供附加配置项以供用户选择。
下面是一篇网上转载的关于利用wxwidgets实现国际化支持的技术文章以供参考。
Continue reading CodeLite to CodeInsight task 1: Internationalization - 全文阅读
By Bryan Wu, on 五月 14th, 2009, Category: CodeLite IDE, wxWidgets
Tags: C++, code blocks, CodeLite IDE, cross platform, GPL, MinGW, plugin, wxWidgets, 开放源代码, 插件
Bryan @ CBForge:
本来打算整合cscope到code::blocks IDE中实现函数调用查找等功能,代码写了一半,发现CodeLite已经整合的很好了。:(
而且CodeLite IDE是一个轻量级的C、C++开发环境,其中很多功能非常适合开发一个开源版本的sourceinsight。
下面转载一篇介绍CodeLite的文章给大家。 Continue reading CodeLite IDE介绍 - 全文阅读
By Bryan Wu, on 五月 11th, 2009, Category: Code::Blocks, wxWidgets
Tags: code blocks, Debian, Linux, SVN, wxGTK, wxWidgets, 跨平台
研究跨平台开发,选择了wxWidgets和Code::Blocks搭挡,那么编译wxGTK和Code::Blocks最新的SVN版本(不选择Code::Blocks 8.02的原因是现在的SVN版本修复了8.02大量BUG,而且使用最新的SVN版本,同时报告使用中出现的问题,本身也是对Code::Blocks开发的支持)就不可避免了。 在Ubuntu下编译,两都都很顺利,但当基于Debian Lenny系统来编译时,CB却出现了问题:
codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory
就是这个错误,导致CB根本无法启动。试着把相应文件拷贝到codeblocks主程序所在的/usr/local/bin目录中(还是Windows的思维),仍然出错。经查找资料,发现此时只要把libcodeblocks.so.0所在的目录加入环境变量中就可以了。
sudo /etc/ld.so.conf #编译该文件 /usr/local/lib #将该行加入到该文件的末尾 sudo ldconfig #重新配置
这样就可以正常启动Code::Blocks了。
Continue reading Debian Lenny编译wxWidgets与Code::Blocks SVN版 - 全文阅读
By Bryan Wu, on 五月 6th, 2009, Category: Code::Blocks, wxWidgets
Tags: C++, code blocks, GPL, GUI, RAD, wxSmith, wxWidgets
wxSmith在CB中可以协助你快速开发wxWidgets界面部分。
Comparison of wxSmith features
Here is a list of wxSmith features when compared to other wxWidgets RAD solutions.
Note that support for new features are added on a daily basis for some of these RADs.
Contents
[hide]
General information
Basic general information about the RADs: developer, license/price etc.
RAD Developer Cost (USD) Open source Software licence
wxSmith Bartlomiej Swiecki Free Yes GPL
Continue reading 关于wxSmith与其他RAD之间的比较 - 全文阅读
By Bryan Wu, on 四月 24th, 2009, Category: Code::Blocks, wxWidgets
[摘要] Code::Block、MinGW 和 wxWidgets 分别是三个著名的开源项目,分别是 IDE、编译器和界面库。由这三样搭建起来的全开源纯c++开发环境,功能不逊色于Visual C++,由于是开源的,这样的环境还是免费的,并且是跨平台的。 CodeBlocks 简介:
Code::Block、MinGW 和 wxWidgets 分别是三个著名的开源项目,分别是 IDE、编译器和界面库。由这三样搭建起来的全开源纯c++开发环境,功能不逊色于Visual C++,由于是开源的,这样的环境还是免费的,并且是跨平台的。
Code::Blocks是一个开源、免费、跨平台的c++ IDE。官方网站上称其能满足最苛刻的用户的需求。虽有点夸张,但既然敢这样说,也说明它的功能肯定不差。可扩展插件,有插件向导功能,让你很方便的创建 自己的插件。Code::Blocks是用c++编写的(用wxWidgets库),捆绑了MinGW编译器。
突出特点: 开源(遵循GPLv3规范)、跨平台(可在windows和linux平台下运行)、GNU c++编写、可扩展插件、devpack支持(可选)。
欲知更多可以访问官方网站: http://www.codeblocks.org/
From: http://www.enet.com.cn/article/2008/0327/A20080327198633.shtml
Page 10 of 10 « First ... « 6 7 8 9 10
|
|
|