#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_t * | preorder_coord_subtree (coord_t *root, coord_t *last) |
coord_t * | postorder_coord_subtree (coord_t *root, coord_t *last) |
void | preorder_coord_skip_subtree (coord_t *subroot) |
#define _geo_is_in | ( | a, | |||
s, | |||||
w | ) | ((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 | ) |
#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 | ) | ((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.
Definition at line 11 of file mb_types.h.
typedef float co_aix |
Definition at line 8 of file mb_types.h.
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.
Definition at line 10 of file mb_types.h.
Definition at line 13 of file mb_types.h.
Definition at line 9 of file mb_types.h.
Definition at line 12 of file mb_types.h.
anonymous enum |
void preorder_coord_skip_subtree | ( | coord_t * | subroot | ) |
void update_aggr_matrix | ( | coord_t * | start | ) |