Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 27102) +++ trunk/src/global_typedefs.h (revision 27103) @@ -83,6 +83,7 @@ typedef unsigned int pcb_cardinal_t; typedef struct pcb_color_s pcb_color_t; typedef struct pcb_clrcache_s pcb_clrcache_t; +typedef struct pcb_pixmap_s pcb_pixmap_t; typedef struct pcb_action_s pcb_action_t; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 27102) +++ trunk/src/hid.h (revision 27103) @@ -154,6 +154,27 @@ PCB_HID_DOCK_max } pcb_hid_dock_t; +struct pcb_pixmap_t { + long size; /* total size in memory */ + long sx, sy; /* x and y dimensions */ + unsigned char tr, tg, tb; /* color of the transparent pixel */ + unsigned int hash; /* precalculated hash value */ + unsigned char *p; /* pixel array in r,g,b rows of sx long each */ + + void *hid_data; /* HID's version of the pixmap */ + + /* transformation info */ + pcb_pixmap_t *neutral; /* NULL for pixmaps in neutral position; for transformed pixmaps reference back to the 'parent' */ + pcb_angle_t tr_rot; /* rotation angle (0 if not transformed) */ + unsigned xmirror:1; /* whether the pixmap is mirrored along the x axis (vertical mirror) */ + unsigned ymirror:1; /* whether the pixmap is mirrored along the y axis (horizontal mirror) */ + + unsigned transp_valid:1; /* 1 if transparent pixel is available */ + unsigned hash_valid:1; /* 1 if the has value has been calculated */ + unsigned hid_data_valid:1; /* 1 if hid_data is already generated and no data changed since - maintained by core, HIDs don't need to check */ +}; + + extern int pcb_dock_is_vert[PCB_HID_DOCK_max]; /* 1 if a new dock box (parent of a new sub-DAD) should be a vbox, 0 if hbox */ extern int pcb_dock_has_frame[PCB_HID_DOCK_max]; /* 1 if a new dock box (parent of a new sub-DAD) should be framed */ @@ -313,6 +334,10 @@ void (*fill_polygon_offs)(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y, pcb_coord_t dx, pcb_coord_t dy); void (*fill_rect)(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); + void (*draw_pixmap)(pcb_hid_t *hid, pcb_coord_t x, pcb_coord_t y, const pcb_pixmap_t *pixmap); + void (*init_pixmap)(pcb_hid_t *hid, const pcb_pixmap_t *pixmap); + void (*uninit_pixmap)(pcb_hid_t *hid, const pcb_pixmap_t *pixmap); + /* This is for the printer. If xval_ and yval_ are zero, a calibration page is printed with instructions for calibrating your printer. After calibrating, nonzero xval_ and