#ifndef __CGM_H #define __CGM_H #define COORD_UNDEFINED 0x80000000 typedef struct { short x, y; } GPoint; typedef struct { unsigned short red, green, blue; } GColor; enum cgm_context { CGM_BACKGROUND, CGM_FOREGROUND, CGM_XOR, CGM_LINE, CGM_EDGE, CGM_FILL, CGM_TEXT, CGM_SYMBOL, CGM_MARKER, CGM_ENDCONTEXTS}; struct location { unsigned int chn_number, pic_number; int x1, y1, x2, y2; int marked; }; typedef struct location location; typedef char *(*GetChannelLabelProc) (location *loc); typedef void (*YourRepaintProcInt) (... /* anat_dia *diagram */); struct cgm_gpe { int type; /* graphical primitve element type */ long arg_len; /* length of argument */ void *arg; /* ptr to arguments */ struct cgm_gpe *next_gpe; /* ptr to graphical primitive element */ }; struct cgm_picture { char *name; int min_x, /* values of VDC EXTENT */ min_y, max_x, max_y; int background; GColor *cgm_color; struct cgm_gpe *first_gpe; /* ptr to graphical primitve element */ struct cgm_picture *next_picture; int ncgm_colors; }; struct anat_dia { char *name; int version; struct cgm_picture *first_picture; struct cgm_picture *pic; /* ptr to current picture */ int npictures; int actpic; int cgm_linecolor, cgm_edgecolor, cgm_fillcolor, cgm_markercolor, cgm_textcolor, cgm_symbolcolor, cgm_backgroundcolor; int monochrome; int width, height; int xoffset, yoffset; float factor; char *content; unsigned int content_length; int background; struct location *location; int nlocations; int actlocation; GetChannelLabelProc labelproc; int paint_channel_dot; YourRepaintProcInt repproc; /* called after drawing of anat. dia. */ void *aux_info; /* arbitrary information */ }; typedef struct anat_dia anat_dia; typedef struct cgm_picture cgm_picture; typedef struct cgm_gpe cgm_gpe; extern void init_anat_dia_int (anat_dia *diagram, int paint_channel_dot, GetChannelLabelProc labelproc, YourRepaintProcInt repproc); extern void delete_anat_dia_int (anat_dia *diagram); extern void set_width_height (anat_dia *diagram, int width, int height); extern void read_cgm_metafile (char *ptr, unsigned long length, anat_dia *anat_dia); extern void delete_cgm_metafile (anat_dia *diagram); extern void repaint_anat_dia (anat_dia *diagram); extern void set_anat_dia_picture (int no, anat_dia *diagram); extern void set_anat_dia_background (int color, anat_dia *diagram); extern int vdc2x_x (int x, anat_dia *diagram); extern int vdc2x_y (int x, anat_dia *diagram); extern int x2vdc_x (int x, anat_dia *diagram); extern int x2vdc_y (int x, anat_dia *diagram); extern int in_subwindow_vdc (int x, int y, anat_dia *diagram); extern int in_subwindow_x (int x, int y, anat_dia *diagram); extern char *get_anat_dia_picture_name (anat_dia *diagram); extern int get_anat_dia_npictures (anat_dia *diagram); extern void get_cgm_metafile (void **pptr, unsigned long *len, anat_dia *anat_dia); extern void read_channel_locations (void *ptr, unsigned long length, int nchans, anat_dia *diagram); extern void get_channel_locations (location **loc, unsigned long *no, anat_dia *diagram); extern void delete_channel_locations (anat_dia *diagram); extern void unmark_channel_locations (anat_dia *diagram); extern void delete_marked_locations (anat_dia *diagram); extern void mark_locations_within_x (int x1, int y1, int x2, int y2, anat_dia *diagram); extern void mark_unmark_locations_around_x (int x, int y, anat_dia *diagram); extern void append_locations (location *loc_new, int no, anat_dia *diagram); extern void draw_location (location *location, anat_dia *diagram); extern location *get_first_marked (anat_dia *diagram); extern location *get_next_marked (anat_dia *diagram); extern int around_marked (int x, int y, anat_dia *diagram); extern void draw_box (int x1, int y1, int x2, int y2, anat_dia *diagram); #endif