lightblue
Project home

Introduction

Lightblue is a set of tools and libraries that
provide enchanced C++ support for the QUALCOMM's BREW
platform that are widely
used for developing mobile applications and games.

Limitaions of the current Brew SDK

QUALCOMM’s Binary
Runtime Environment for Wireless® (BREW®) follows an
object-oriented design, which exposes its API through BREW
Interfaces. However, by some reason, BREW Interfaces are declared as C
structures instead of C++ classes. This makes them hard to use and
extend.

The other major limitation of the current Brew toolchain is the
lack of static and global variable support.
Code that contains static or global variables will result in linker
error when the "ropi" is on. This makes it difficult for some widely
adopted practices, such as Singleton pattern, to be efficiently
implemented. Porting existing C++ code to the Brew platform is also
impossible to be done without significant structural changes.

Lightblue's solution

Lightblue provides following components to address these issues:

Lightblue C++ wrapper library
(lbcw):Declares C++
classes that are binary compatible to those Interfaces declared in the
BREW SDK without losing any space or time efficiency comparing to the C
code. Brew interfaces can be used exactly like C++ objects. For
example,
pIShell->CreateInstance(ID,ppobj) instead of
ISHELL_CreateInstance(pIShell,ID,ppobj).

Lightblue mod generater( lbmg.exe): A post
linker that generates self relocated MOD files from ELF files. Static
and global varialbes are supported. C++ global objects are also
supported, that means the constructor of global objects are called
automatically before the entry point of the MOD file is called.

Examples

Programs using lightblue are compact and object oriented because
lightblue re-declares all BREW Interfaces as abstract C++ classes so
that their instance could be accessed as ordinary c++ objects. You can
also create C++ classes that extend BREW interfaces, which makes
writing BREW Extensions an easy task.