Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
afni_setup.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef _AFNI_SETUP_HEADER_
00008 #define _AFNI_SETUP_HEADER
00009
00010 #include "mcw_malloc.h"
00011
00012 #define PAL_FIGNORE -9753.0
00013 #define PAL_IIGNORE -1
00014 #define MAX_PALABEL 16
00015
00016 #ifndef MCW_strncpy
00017 #define MCW_strncpy(dest,src,n) \
00018 ( (void) strncpy( (dest) , (src) , (n)-1 ) , (dest)[(n)-1] = '\0' )
00019 #endif
00020
00021 #define SETUP_INIT_MODE 701
00022 #define SETUP_LATER_MODE 703
00023 #define SETUP_ENVIRON_MODE 707
00024
00025
00026
00027 typedef struct {
00028 int npane , mode ;
00029 float val[NPANE_MAX+1] ;
00030 int col[NPANE_MAX] ;
00031 } PBAR_palette ;
00032
00033 typedef struct {
00034 char label[32] ;
00035 PBAR_palette * psgn[NPANE_MAX+1] ;
00036 PBAR_palette * ppos[NPANE_MAX+1] ;
00037 } PBAR_palette_array ;
00038
00039 #define INIT_PALARR(name,lab) \
00040 do{ int qp ; (name) = XtNew(PBAR_palette_array) ; \
00041 MCW_strncpy((name)->label,(lab),32) ; \
00042 for( qp=0 ; qp <= NPANE_MAX ; qp++ ) \
00043 (name)->psgn[qp] = (name)->ppos[qp] = NULL ; } while(0)
00044
00045 typedef struct {
00046 int num , nall ;
00047 PBAR_palette_array ** par ;
00048 } PBAR_palette_table ;
00049
00050 #define INC_PALTAB 8
00051
00052 #define INIT_PALTAB(name) \
00053 ( (name) = XtNew(PBAR_palette_table) , \
00054 (name)->num = (name)->nall = 0 , \
00055 (name)->par = NULL )
00056
00057 #define ADDTO_PALTAB(name,pp) \
00058 do { if( (name)->num == (name)->nall ){ \
00059 (name)->nall += INC_PALTAB ; \
00060 (name)->par = (PBAR_palette_array **) \
00061 XtRealloc( (char *) (name)->par , \
00062 sizeof(PBAR_palette_array *) * (name)->nall ) ; \
00063 } \
00064 if( (pp) != NULL ){ \
00065 (name)->par[(name)->num] = (pp) ; ((name)->num)++ ; \
00066 } } while(0)
00067
00068 #define PALTAB_NUM(name) ( (name)->num )
00069 #define PALTAB_ARR(name,qq) ( (name)->par[(qq)] )
00070 #define PALTAB_ARR_LABEL(name,qq) ( (name)->par[(qq)]->label )
00071 #define PALTAB_ARR_PSGN(name,qq,ww) ( (name)->par[(qq)]->psgn[(ww)] )
00072 #define PALTAB_ARR_PPOS(name,qq,ww) ( (name)->par[(qq)]->ppos[(ww)] )
00073
00074 extern int label_in_PALTAB( PBAR_palette_table * , char * ) ;
00075 extern void AFNI_process_setup( char * , int , MCW_DC * ) ;
00076 extern int check_PBAR_palette( PBAR_palette * ) ;
00077 extern char * dump_PBAR_palette_table(int) ;
00078 extern void AFNI_pbar_CB( Widget , XtPointer , XtPointer ) ;
00079 extern void AFNI_pbar_EV( Widget , XtPointer , XEvent * , Boolean * ) ;
00080 extern char * AFNI_palette_label_CB( MCW_arrowval * , XtPointer ) ;
00081 extern void AFNI_palette_av_CB( MCW_arrowval * , XtPointer ) ;
00082 extern void load_PBAR_palette_array( MCW_pbar * , PBAR_palette_array * , int ) ;
00083 extern void AFNI_finalize_read_palette_CB( Widget , XtPointer , XtPointer ) ;
00084 extern void AFNI_set_pbar_top_CB( Widget, XtPointer , MCW_choose_cbs * ) ;
00085 extern void AFNI_finalize_write_palette_CB( Widget, XtPointer, MCW_choose_cbs * );
00086 extern void AFNI_finalize_saveim_CB( Widget, XtPointer, MCW_choose_cbs * );
00087 extern void AFNI_palette_tran_CB( MCW_arrowval * , XtPointer ) ;
00088
00089 #endif