Changeset 30 in Sophya
- Timestamp:
- Nov 1, 1996, 8:14:18 PM (29 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Makefile
r27 r30 1 1 CC := gcc 2 2 CXX := g++ 3 # General setup GNU Makefile for EROS. To be included in all makefiles. 4 # Define makefile variables according to CPU 5 # MACHEROSD = `uname | sed 's/-//'` i.e. { AIX HPUX OSF1 ULTRIX } 6 # 7 # Makefile variables set are: 8 # - Path to Exec, Include, Libs, Obj directories (from EROSBASEREP env. var.) 9 # i.e. variables LIB, OBJ, EXE, INC 10 #--------------------------------------------------------------------------- 11 12 # define MACHEROS from uname 13 MACHEROS := $(shell echo `uname`) 14 # define the -D option 15 MACHEROSD := $(shell echo `uname | sed 's/-//'`) 16 17 #- 18 #- Optimization option different for HP... 19 ifeq (${MACHEROS},HP-UX) 20 O := +O 21 else 22 O := -O 23 endif 24 #- 25 #- Define Makefile paths 26 #- 27 PP := ${EROSBASEREP}/${MACHEROS}/ 28 LIB := ${PP}/Libs/ 29 SLB := ${PP}/ShLibs/ 30 OBJ := ${PP}/Objs/ 31 EXE := ${PP}/Exec/ 32 INC := ${EROSBASEREP}/Include/ 33 CCI := ${INC}/CInc/ 34 CXI := ${INC}/CxxInc/ 35 GLB := ${GNU}/${MACHEROS}/lib/ 36 #-- 37 38 #- 39 #- Define default compilation flags 40 #-- 41 ifeq (${MACHEROS},HP-UX) 42 CFLAGS := -Aa 43 FFLAGS := -Aa -I${INC} -D${MACHEROSD} 44 CPPFLAGS := -I${INC} -D${MACHEROSD} \ 45 -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE 46 else 47 FFLAGS := -I${INC} -D${MACHEROSD} 48 CFLAGS := -g -O -Wall -Wpointer-arith \ 49 -Wmissing-prototypes -Wsynth -I$(INC) 50 CXXFLAGS := $(CFLAGS) -I$(CXI) 51 endif 52 AR := /usr/bin/ar 53 ARFLAGS := -rcs 54 55 56 ifeq ($(CC), gcc) 57 CFLAGS := -g -O -Wall -Wpointer-arith \ 58 -Wmissing-prototypes -Wsynth -I$(INC) 59 //CXXFLAGS := $(CFLAGS) -fno-implicit-templates -I$(CXI) 60 CXXFLAGS := $(CFLAGS) -I$(CXI) 61 endif 62 63 #- redefine implicit rule. Les .o sont dans $(OBJ). 64 $(OBJ)%.o:%.c 65 $(COMPILE.c) -o $@ $< 66 67 $(OBJ)%.o:%.cc 68 $(COMPILE.cc) -o $@ $< 69 70 $(OBJ)%.o:%.f 71 $(COMPILE.f) -o $@ $< 72 73 #OSF1 74 #LDFC est f77 75 #LDFCFLAGS est rien 76 77 #parfois 78 #LDFC est cc 79 #LDFCFLAGS est -ltruc 80 81 #------------------------------------------------- End of Makefile.h ------- 3 include ../Mgr/Makefile.h 82 4 83 all: $(LIB)libPI.a 84 $(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pi menubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o5 all: $(LIB)libPI.a 6 $(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o 85 7 $(AR) $(ARFLAGS) $@ $? 86 8 87 $(OBJ)piapplgen.o: ./piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \9 $(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \ 88 10 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \ 89 11 pimenubargen.h pimenux.h pimenugen.h 90 $(OBJ)piapplx.o: ./piapplx.cc piapplx.h piapplgen.h pimsghandler.h \91 pi sysdep.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \92 pimenubar x.h pimenubargen.h pimenux.h pimenugen.h93 $(OBJ)pibwdggen.o: ./pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \12 $(OBJ)piapplx.o: piapplx.cc piapplx.h piapplgen.h pimsghandler.h pisysdep.h \ 13 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \ 14 pimenubargen.h pimenux.h pimenugen.h 15 $(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \ 94 16 pimsghandler.h 95 $(OBJ)pibwdgx.o: ./pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \17 $(OBJ)pibwdgx.o: pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \ 96 18 piwdggen.h pimsghandler.h pixtbaseP.h pixtbase.h 97 $(OBJ)picmap.o: ./picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h98 $(OBJ)picmapgen.o: ./picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h99 $(OBJ)picmapx.o: ./picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \19 $(OBJ)picmap.o: picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h 20 $(OBJ)picmapgen.o: picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h 21 $(OBJ)picmapx.o: picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \ 100 22 picmapgen.h pisysdep.h 101 $(OBJ)picontainergen.o: ./picontainergen.cc picontainergen.h pisysdep.h \23 $(OBJ)picontainergen.o: picontainergen.cc picontainergen.h pisysdep.h \ 102 24 piwdgx.h piwdggen.h pimsghandler.h 103 $(OBJ)picontainerx.o: ./picontainerx.cc picontainerx.h pisysdep.h \25 $(OBJ)picontainerx.o: picontainerx.cc picontainerx.h pisysdep.h \ 104 26 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h 105 $(OBJ)pidemo.o: ./pidemo.cc \ 106 $(INC)perrors.h \ 107 $(INC)exceptions.h \ 108 $(INC)defs.h \ 109 $(INC)fitsimage.h \ 110 $(INC)cimage.h \ 111 $(INC)rzimage.h \ 112 $(INC)rzvect.h \ 113 $(INC)machine.h \ 114 $(INC)datatypes.h \ 115 $(INC)fitsheader.h \ 116 $(INC)fitskeys.h pidemo.h \ 117 pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \ 118 picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \ 119 pimenux.h pimenugen.h piwindowx.h piwindowgen.h pioptmenux.h \ 120 pioptmenugen.h pistdwdgx.h pistdwdggen.h pifilechox.h pifilechogen.h \ 121 piimage.h $(INC)lut.h \ 122 pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \ 123 picmapgen.h pihisto.h piscdrawwdg.h \ 124 $(INC)histos.h \ 125 $(INC)peida.h \ 126 $(INC)utils.h pidrawwin.h \ 127 $(INC)piup.h 128 $(OBJ)pidrawwin.o: ./pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \ 27 $(OBJ)pidrawwin.o: pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \ 129 28 piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \ 130 pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h 131 $(OBJ)pifilechogen.o: ./pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \ 29 pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h pistdwdgx.h \ 30 pistdwdggen.h 31 $(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \ 132 32 piwdggen.h pimsghandler.h 133 $(OBJ)pifilechox.o: ./pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \33 $(OBJ)pifilechox.o: pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \ 134 34 piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \ 135 35 picontainerx.h picontainergen.h 136 $(OBJ)pihisto.o: ./pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \ 137 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \ 138 $(INC)histos.h \ 36 $(OBJ)pihisto.o: pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \ 37 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \ 38 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \ 39 picontainergen.h $(INC)histos.h \ 139 40 $(INC)peida.h \ 140 41 $(INC)defs.h \ … … 142 43 $(INC)machine.h \ 143 44 $(INC)perrors.h \ 144 $(INC)exceptions.h 145 $(OBJ)piimage.o: ./piimage.cc piimage.h \ 146 $(INC)cimage.h \45 $(INC)exceptions.h \ 46 $(INC)peidainit.h 47 $(OBJ)piimage.o: piimage.cc piimage.h $(INC)cimage.h \ 147 48 $(INC)rzimage.h \ 148 49 $(INC)rzvect.h \ … … 150 51 $(INC)defs.h \ 151 52 $(INC)exceptions.h \ 53 $(INC)peidainit.h \ 152 54 $(INC)perrors.h \ 55 $(INC)imaginit.h \ 153 56 $(INC)datatypes.h \ 154 $(INC)lut.h pisysdep.h \155 pipixmap x.h pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \57 $(INC)lut.h pisysdep.h pipixmapx.h \ 58 pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \ 156 59 pimsghandler.h picmap.h picmapx.h picmapgen.h pistdwdgx.h \ 157 pistdwdggen.h \158 $(INC)imageop.h \60 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \ 61 picontainergen.h $(INC)imageop.h \ 159 62 $(INC)fitsimage.h \ 160 63 $(INC)fitsheader.h \ 161 $(INC)fitskeys.h 162 $(OBJ)pimenubargen.o: ./pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \ 64 $(INC)erosio.h \ 65 $(INC)fitskeys.h \ 66 $(INC)erostape.h \ 67 $(INC)strutil.h \ 68 $(INC)ptrarray.h \ 69 $(INC)voidptrarray.h \ 70 $(INC)basearray.h \ 71 $(INC)peida.h \ 72 $(INC)utils.h \ 73 $(INC)array.h \ 74 $(INC)lockfile.h \ 75 $(INC)erostarfile.h \ 76 $(INC)dates.h \ 77 $(INC)tarlib.h 78 $(OBJ)pilistgen.o: pilistgen.cc pilistgen.h pisysdep.h piwdgx.h piwdggen.h \ 79 pimsghandler.h 80 $(OBJ)pilistx.o: pilistx.cc pilistx.h pilistgen.h pisysdep.h piwdgx.h \ 81 piwdggen.h pimsghandler.h picontainerx.h picontainergen.h 82 $(OBJ)pimenubargen.o: pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \ 163 83 pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \ 164 84 picontainerx.h picontainergen.h pimenubarx.h 165 $(OBJ)pimenubarx.o: ./pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \85 $(OBJ)pimenubarx.o: pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \ 166 86 pimenux.h pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h \ 167 87 piapplgen.h picontainerx.h picontainergen.h 168 $(OBJ)pimenugen.o: ./pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \88 $(OBJ)pimenugen.o: pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \ 169 89 pimsghandler.h 170 $(OBJ)pimenux.o: ./pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \90 $(OBJ)pimenux.o: pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \ 171 91 piwdggen.h pimsghandler.h 172 $(OBJ)pimsghandler.o: ./pimsghandler.cc pimsghandler.h173 $(OBJ)pioptmenugen.o: ./pioptmenugen.cc pioptmenugen.h pisysdep.h \92 $(OBJ)pimsghandler.o: pimsghandler.cc pimsghandler.h 93 $(OBJ)pioptmenugen.o: pioptmenugen.cc pioptmenugen.h pisysdep.h \ 174 94 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \ 175 95 pimenux.h pimenugen.h 176 $(OBJ)pioptmenux.o: ./pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \96 $(OBJ)pioptmenux.o: pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \ 177 97 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \ 178 98 pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h 179 $(OBJ)pipixmapgen.o: ./pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \ 99 $(OBJ)piperiodx.o: piperiodx.cc piperiodx.h \ 100 $(INC)periodic.h 101 $(OBJ)pipixmapgen.o: pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \ 180 102 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \ 181 103 picmapgen.h 182 $(OBJ)piperiodx.o: ./piperiodx.cc ./piperiodx.h $(INC)periodic.h 183 $(OBJ)pipixmapx.o: ./pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \ 104 $(OBJ)pipixmapx.o: pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \ 184 105 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \ 185 106 picmapx.h picmapgen.h 186 $(OBJ)piscdrawwdg.o: ./piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \ 187 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \ 188 $(INC)generalfit.h \ 107 $(OBJ)piscdrawwdg.o: piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \ 108 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \ 109 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \ 110 picontainergen.h $(INC)generalfit.h \ 189 111 $(INC)exceptions.h \ 190 112 $(INC)defs.h \ 113 $(INC)peidainit.h \ 191 114 $(INC)matrix.h \ 192 115 $(INC)peida.h \ … … 197 120 $(INC)pclassids.h \ 198 121 $(INC)cvector.h 199 $(OBJ)pistdwdggen.o: ./pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \122 $(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \ 200 123 piwdggen.h pimsghandler.h 201 $(OBJ)pistdwdgx.o: ./pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \124 $(OBJ)pistdwdgx.o: pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \ 202 125 piwdgx.h piwdggen.h pimsghandler.h 203 $(OBJ)piwdggen.o: ./piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \ 126 $(OBJ)piup.o: piup.cc $(INC)ctimer.h \ 127 $(INC)peida.h \ 128 $(INC)defs.h \ 129 $(INC)utils.h \ 130 $(INC)machine.h \ 131 $(INC)perrors.h \ 132 $(INC)exceptions.h \ 133 $(INC)peidainit.h \ 134 $(INC)imageop.h \ 135 $(INC)cimage.h \ 136 $(INC)rzimage.h \ 137 $(INC)rzvect.h \ 138 $(INC)imaginit.h \ 139 $(INC)datatypes.h \ 140 $(INC)fitsimage.h \ 141 $(INC)fitsheader.h \ 142 $(INC)erosio.h \ 143 $(INC)fitskeys.h \ 144 $(INC)erostape.h \ 145 $(INC)strutil.h \ 146 $(INC)ptrarray.h \ 147 $(INC)voidptrarray.h \ 148 $(INC)basearray.h \ 149 $(INC)array.h \ 150 $(INC)lockfile.h \ 151 $(INC)erostarfile.h \ 152 $(INC)dates.h \ 153 $(INC)tarlib.h piup.h 154 $(OBJ)piwdggen.o: piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \ 204 155 pisysdep.h piwdgx.h 205 $(OBJ)piwdgx.o: ./piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h \ 206 picontainerx.h pisysdep.h picontainergen.h 207 $(OBJ)piwindowgen.o: ./piwindowgen.cc piwindowgen.h pisysdep.h \ 156 $(OBJ)piwdgx.o: piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h picontainerx.h \ 157 pisysdep.h picontainergen.h 158 $(OBJ)piwindowgen.o: piwindowgen.cc piwindowgen.h pisysdep.h picontainerx.h \ 159 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h 160 $(OBJ)piwindowx.o: piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \ 208 161 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h 209 $(OBJ)piwindowx.o: ./piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \ 210 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h 211 $(OBJ)pixtbase.o: ./pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \ 162 $(OBJ)pixtbase.o: pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \ 212 163 piwdgx.h piwdggen.h pimsghandler.h pixtbase.h -
trunk/SophyaPI/PI/picmapgen.h
r2 r30 36 36 string const& Nom() const {return mNom;} 37 37 38 virtual PIColor GetColor(int n)=0; 38 39 virtual void AllocColor(PIColor const& col, int index)=0; 39 40 virtual void FreeColors()=0; // Desalloue les couleurs -
trunk/SophyaPI/PI/picmapx.cc
r2 r30 14 14 int n = nCols[id-1]; 15 15 mColors = new PIXColor[n]; 16 for(int i=0; i<n; i++) mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 16 mColRGB = new PIColor[n]; 17 for(int i=0; i<n; i++) 18 { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 19 mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; } 17 20 18 21 // printf("PIColorMapX::PIColorMapX(CMapId) %d %d \n", mNCol, Type()); … … 27 30 int n = nCols[id-1]; 28 31 mColors = new PIXColor[n]; 29 for(int i=0; i<n; i++) mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 32 mColRGB = new PIColor[n]; 33 for(int i=0; i<n; i++) 34 { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 35 mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; } 30 36 // printf("PIColorMapX::PIColorMapX(CMapId, int) %d %d \n", mNCol, Type()); 31 37 … … 41 47 int n = nCol; 42 48 mColors = new PIXColor[n]; 43 for(int i=0; i<n; i++) mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 49 mColRGB = new PIColor[n]; 50 for(int i=0; i<n; i++) 51 { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 52 mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; } 44 53 // printf("PIColorMapX::PIColorMapX(nom, nCol) %d %d \n", mNCol, Type()); 45 54 … … 52 61 { 53 62 delete[] mColors; 63 delete[] mColRGB; 64 } 65 66 67 /* --Methode-- */ 68 PIColor PIColorMapX::GetColor(int n) 69 { 70 PIColor picr; 71 picr.red = picr.green = picr.blue = 0; 72 73 if ((n<0) || (n >= NCol())) 74 { 75 PIColor picr; 76 picr.red = picr.green = picr.blue = 0; 77 return(picr); 78 } 79 return(mColRGB[n]); 54 80 } 55 81 … … 76 102 { 77 103 mColors[index] = myxcol.pixel; 104 mColRGB[index] = col; 78 105 // printf("PIColorMapX::AllocColor() RGB= %d %d %d \n", 79 106 // (int) col.red, (int) col.blue, (int) col.green); … … 103 130 104 131 for (int i=0; i<mNCol; i++) 105 mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 132 { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen()); 133 mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; } 106 134 107 135 printf("PIColorMapX::FreeColors() Type= %d mNCol= %d \n", … … 114 142 { 115 143 CopyFromGen(x); 116 for (int i=0; i<mNCol; i++) mColors[i] = ((PIColorMapX *)x)->mColors[i]; 144 for (int i=0; i<mNCol; i++) 145 { mColors[i] = ((PIColorMapX *)x)->mColors[i]; 146 mColRGB[i] = ((PIColorMapX *)x)->mColRGB[i]; } 117 147 } -
trunk/SophyaPI/PI/picmapx.h
r2 r30 18 18 { return ((index < mNCol) ? mColors[index] : 0); } ; 19 19 20 virtual PIColor GetColor(int n); 20 21 virtual void AllocColor(PIColor const& col, int index); 21 22 virtual void FreeColors(); … … 25 26 void CopyFrom(PIColorMapGen*); 26 27 27 PIXColor * mColors; // La table des couleurs ... 28 PIXColor * mColors; // La table des couleurs ... 29 PIColor * mColRGB; // Composantes RGB 28 30 }; 29 31 -
trunk/SophyaPI/PI/pimsghandler.h
r23 r30 18 18 PIMsg_DataChanged = 21, 19 19 PIMsg_Click = 22, 20 PIMsg_Press = 23 20 PIMsg_Press = 23, 21 PIMsg_Drag = 24, 22 23 PIMsg_Select = 31, 24 PIMsg_ClearSel = 32 25 21 26 }; 22 27 -
trunk/SophyaPI/PI/pistdwdggen.cc
r23 r30 26 26 27 27 28 /************* PIScaleGen ************/29 30 PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg,31 int /*min*/, int /*max*/, int sx, int sy, int px, int py)32 : PIWdg(par, nom, sx, sy, px, py)33 {34 SetMsg(msg);35 }36 37 PIScaleGen::~PIScaleGen()38 {}39 28 40 29 /************* PITextGen ************/ … … 64 53 65 54 55 /************* PIScaleGen ************/ 56 57 PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg, 58 bool /*horiz*/, int sx, int sy, int px, int py) 59 : PIWdg(par, nom, sx, sy, px, py) 60 { 61 SetMsg(msg); 62 } 63 64 PIScaleGen::~PIScaleGen() 65 {} 66 67 /************* PIScrollBarGen ************/ 68 69 PIScrollBarGen::PIScrollBarGen(PIContainerGen *par, char *nom, PIMessage msg, 70 bool /*horiz*/, int sx, int sy, int px, int py) 71 : PIWdg(par, nom, sx, sy, px, py) 72 { 73 SetMsg(msg); 74 } 75 76 PIScrollBarGen::~PIScrollBarGen() 77 {} 78 -
trunk/SophyaPI/PI/pistdwdggen.h
r23 r30 12 12 PILabelGen(PIContainerGen* par, char* nom, 13 13 int sx=10, int sy=10, int px=0, int py=0); 14 virtual ~PILabelGen();14 virtual ~PILabelGen(); 15 15 16 16 virtual long kind() {return ClassId; } … … 30 30 int sx=10, int sy=10, int px=0, int py=0, 31 31 PIBtnSign bsgn = PIBtn_Label); 32 virtual ~PIButtonGen();32 virtual ~PIButtonGen(); 33 33 34 34 virtual long kind() {return ClassId; } 35 36 35 virtual void ActivatePress(bool acp=false)=0; 37 36 … … 60 59 61 60 61 62 class PICheckBoxGen : public PIWdg 63 { 64 public: 65 66 enum {ClassId = 1030}; 67 68 PICheckBoxGen(PIContainerGen* par, char* nom, 69 PIMessage msg = PIMsg_Click, 70 int sx=10, int sy=10, int px=0, int py=0); 71 virtual ~PICheckBoxGen()=0; 72 virtual void SetState(bool st=false)=0; 73 virtual bool GetState()=0; 74 75 virtual long kind() {return ClassId; } 76 77 protected: 78 79 }; 80 81 62 82 class PIScaleGen : public PIWdg 63 83 { 64 84 public: 65 enum {ClassId = 10 30};85 enum {ClassId = 1040}; 66 86 67 87 PIScaleGen(PIContainerGen* par, char* nom, 68 PIMessage msg = PIMsg_Click,69 int min=0, int max=10,int sx=100, int sy=10, int px=0, int py=0);70 ~PIScaleGen();88 PIMessage msg = PIMsg_DataChanged, bool horiz=true, 89 int sx=100, int sy=10, int px=0, int py=0); 90 virtual ~PIScaleGen(); 71 91 72 92 virtual void SetMinMax(int min, int max) = 0; … … 78 98 protected: 79 99 80 81 100 }; 82 101 83 class PI CheckBoxGen : public PIWdg102 class PIScrollBarGen : public PIWdg 84 103 { 85 104 public: 105 enum {ClassId = 1050}; 86 106 87 enum {ClassId = 1040}; 107 PIScrollBarGen(PIContainerGen* par, char* nom, 108 PIMessage msg=PIMsg_DataChanged, bool vert=true, 109 int sx=10, int sy=100, int px=0, int py=0); 110 virtual ~PIScrollBarGen(); 88 111 89 PICheckBoxGen(PIContainerGen* par, char* nom,90 PIMessage msg = PIMsg_Click,91 int sx=10, int sy=10, int px=0, int py=0);92 virtual ~PICheckBoxGen()=0;93 virtual void SetState(bool st=false)=0;94 virtual bool GetState()=0;95 112 virtual void ActivateDrag(bool acd=false) = 0; 113 virtual void SetMinMax(int min, int max) = 0; 114 virtual void SetValue(int val) = 0; 115 virtual int GetValue() = 0; 116 virtual void SetSize(int sz) = 0; 117 virtual int GetSize() = 0; 118 96 119 virtual long kind() {return ClassId; } 97 120 … … 100 123 }; 101 124 102 103 104 125 #endif -
trunk/SophyaPI/PI/pistdwdgx.cc
r23 r30 221 221 222 222 223 /************* PICheckBoxX ************/ 224 #include <Xm/ToggleB.h> 225 226 // Fonction prive (CallBack) 227 static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld); 228 229 /* Nouvelle-Fonction */ 230 void toggb_action(Widget , XtPointer *usd, XtPointer *) 231 { 232 PICheckBoxX *picb; 233 picb = (PICheckBoxX *) usd ; 234 picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState()); 235 return; 236 } 237 238 /* --Methode-- */ 239 PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg, 240 int sx, int sy, int px, int py) 241 : PICheckBoxGen(par, nom, msg, sx, sy, px, py) 242 { 243 CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py); 244 XtAddCallback(XtWdg(), XmNvalueChangedCallback, 245 toggb_action, (XtPointer)this); 246 Arg warg[2]; 247 XtSetArg(warg[0],XmNhighlightThickness, 0); 248 XtSetValues(XtWdg(), warg, 1); 249 Manage(); 250 } 251 252 253 /* --Methode-- */ 254 PICheckBoxX::~PICheckBoxX() 255 {} 256 257 258 /* --Methode-- */ 259 void PICheckBoxX::SetState(bool st) 260 { 261 Arg warg[2]; 262 XtSetArg(warg[0],XmNset, st); 263 XtSetValues(XtWdg(), warg, 1); 264 return; 265 } 266 267 /* --Methode-- */ 268 bool PICheckBoxX::GetState() 269 { 270 int val; 271 Arg warg[2]; 272 XtSetArg(warg[0], XmNset, &val); 273 XtGetValues(XtWdg(), warg, 1); 274 return ((bool)val); 275 } 276 277 223 278 /************* PIScaleX ************/ 224 279 #include <Xm/Scale.h> … … 241 296 /* --Methode-- */ 242 297 PIScaleX::PIScaleX(PIContainerGen *par, char *nom, PIMessage msg, 243 int min, int max, int sx, int sy, int px, int py)244 : PIScaleGen(par, nom, msg, min, max, sx, sy, px, py)298 bool horiz, int sx, int sy, int px, int py) 299 : PIScaleGen(par, nom, msg, horiz, sx, sy, px, py) 245 300 { 246 301 int n=0; … … 248 303 CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py); 249 304 XtSetArg(warg[n], XmNshowValue, TRUE); n++; 250 if ( sx > sy)305 if (horiz) 251 306 { 252 307 XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++; … … 263 318 264 319 XtSetValues(XtWdg(), warg, n); 265 SetMinMax( min, max);266 SetValue( min);320 SetMinMax(1, 10); 321 SetValue(1); 267 322 XtAddCallback(XtWdg(), XmNvalueChangedCallback, 268 323 scale_action, (XtPointer)this); … … 312 367 XtGetValues(this->sdw, warg, n); 313 368 mVal = val; 314 return( val);369 return(mVal); 315 370 } 316 371 … … 322 377 } 323 378 324 /************* PICheckBoxX ************/ 325 #include <Xm/ToggleB.h> 379 380 381 /************* PIScrollBarX ************/ 382 383 #include <Xm/ScrollBar.h> 326 384 327 385 // Fonction prive (CallBack) 328 static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld); 329 330 /* Nouvelle-Fonction */ 331 void toggb_action(Widget , XtPointer *usd, XtPointer *) 332 { 333 PICheckBoxX *picb; 334 picb = (PICheckBoxX *) usd ; 335 picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState()); 336 return; 337 } 338 339 /* --Methode-- */ 340 PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg, 341 int sx, int sy, int px, int py) 342 : PICheckBoxGen(par, nom, msg, sx, sy, px, py) 343 { 344 CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py); 345 XtAddCallback(XtWdg(), XmNvalueChangedCallback, 346 toggb_action, (XtPointer)this); 347 Arg warg[2]; 348 XtSetArg(warg[0],XmNhighlightThickness, 0); 349 XtSetValues(XtWdg(), warg, 1); 386 static void scrollbar_action(Widget w, XtPointer *usd, 387 XmScrollBarCallbackStruct *calld); 388 static void scrollbar_drag(Widget w, XtPointer *usd, 389 XmScrollBarCallbackStruct *calld); 390 391 void scrollbar_action(Widget, XtPointer *usd, 392 XmScrollBarCallbackStruct *calld) 393 { 394 PIScrollBar *pis; 395 396 pis = (PIScrollBar *) usd ; 397 pis->CBSetVal(calld->value); 398 pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value); 399 return; 400 } 401 402 void scrollbar_drag(Widget, XtPointer *usd, 403 XmScrollBarCallbackStruct *calld) 404 { 405 PIScrollBar *pis; 406 407 pis = (PIScrollBar *) usd ; 408 pis->CBSetVal(calld->value); 409 pis->Send(pis->Msg(), PIMsg_Drag, (void *)calld->value); 410 return; 411 } 412 413 /* --Methode-- */ 414 PIScrollBarX::PIScrollBarX(PIContainerGen *par, char *nom, PIMessage msg, 415 bool vert, int sx, int sy, int px, int py) 416 : PIScrollBarGen(par, nom, msg, vert, sx, sy, px, py) 417 { 418 int n=0; 419 Arg warg[3]; 420 421 CreateXtWdg(nom, xmScrollBarWidgetClass, NULL, sx, sy, px, py); 422 if (vert) 423 { 424 XtSetArg(warg[n], XmNorientation, XmVERTICAL); n++; 425 XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_BOTTOM); n++; 426 } 427 else 428 { 429 XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++; 430 XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++; 431 } 432 XtSetValues(XtWdg(), warg, n); 433 mAcD = false; 434 mVal = -1; 435 mMin = mMax = 0; 436 mSz = 0; 437 SetMinMax(0, 100); 438 SetSize(10); 439 SetValue(0); 440 XtAddCallback(XtWdg(), XmNvalueChangedCallback, 441 scrollbar_action, (XtPointer)this); 350 442 Manage(); 351 443 } 352 444 353 354 /* --Methode-- */ 355 PICheckBoxX::~PICheckBoxX() 445 /* --Methode-- */ 446 PIScrollBarX::~PIScrollBarX() 356 447 {} 357 448 358 449 359 450 /* --Methode-- */ 360 void PICheckBoxX::SetState(bool st) 361 { 362 Arg warg[2]; 363 XtSetArg(warg[0],XmNset, st); 364 XtSetValues(XtWdg(), warg, 1); 365 return; 366 } 367 368 /* --Methode-- */ 369 bool PICheckBoxX::GetState() 451 void PIScrollBarX::ActivateDrag(bool acd) 452 { 453 if (mAcD == acd) return; 454 455 if (mAcD) 456 XtRemoveCallback(XtWdg(), XmNdragCallback, 457 scrollbar_drag, (XtPointer)this); 458 else 459 XtAddCallback(XtWdg(), XmNdragCallback, 460 scrollbar_drag, (XtPointer)this); 461 mAcD = acd; 462 return; 463 } 464 465 /* --Methode-- */ 466 void PIScrollBarX::SetMinMax(int min, int max) 467 { 468 if (min >= max) max = min+100; 469 if (mVal < min) mVal = min; 470 if (mVal > max) mVal = max; 471 int n=0; 472 Arg warg[3]; 473 XtSetArg(warg[n], XmNminimum, min); n++; 474 XtSetArg(warg[n], XmNmaximum, max); n++; 475 XtSetArg(warg[n], XmNvalue, mVal); n++; 476 XtSetValues(XtWdg(), warg, n); 477 mMin = min; mMax = max; 478 return; 479 } 480 481 482 /* --Methode-- */ 483 void PIScrollBarX::SetValue(int val) 484 { 485 int n=0; 486 if (val < mMin) val = mMin; 487 if (val > mMax) val = mMax; 488 Arg warg[2]; 489 XtSetArg(warg[n], XmNvalue, val); n++; 490 XtSetValues(this->sdw, warg, n); 491 mVal = val; 492 return; 493 } 494 495 /* --Methode-- */ 496 int PIScrollBarX::GetValue() 370 497 { 371 498 int val; 372 Arg warg[2]; 373 XtSetArg(warg[0], XmNset, &val); 374 XtGetValues(XtWdg(), warg, 1); 375 return ((bool)val); 376 } 499 int n=0; 500 Arg warg[2]; 501 XtSetArg(warg[n], XmNvalue, &val); n++; 502 XtGetValues(this->sdw, warg, n); 503 mVal = val; 504 return(mVal); 505 } 506 507 /* --Methode-- */ 508 void PIScrollBarX::SetSize(int sz) 509 { 510 int n=0; 511 Arg warg[3]; 512 int szl; 513 514 szl = mMax-mMin; 515 if (sz > szl) sz = szl; 516 szl /= 100; 517 if (szl < 1) szl = 1; 518 if (sz < szl) sz = szl; 519 szl = sz/10; 520 if (szl < 1) szl = 1; 521 XtSetArg(warg[n], XmNsliderSize, sz); n++; 522 XtSetArg(warg[n], XmNpageIncrement, sz); n++; 523 XtSetArg(warg[n], XmNincrement, szl); n++; 524 XtSetValues(this->sdw, warg, n); 525 mSz = sz; 526 return; 527 } 528 529 /* --Methode-- */ 530 int PIScrollBarX::GetSize() 531 { 532 int sz; 533 int n=0; 534 Arg warg[2]; 535 XtSetArg(warg[n], XmNsliderSize, &sz); n++; 536 XtGetValues(this->sdw, warg, n); 537 mSz = sz; 538 return(mSz); 539 } 540 541 542 /* --Methode-- */ 543 void PIScrollBarX::CBSetVal(int val) 544 { 545 mVal = val; 546 return; 547 } 548 -
trunk/SophyaPI/PI/pistdwdgx.h
r23 r30 10 10 PILabelX(PIContainerGen *par, char *nom, 11 11 int sx=10, int sy=10, int px=0, int py=0); 12 virtual ~PILabelX();12 virtual ~PILabelX(); 13 13 14 14 }; … … 21 21 int sx=10, int sy=10, int px=0, int py=0, 22 22 PIBtnSign bsgn = PIBtn_Label); 23 virtual ~PIButtonX();23 virtual ~PIButtonX(); 24 24 25 25 virtual void ActivatePress(bool acp=false); … … 39 39 PITextX(PIContainerGen *par, char *nom, 40 40 int sx=10, int sy=10, int px=0, int py=0); 41 virtual ~PITextX();41 virtual ~PITextX(); 42 42 virtual void SetText(string const&); 43 43 virtual string GetText() const; … … 49 49 }; 50 50 51 class PIScaleX : public PIScaleGen52 {53 public:54 PIScaleX(PIContainerGen* par, char* nom, PIMessage msg=PIMsg_Click,55 int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);56 ~PIScaleX();57 58 virtual void SetMinMax(int min, int max);59 virtual void SetValue(int val);60 virtual int GetValue();61 62 virtual void CBSetVal(int val); // A ne pas utiliser pour Callback63 protected:64 int mVal, mMin, mMax;65 };66 67 51 68 52 class PICheckBoxX : public PICheckBoxGen … … 72 56 PIMessage msg=PIMsg_Click, 73 57 int sx=10, int sy=10, int px=0, int py=0); 74 virtual ~PICheckBoxX();58 virtual ~PICheckBoxX(); 75 59 76 60 virtual void SetState(bool st=false); … … 79 63 80 64 65 66 class PIScaleX : public PIScaleGen 67 { 68 public: 69 PIScaleX(PIContainerGen* par, char* nom, 70 PIMessage msg=PIMsg_DataChanged, bool horiz=true, 71 int sx=100, int sy=10, int px=0, int py=0); 72 virtual ~PIScaleX(); 73 74 virtual void SetMinMax(int min, int max); 75 virtual void SetValue(int val); 76 virtual int GetValue(); 77 78 virtual void CBSetVal(int val); // A ne pas utiliser (pour Callback Xt) 79 protected: 80 int mVal, mMin, mMax; 81 }; 82 83 84 85 class PIScrollBarX : public PIScrollBarGen 86 { 87 public: 88 PIScrollBarX(PIContainerGen* par, char* nom, 89 PIMessage msg = PIMsg_DataChanged, bool vert=true, 90 int sx=10, int sy=100, int px=0, int py=0); 91 ~PIScrollBarX(); 92 93 virtual void ActivateDrag(bool acd=false); 94 virtual void SetMinMax(int min, int max); 95 virtual void SetValue(int val); 96 virtual int GetValue(); 97 virtual void SetSize(int sz); 98 virtual int GetSize(); 99 100 virtual void CBSetVal(int val); // A ne pas utiliser (pour Callback Xt) 101 102 protected: 103 int mVal, mMin, mMax, mSz; 104 bool mAcD; 105 }; 106 107 81 108 typedef PILabelX PILabel; 82 109 typedef PIButtonX PIButton; 83 110 typedef PITextX PIText; 111 typedef PICheckBoxX PICheckBox; 84 112 typedef PIScaleX PIScale; 85 typedef PI CheckBoxX PICheckBox;113 typedef PIScrollBarX PIScrollBar; 86 114 87 115 -
trunk/SophyaPI/PI/pisysdep.h
r18 r30 12 12 #define PIOPTMENU_H "pioptmenumac.h" 13 13 #define PIFILECHO_H "pifilechomac.h" 14 #define PIPERIOD_H "piperiodmac.h" 14 #define PILIST_H "pilistmac.h" 15 15 16 #define PIAPP_H "piapplmac.h" 16 17 … … 31 32 #define PIOPTMENU_H "pioptmenux.h" 32 33 #define PIFILECHO_H "pifilechox.h" 33 #define PIPERIOD_H "piperiodx.h" 34 #define PILIST_H "pilistx.h" 35 34 36 #define PIAPP_H "piapplx.h" 35 37 -
trunk/SophyaPI/PI/piwindowgen.cc
r23 r30 8 8 { 9 9 SetMsgParent(par); 10 AutoHideOnClose(); 10 11 } 11 12 … … 22 23 { 23 24 24 if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this) )25 if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this) && mAHC) 25 26 Hide(); // Action par defaut en cas de MsgClose. 26 27 -
trunk/SophyaPI/PI/piwindowgen.h
r23 r30 22 22 virtual long kind() {return ClassId; } 23 23 24 inline void AutoHideOnClose(bool ahc=true) { mAHC = ahc; } 25 24 26 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); 25 27 26 28 protected: 27 29 PIWindowKind mWtyp; 30 bool mAHC; 28 31 }; 29 32
Note:
See TracChangeset
for help on using the changeset viewer.