include/mb_types.h File Reference

#include <cairo.h>
#include "mb_tools.h"
#include "mb_observer.h"

Go to the source code of this file.

Classes

struct  _paint
 Base of paint types. More...
struct  _shnode
struct  _area
struct  _geo
 Geometry data of a shape or a group of shape. More...
struct  _coord
 A coordination system. More...
struct  _shape
 A grahpic shape. More...

Defines

#define PNTF_FREE   0x1
#define GEF_DIRTY   0x1
#define GEF_HIDDEN   0x2
#define GEF_FREE   0x4
#define geo_get_shape(g)   ((g)->shape)
#define geo_set_shape(g, sh)   do {(g)->shape = sh;} while(0)
#define _geo_is_in(a, s, w)   ((a) >= (s) && (a) < ((s) + (w)))
#define geo_pos_is_in(g, _x, _y)
#define COF_DIRTY   0x1
#define COF_HIDDEN   0x2
#define COF_OWN_CANVAS   0x4
#define COF_SKIP_TRIVAL   0x8
#define COF_FREE   0x10
#define preorder_coord_skip_subtree(sub)   do { (sub)->flags |= COF_SKIP_TRIVAL; } while(0)
#define coord_hide(co)
#define coord_show(co)   do { co->flags &= ~COF_HIDDEN; } while(0)
#define coord_get_mouse_event(coord)   ((coord)->mouse_event)
#define sh_get_mouse_event_subject(sh)   ((sh)->geo->mouse_event)
#define sh_hide(sh)
#define sh_show(sh)

Typedefs

typedef float co_aix
typedef struct _shape shape_t
typedef struct _geo geo_t
typedef struct _area area_t
typedef struct _shnode shnode_t
typedef struct _paint paint_t
typedef struct _coord coord_t
 A coordination system.

Enumerations

enum  { SHT_UNKNOW, SHT_PATH, SHT_TEXT, SHT_RECT }

Functions

int is_overlay (area_t *r1, area_t *r2)
void area_init (area_t *area, int n_pos, co_aix pos[][2])
void geo_init (geo_t *g)
void geo_from_positions (geo_t *g, int n_pos, co_aix pos[][2])
void geo_mark_overlay (geo_t *g, int n_others, geo_t **others, int *n_overlays, geo_t **overlays)
void coord_init (coord_t *co, coord_t *parent)
 Initialize a coord object.
void coord_trans_pos (coord_t *co, co_aix *x, co_aix *y)
co_aix coord_trans_size (coord_t *co, co_aix size)
void compute_aggr_of_coord (coord_t *coord)
void update_aggr_matrix (coord_t *start)
 Update aggregate matrices of elements under a sub-tree.
coord_tpreorder_coord_subtree (coord_t *root, coord_t *last)
coord_tpostorder_coord_subtree (coord_t *root, coord_t *last)
void preorder_coord_skip_subtree (coord_t *subroot)


Define Documentation

#define _geo_is_in ( a,
s,
 )     ((a) >= (s) && (a) < ((s) + (w)))

Definition at line 72 of file mb_types.h.

#define COF_DIRTY   0x1

Definition at line 123 of file mb_types.h.

#define COF_FREE   0x10

Definition at line 131 of file mb_types.h.

#define COF_HIDDEN   0x2

A coord is hidden.

Definition at line 124 of file mb_types.h.

#define COF_OWN_CANVAS   0x4

A coord owns a canvas or inherit it from an ancestor.

Definition at line 125 of file mb_types.h.

#define COF_SKIP_TRIVAL   0x8

temporary skip descendants when trivaling.

Definition at line 128 of file mb_types.h.

#define coord_get_mouse_event ( coord   )     ((coord)->mouse_event)

Definition at line 148 of file mb_types.h.

#define coord_hide ( co   ) 

Value:

do {                          \
        (co)->flags |= COF_HIDDEN;    \
    } while(0)

Definition at line 143 of file mb_types.h.

#define coord_show ( co   )     do { co->flags &= ~COF_HIDDEN; } while(0)

Definition at line 147 of file mb_types.h.

#define GEF_DIRTY   0x1

Definition at line 60 of file mb_types.h.

#define GEF_FREE   0x4

Definition at line 62 of file mb_types.h.

#define GEF_HIDDEN   0x2

The geo is hidden.

Definition at line 61 of file mb_types.h.

#define geo_get_shape (  )     ((g)->shape)

Definition at line 70 of file mb_types.h.

#define geo_pos_is_in ( g,
_x,
_y   ) 

Value:

(_geo_is_in(_x, (g)->cur_area->x, (g)->cur_area->w) &&  \
     _geo_is_in(_y, (g)->cur_area->y, (g)->cur_area->h))

Definition at line 73 of file mb_types.h.

#define geo_set_shape ( g,
sh   )     do {(g)->shape = sh;} while(0)

Definition at line 71 of file mb_types.h.

#define PNTF_FREE   0x1

Definition at line 33 of file mb_types.h.

#define preorder_coord_skip_subtree ( sub   )     do { (sub)->flags |= COF_SKIP_TRIVAL; } while(0)

Definition at line 141 of file mb_types.h.

#define sh_get_mouse_event_subject ( sh   )     ((sh)->geo->mouse_event)

Definition at line 176 of file mb_types.h.

#define sh_hide ( sh   ) 

Value:

do {                                 \
        (sh)->geo->flags |= GEF_HIDDEN;      \
    } while(0)

Definition at line 177 of file mb_types.h.

#define sh_show ( sh   ) 

Value:

do {                                            \
        (sh)->geo->flags &= ~GEF_HIDDEN;                \
    } while(0)

Definition at line 181 of file mb_types.h.


Typedef Documentation

typedef struct _area area_t

Definition at line 11 of file mb_types.h.

typedef float co_aix

Definition at line 8 of file mb_types.h.

typedef struct _coord coord_t

A coordination system.

It have a transform function defined by matrix to transform coordination from source space to target space. Source space is where the contained is drawed, and target space is where the coordination of parent container of the element represented by this coord object.

inline_dotgraph_1.dot

typedef struct _geo geo_t

Definition at line 10 of file mb_types.h.

typedef struct _paint paint_t

Definition at line 13 of file mb_types.h.

typedef struct _shape shape_t

Definition at line 9 of file mb_types.h.

typedef struct _shnode shnode_t

Definition at line 12 of file mb_types.h.


Enumeration Type Documentation

anonymous enum

Enumerator:
SHT_UNKNOW 
SHT_PATH 
SHT_TEXT 
SHT_RECT 

Definition at line 174 of file mb_types.h.


Function Documentation

void area_init ( area_t area,
int  n_pos,
co_aix  pos[][2] 
)

Note:
{x=0, y=0, w=0, h=0} geometry value for a n_pos=0 request can prevent cursor flasing for Cairo XLib. (see changeset 21db69d46835)

Definition at line 34 of file geo.c.

void compute_aggr_of_coord ( coord_t coord  ) 

Definition at line 41 of file coord.c.

void coord_init ( coord_t co,
coord_t parent 
)

Initialize a coord object.

The object is cleared and matrix was initialized to ID. The object is be a children of specified parent.

Definition at line 86 of file coord.c.

void coord_trans_pos ( coord_t co,
co_aix x,
co_aix y 
)

Definition at line 101 of file coord.c.

co_aix coord_trans_size ( coord_t co,
co_aix  size 
)

Definition at line 114 of file coord.c.

void geo_from_positions ( geo_t g,
int  n_pos,
co_aix  pos[][2] 
)

Definition at line 79 of file geo.c.

void geo_init ( geo_t g  ) 

Definition at line 73 of file geo.c.

void geo_mark_overlay ( geo_t g,
int  n_others,
geo_t **  others,
int *  n_overlays,
geo_t **  overlays 
)

Definition at line 83 of file geo.c.

int is_overlay ( area_t r1,
area_t r2 
)

Definition at line 30 of file geo.c.

coord_t* postorder_coord_subtree ( coord_t root,
coord_t last 
)

Definition at line 154 of file coord.c.

void preorder_coord_skip_subtree ( coord_t subroot  ) 

coord_t* preorder_coord_subtree ( coord_t root,
coord_t last 
)

Note:
Coords, marked with COF_SKIP_TRIVAL (for temporary), and descendants of them will not be trivaled and the flag with be removed after skipping them.

Definition at line 128 of file coord.c.

void update_aggr_matrix ( coord_t start  ) 

Update aggregate matrices of elements under a sub-tree.

A subtree is specified by the root of it. All elements in the subtree are effected by that changes of matrix of the subtree root.

Definition at line 50 of file coord.c.

SourceForge.net Logo