Hi aal,
I am trying to draw different shapes in BREW MP. itís a mob OS by Qualcomm. The programming is in C.
The operation is Iíve to draw different shapes on screen based on the selected button. But before drawing the next shape I need to store the values of old shapes which I had drew. So I need to maintain data structure for each shapes. When I press particular button(say circle) after drawing that circle values need to be stored in linked list before drawing next shape.

Iíve taken a linked list after drawing each shape add it as a node to linked list then before calling new shape traverse this list n draw all available shapes.

for that i've bulit union inside a structure with type_def

Expand|Select|Wrap|Line Numbers

struct shapes{

int type_in_union;

union draw{

struct line lines;

struct ellipse ellipses;

struct rect rects;

struct polygon polygons;

}draw;

}shapes1;

struct line{

int sx,sy;

int ex,ey;

}line;

struct ellipse{

int cx,cy;

int wx;

int wy;

}ellipse;

struct rect{

int x,y;

int dx,dy;

}rect;

struct polygon{

int len;

struct point *points;

}poly;

struct point{

int x,y;

}points;

now i want to dump after each operation(each shape ) that structure into the linked list so that when next time before drawing any new shape i can call all the previous shapes i had drew using linked list .