Liqbase library overview

(New page: =liqbase :: the core library= The formatting here is rubbish and I dunno how to fix it. This is preliminary outline documentation for my library and toolkit. it will be expanded upon over...)
m
Line 8: Line 8:
-
liqbase is a simplified interface to the computer.
+
liqbase started out as a collection of applications which show off the nokia internet tablet as a fast versatile handheld computer.
 +
It was the first application I have written in C in many years was and used by myself to learn about the various libraries and interactions on the nokia internet tablets.
 +
A proof of concept so to speak.
 +
 
 +
The library is aimed to correct the mistakes I made with the monolithic application and to provide a framework to continue building my applications.
It has been designed to make it as easy as possible to produce high performance touch sensitive applications.
It has been designed to make it as easy as possible to produce high performance touch sensitive applications.
-
The applications are resolution independent and capable of operating at high speed in with low cpu overheads.
+
The applications are resolution independent and capable of operating at high speed with low cpu overheads.
It contains a small set of classes which are usable for creating rich touchable GUI components.
It contains a small set of classes which are usable for creating rich touchable GUI components.
It has been written in C for both speed and expandability.
It has been written in C for both speed and expandability.
-
The core library has been written with expansion and translation in  mind and will be happy sitting in almost any operating system.
+
At present it is very specifically focused upon the Nokia internet tablet computers running linux.
 +
 
 +
it makes use of the following libraries:
-
At present it is very specifically targeted at the Linux platform and requires
 
*X11 window manager for the events.
*X11 window manager for the events.
*XVideo, an x11 graphics accelerator usually used for rendering video frames.
*XVideo, an x11 graphics accelerator usually used for rendering video frames.
Line 36: Line 41:
It is being constructed around a set of interrelated classes
It is being constructed around a set of interrelated classes
-
*liqapp core system functions global
+
*liqapp core system functions
-
*liqcanvas provides actual display backbuffer and event sink global
+
*liqcanvas provides actual display backbuffer and event sink
-
*liqimage native image class, allows alpha, files of type png and jpeg supported inst
+
*liqimage native image class, allows alpha, files of type png and jpeg supported
-
*liqfont a renderable font library, extensive caching, inst
+
*liqfont a renderable font library, extensive caching
-
*liqsketch a dynamic sketch built up from various strokes and points inst
+
*liqsketch a dynamic sketch built up from various strokes and points
-
*liqcliprect a physical rectangle within an image with direct drawing routines inst
+
*liqcliprect a physical rectangle within an image with direct drawing routines
-
Beyond the core there is a whole other set of classes dealing with layout and grouping.
+
Beyond the core there is a second layer of classes dealing with structured layout and rendering
-
*liqcell a single unit capable of holding or representing physical or meta data inst
+
*liqcell a single unit capable of holding or representing physical or meta data
-
*liqgraph a special resolution independent graphics interface which a cell uses inst
+
*liqgraph a special resolution independent graphics interface which a cell uses
-
The cell class is capable of raising and listening for events as well as being inheritable.
+
With these classes I will be able to construct the applications started inside liqbase
   
   
-
=class structure=
+
==class structure==
Most classes created in liqbase follow the same object pattern and contain the following default standard methods:
Most classes created in liqbase follow the same object pattern and contain the following default standard methods:
-
 
+
<PRE>
-
int class_new()
+
class *class_new()
{
{
// Create a brand new instance of the class
// Create a brand new instance of the class
}
}
-
int class_hold()
+
int class_hold(class *self)
{
{
// Add a reference to an existing instance
// Add a reference to an existing instance
}
}
-
int class_release()
+
int class_release(class *self)
{
{
// release a reference to an instance
// release a reference to an instance
Line 72: Line 77:
}
}
-
int class_free()
+
int class_free(class *self)
{
{
// release all memory for this instance
// release all memory for this instance
// call _release on all members of this class
// call _release on all members of this class
}
}
-
 
+
</PRE>
The reference counting is held as a private member inside the instance itself.
The reference counting is held as a private member inside the instance itself.
Line 85: Line 90:
   
   
-
Example Cell construction
+
==Example Cell construction==
A usual cycle goes like this
A usual cycle goes like this
-
 
+
<PRE>
void hello_world()
void hello_world()
{
{
-
liqcell * myform = liqcell_newwidget(“myform”,”form”, 340, 60);
+
    liqcell * myform = liqcell_newwidget(“myform”,”form”, 340, 60);
-
liqcell *l1               = liqcell_newwidget(“hello”,”label”, 60, 60);
+
    liqcell *l1 = liqcell_newwidget(“hello”,”label”, 60, 60);
-
liqcell *l2 = liqcell_newwidget(“world”,” label”, 60, 60);
+
    liqcell *l2 = liqcell_newwidget(“world”,” label”, 60, 60);
-
// do stuff with these instances and maybe create a tree of objects
+
    // do stuff with these instances and maybe create a tree of objects
-
liqcell_child_insert(myform , l1 );
+
    liqcell_child_insert(myform , l1 );
-
liqcell_child_insert(myform , l2 );
+
    liqcell_child_insert(myform , l2 );
-
liqcell_child_arrange_automatic(myform);
+
    liqcell_child_arrange_automatic(myform);
-
liqcell_show(myform);
+
    liqcell_show(myform);
-
// now we are finished release the root of the tree.   
+
    // now we are finished release the root of the tree.   
-
// all items inserted will be recursively released.
+
    // all items inserted will be recursively released.
-
liqcell_release(myform);
+
    liqcell_release(myform);
}
}
 +
</PRE>

Revision as of 20:25, 27 January 2009

liqbase :: the core library

The formatting here is rubbish and I dunno how to fix it. This is preliminary outline documentation for my library and toolkit. it will be expanded upon over the coming days

Note, this describes a library which is not currently available, however its precursor liqbase is available.


liqbase started out as a collection of applications which show off the nokia internet tablet as a fast versatile handheld computer. It was the first application I have written in C in many years was and used by myself to learn about the various libraries and interactions on the nokia internet tablets. A proof of concept so to speak.

The library is aimed to correct the mistakes I made with the monolithic application and to provide a framework to continue building my applications.

It has been designed to make it as easy as possible to produce high performance touch sensitive applications. The applications are resolution independent and capable of operating at high speed with low cpu overheads.

It contains a small set of classes which are usable for creating rich touchable GUI components. It has been written in C for both speed and expandability.

At present it is very specifically focused upon the Nokia internet tablet computers running linux.

it makes use of the following libraries:

  • X11 window manager for the events.
  • XVideo, an x11 graphics accelerator usually used for rendering video frames.
  • Gstreamer, for the camera
  • Esound for the audio output
  • xsp for the pressure sensitive mouse input
  • ttflib ttf font handling
  • libpng
  • libjpeg


graphics are rendered using the XV library using the YUV video format. This is a lower bandwidth video mode which has full resolution Luma, but half resolution Chroma.


It is being constructed around a set of interrelated classes

  • liqapp core system functions
  • liqcanvas provides actual display backbuffer and event sink
  • liqimage native image class, allows alpha, files of type png and jpeg supported
  • liqfont a renderable font library, extensive caching
  • liqsketch a dynamic sketch built up from various strokes and points
  • liqcliprect a physical rectangle within an image with direct drawing routines

Beyond the core there is a second layer of classes dealing with structured layout and rendering

  • liqcell a single unit capable of holding or representing physical or meta data
  • liqgraph a special resolution independent graphics interface which a cell uses

With these classes I will be able to construct the applications started inside liqbase


class structure

Most classes created in liqbase follow the same object pattern and contain the following default standard methods:

class *class_new()
{
	// Create a brand new instance of the class
}

int class_hold(class *self)
{
	// Add a reference to an existing instance
}

int class_release(class *self)
{
	// release a reference to an instance
	// if there are no more instances, call _free on the instance
}

int class_free(class *self)
{
	// release all memory for this instance
	// call _release on all members of this class
}

The reference counting is held as a private member inside the instance itself.

There is no concept of inheritance at this level, however once you have instances of cell classes (described in detail below) they follow generic inheritance rules and can expand.



Example Cell construction

A usual cycle goes like this


void hello_world()
{
    liqcell * myform		= liqcell_newwidget(“myform”,”form”, 340, 60);
    liqcell *l1			= liqcell_newwidget(“hello”,”label”, 60, 60);
    liqcell *l2 		= liqcell_newwidget(“world”,” label”, 60, 60);

    // do stuff with these instances and maybe create a tree of objects

    liqcell_child_insert(myform , l1 );
    liqcell_child_insert(myform , l2 );
    liqcell_child_arrange_automatic(myform);

    liqcell_show(myform);

    // now we are finished release the root of the tree.  
    // all items inserted will be recursively released.

    liqcell_release(myform);
}