# HG changeset patch # User yiluzhu # Date 1264515607 0 # Node ID d23e846951c5595b944e945cf37e5d9d7d936b8e # Parent adc615fe34e8445fe6da0aace09d9ae65b099b0e# Parent e8791bf8cc82f08fff7b920cdafa92574007f185 Merge with team wip diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/lib/config/variants.xml --- a/sbsv2/raptor/lib/config/variants.xml Mon Jan 25 11:44:33 2010 +0000 +++ b/sbsv2/raptor/lib/config/variants.xml Tue Jan 26 14:20:07 2010 +0000 @@ -5,7 +5,18 @@ These can be referenced from the command-line or in configurations. --> - + + + + + + + + + + + + diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/lib/flm/tools.xml --- a/sbsv2/raptor/lib/flm/tools.xml Mon Jan 25 11:44:33 2010 +0000 +++ b/sbsv2/raptor/lib/flm/tools.xml Tue Jan 26 14:20:07 2010 +0000 @@ -27,6 +27,7 @@ + @@ -35,6 +36,7 @@ + diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/lib/flm/tools2common.flm --- a/sbsv2/raptor/lib/flm/tools2common.flm Mon Jan 25 11:44:33 2010 +0000 +++ b/sbsv2/raptor/lib/flm/tools2common.flm Tue Jan 26 14:20:07 2010 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of the License "Eclipse Public License v1.0" @@ -18,17 +18,28 @@ ## Input parameters -OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) - ifeq ($(OSTYPE),cygwin) CDEFS.TOOLS2:=$(CDEFS.WIN32) $(CDEFS) CFLAGS:=$(CFLAGS.WIN32) $(CFLAGS) $(OPTION_GCC) COMPILER_PATH:=$(COMPILER_PATH.WIN32) +OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) else +ifneq ($(TOOLS2WIN32),) +# Build win32 tools in Linux +CDEFS.TOOLS2:=$(CDEFS.WIN32) $(CDEFS) +CFLAGS:=$(CFLAGS.WIN32) $(CFLAGS) $(OPTION_GCC) +COMPILER_PATH:=$(COMPILER_PATH.WIN32) +OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE) +else +# Build linux tools in Linux CDEFS.TOOLS2:=$(CDEFS.LINUX) $(CDEFS) CFLAGS:=$(CFLAGS) $(OPTION_GCC) COMPILER_PATH=$(COMPILER_PATH.LINUX) +OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) endif +endif + + CDEFS.TOOLS2:=$(call makemacrodef,$(OPT.D),$(CDEFS.TOOLS2)) ## Locally used variables diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/lib/flm/tools2exe.flm --- a/sbsv2/raptor/lib/flm/tools2exe.flm Mon Jan 25 11:44:33 2010 +0000 +++ b/sbsv2/raptor/lib/flm/tools2exe.flm Tue Jan 26 14:20:07 2010 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of the License "Eclipse Public License v1.0" @@ -19,8 +19,15 @@ ifeq ($(OSTYPE),cygwin) SYSTEMLIBS:=$(LIBS.WIN32) else +ifneq ($(TOOLS2WIN32),) +# Build win32 tools in Linux +SYSTEMLIBS:=$(LIBS.WIN32) +else +# Build linux tools in Linux SYSTEMLIBS:=$(LIBS.LINUX) endif +endif + EXETARGET:=$(RELEASEPATH)/$(TARGET)$(DOTEXE) diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/BLD.INF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/BLD.INF Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* PC-side Font converter tools +* +*/ + +PRJ_PLATFORMS +TOOLS2 + +PRJ_MMPFILES +PDRTRAN.MMP diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/PDRTRAN.MMP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/PDRTRAN.MMP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* pdrtran.exe for windows and pdrtran for linux +*/ + +TARGET pdrtran +TARGETTYPE exe + +SOURCEPATH ./src +SOURCE LEXICAL.CPP PDRREADR.CPP PDRRECRD.CPP PDRTRAN.CPP +SOURCE READER.CPP RECORD.CPP STRNG.CPP + +SYSTEMINCLUDE /epoc32/include + diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/TEST.PD --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/TEST.PD Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,594 @@ +! PCL5.PD +! Printer driver file for HP laser printers + +Resources Pcl5Resources + Reset "<27>E" + SetPageSize "<27>&l%dA" +!<27>&l +! 0o - Portrait +! 0e - top margin to zero +! 0C - VMI to zero +!<27>9 - clear horizontal margins +!<27>(0N - ISO 8859-1 Latin 1 character set + PreAmble "<27>&l0o0e0C<27>9<27>(0N" + PostAmble "<27>E" + BoldOn "<27>(s3B" + BoldOff "<27>(s0B" + ItalicOn "<27>(s1S" + ItalicOff "<27>(s0S" + UnderlineOn "<27>&d0D" + UnderlineOff "<27>&d@" + NewPage "<12>" + Portrait "<27>&l0o0E<27>9" + Landscape "<27>&l1o0E<27>9" + SetXPos "<27>*p%dX" + SetYPos "<27>*p%dY" + BitmapStart "<27>*t300R<27>*r%df1A" ! resolution 300 dots per inch + ScanLine "<27>*b%dm%dW" ! compression method coded in first %d + BitmapEnd "<27>*rC" +EndResources + +Translates Telephone + 5:35 ! must ensure width of 5 = width of 35 + 156:"<27>R<3><35><27>R<0>" +EndTranslates + +FontInfo Courier10 + MaxNormalCharWidth 25 + Ascent 33 ! improvised values throughout + CodeSection 0:255 + 0:25 + EndCodeSection +EndFontInfo + +FontInfo Courier12 + MaxNormalCharWidth 30 + Ascent 40 + CodeSection 0:255 + 0:30 + EndCodeSection +EndFontInfo + +FontInfo LinePrinter9 + MaxNormalCharWidth 18 + Ascent 28 + CodeSection 0:255 + 0:18 + EndCodeSection +EndFontInfo + +FontInfo CgTimesStd + MaxNormalCharWidth 188 + Ascent 167 + CodeSection 0:255 + 0:207 1:207 2:207 3:207 4:207 + 5:104 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:61 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:61 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:108 20:104 21:104 22:207 23:150 24:150 + 25:150 26:150 27:150 28:184 29:150 30:150 31:150 32:61 + 33:69 34:96 35:104 36:104 37:184 38:161 39:69 40:69 + 41:69 42:104 43:184 44:69 45:69 46:69 47:69 48:104 + 49:104 50:104 51:104 52:104 53:104 54:104 55:104 56:104 + 57:104 58:69 59:69 60:207 61:184 62:207 63:92 64:184 +! A B C D E F G H + 65:150 66:131 67:142 68:154 69:131 70:123 71:150 72:154 +! I J K L M N O P + 73:69 74:81 75:146 76:131 77:188 78:154 79:150 80:119 +! Q R S T U V W X + 81:150 82:138 83:111 84:131 85:154 86:150 87:196 88:150 +! Y Z + 89:150 90:134 91:69 92:69 93:69 94:104 95:104 96:104 +! a b c d e f g h + 97:92 98:104 99:92 100:104 101:92 102:69 103:104 104:104 +! i j k l m n o p + 105:58 106:58 107:104 108:58 109:161 110:104 111:104 112:104 +! q r s t u v w x + 113:104 114:77 115:81 116:58 117:104 118:104 119:150 120:104 +! y z + 121:104 122:92 123:92 124:104 125:92 126:104 127:207 128:142 + 129:104 130:92 131:92 132:92 133:92 134:92 135:92 136:92 + 137:92 138:92 139:58 140:58 141:58 142:150 143:150 144:131 + 145:138 146:184 147:104 148:104 149:104 150:104 151:104 152:104 + 153:150 154:154 155:104 156:104 157:154 158:182 159:104 160:92 + 161:58 162:104 163:104 164:104 165:154 166:104 167:104 168:92 + 169:104 170:184 171:184 172:184 173:69 174:85 175:85 176:207 + 177:207 178:207 179:207 180:207 181:150 182:150 183:150 184:105 + 185:207 186:207 187:207 188:207 189:105 190:104 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:92 199:150 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:104 208:104 + 209:154 210:129 211:129 212:129 213:58 214:70 215:70 216:70 + 217:207 218:207 219:207 220:207 221:104 222:70 223:207 224:152 + 225:104 226:152 227:152 228:104 229:152 230:115 231:106 232:122 + 233:154 234:154 235:154 236:104 237:150 238:105 239:104 240:72 + 241:184 242:104 243:183 244:104 245:104 246:184 247:104 248:104 + 249:104 250:1 251:73 252:73 253:73 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo CgTimesItalic + MaxNormalCharWidth 170 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:104 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:61 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:61 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:103 20:104 21:104 22:207 23:150 24:150 + 25:150 26:150 27:150 28:184 29:150 30:150 31:150 32:61 + 33:69 34:100 35:104 36:104 37:184 38:161 39:69 40:69 + 41:69 42:104 43:184 44:69 45:69 46:69 47:69 48:104 + 49:104 50:104 51:104 52:104 53:104 54:104 55:104 56:104 + 57:104 58:69 59:69 60:207 61:184 62:207 63:104 64:184 + 65:127 66:127 67:138 68:150 69:127 70:119 71:150 72:150 + 73:69 74:92 75:138 76:115 77:170 78:138 79:150 80:127 + 81:150 82:127 83:104 84:115 85:150 86:127 87:170 88:127 + 89:115 90:115 91:69 92:69 93:69 94:104 95:104 96:104 + 97:104 98:104 99:92 100:104 101:92 102:58 103:104 104:104 + 105:58 106:58 107:92 108:58 109:150 110:104 111:104 112:104 + 113:104 114:81 115:81 116:58 117:104 118:92 119:138 120:92 + 121:92 122:81 123:92 124:104 125:92 126:104 127:207 128:138 + 129:104 130:92 131:104 132:104 133:104 134:104 135:92 136:92 + 137:92 138:92 139:58 140:58 141:58 142:127 143:127 144:127 + 145:138 146:184 147:104 148:104 149:104 150:104 151:104 152:92 + 153:150 154:150 155:104 156:104 157:151 158:183 159:104 160:104 + 161:58 162:104 163:104 164:104 165:138 166:104 167:104 168:104 + 169:104 170:184 171:184 172:184 173:69 174:96 175:96 176:207 + 177:207 178:207 179:207 180:207 181:127 182:127 183:127 184:105 + 185:207 186:207 187:207 188:207 189:105 190:105 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:104 199:127 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:104 208:104 + 209:148 210:127 211:127 212:127 213:58 214:70 215:70 216:70 + 217:207 218:207 219:207 220:207 221:104 222:70 223:207 224:152 + 225:104 226:152 227:152 228:104 229:152 230:115 231:106 232:126 + 233:150 234:150 235:150 236:92 237:115 238:105 239:104 240:72 + 241:184 242:104 243:182 244:104 245:104 246:184 247:104 248:104 + 249:104 250:2 251:73 252:73 253:73 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo CgTimesBold + MaxNormalCharWidth 196 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:104 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:61 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:61 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:119 20:104 21:104 22:207 23:150 24:150 + 25:150 26:150 27:150 28:184 29:150 30:150 31:150 32:61 + 33:69 34:96 35:104 36:104 37:184 38:169 39:69 40:69 + 41:69 42:104 43:184 44:69 45:69 46:69 47:69 48:104 + 49:104 50:104 51:104 52:104 53:104 54:104 55:104 56:104 + 57:104 58:69 59:69 60:207 61:184 62:207 63:104 64:184 + 65:150 66:138 67:150 68:150 69:138 70:127 71:161 72:161 + 73:81 74:100 75:161 76:138 77:196 78:150 79:161 80:127 + 81:161 82:150 83:115 84:138 85:150 86:150 87:207 88:150 + 89:150 90:138 91:69 92:69 93:69 94:104 95:104 96:104 + 97:104 98:115 99:92 100:115 101:92 102:73 103:104 104:115 + 105:58 106:69 107:115 108:58 109:171 110:115 111:104 112:115 + 113:115 114:92 115:81 116:69 117:115 118:104 119:150 120:104 + 121:104 122:92 123:104 124:104 125:104 126:104 127:207 128:150 + 129:115 130:92 131:104 132:104 133:104 134:104 135:92 136:92 + 137:92 138:92 139:58 140:58 141:58 142:150 143:150 144:138 + 145:150 146:215 147:104 148:104 149:104 150:115 151:115 152:104 + 153:161 154:150 155:104 156:104 157:163 158:182 159:104 160:104 + 161:58 162:104 163:115 164:115 165:150 166:104 167:104 168:104 + 169:104 170:184 171:184 172:184 173:69 174:88 175:88 176:207 + 177:207 178:207 179:207 180:207 181:150 182:150 183:150 184:105 + 185:207 186:207 187:207 188:207 189:105 190:104 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:104 199:150 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:104 208:104 + 209:148 210:137 211:137 212:137 213:58 214:80 215:80 216:80 + 217:207 218:207 219:207 220:207 221:104 222:80 223:207 224:162 + 225:115 226:162 227:162 228:104 229:162 230:115 231:116 232:126 + 233:150 234:150 235:150 236:104 237:150 238:105 239:104 240:72 + 241:184 242:104 243:183 244:104 245:104 246:184 247:104 248:104 + 249:104 250:23 251:73 252:73 253:73 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo CgTimesBoldItalic + MaxNormalCharWidth 184 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:104 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:61 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:61 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:131 20:104 21:104 22:207 23:150 24:150 + 25:150 26:150 27:150 28:184 29:150 30:150 31:150 32:61 + 33:81 34:108 35:104 36:104 37:184 38:161 39:69 40:69 + 41:69 42:104 43:184 44:69 45:69 46:69 47:69 48:104 + 49:104 50:104 51:104 52:104 53:104 54:104 55:104 56:104 + 57:104 58:69 59:69 60:207 61:184 62:207 63:104 64:184 + 65:138 66:138 67:138 68:150 69:138 70:127 71:150 72:161 + 73:81 74:104 75:138 76:127 77:184 78:150 79:150 80:127 + 81:146 82:138 83:115 84:127 85:150 86:138 87:184 88:138 + 89:127 90:127 91:69 92:69 93:69 94:104 95:104 96:104 + 97:104 98:104 99:92 100:104 101:92 102:73 103:104 104:115 + 105:58 106:58 107:104 108:58 109:161 110:115 111:104 112:104 + 113:104 114:81 115:81 116:58 117:115 118:92 119:138 120:104 + 121:92 122:81 123:104 124:104 125:104 126:104 127:207 128:138 + 129:115 130:92 131:104 132:104 133:104 134:104 135:92 136:92 + 137:92 138:92 139:58 140:58 141:58 142:138 143:138 144:138 + 145:146 146:192 147:104 148:104 149:104 150:115 151:115 152:92 + 153:150 154:150 155:104 156:104 157:151 158:184 159:104 160:104 + 161:58 162:104 163:115 164:115 165:150 166:104 167:104 168:104 + 169:104 170:184 171:184 172:184 173:81 174:92 175:92 176:207 + 177:207 178:207 179:207 180:207 181:138 182:138 183:138 184:105 + 185:207 186:207 187:207 188:207 189:105 190:105 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:104 199:138 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:104 208:104 + 209:148 210:137 211:137 212:137 213:58 214:80 215:80 216:80 + 217:207 218:207 219:207 220:207 221:104 222:80 223:207 224:152 + 225:104 226:152 227:152 228:104 229:152 230:115 231:106 232:126 + 233:150 234:150 235:150 236:90 237:127 238:105 239:104 240:72 + 241:184 242:104 243:183 244:104 245:104 246:184 247:104 248:104 + 249:104 250:18 251:69 252:69 253:69 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo UniversStd + MaxNormalCharWidth 188 + Ascent 167 + CodeSection 0:255 + 0:207 1:207 2:207 3:207 4:207 + 5:131 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:69 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:69 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:110 20:131 21:131 22:207 23:150 24:150 + 25:150 26:150 27:150 28:207 29:150 30:150 31:150 32:69 + 33:69 34:104 35:131 36:131 37:207 38:158 39:69 40:69 + 41:69 42:131 43:207 44:69 45:69 46:69 47:69 48:131 + 49:131 50:131 51:131 52:131 53:131 54:131 55:131 56:131 + 57:131 58:69 59:69 60:207 61:207 62:207 63:108 64:207 + 65:154 66:131 67:146 68:150 69:119 70:115 71:154 72:150 + 73:58 74:115 75:138 76:111 77:188 78:150 79:158 80:123 + 81:161 82:134 83:134 84:131 85:150 86:150 87:207 88:150 + 89:142 90:127 91:69 92:69 93:69 94:131 95:104 96:131 + 97:111 98:119 99:111 100:119 101:111 102:77 103:119 104:119 + 105:50 106:50 107:111 108:50 109:181 110:119 111:119 112:119 + 113:119 114:73 115:104 116:77 117:119 118:115 119:181 120:115 + 121:115 122:100 123:92 124:104 125:92 126:131 127:207 128:146 + 129:119 130:111 131:111 132:111 133:111 134:111 135:111 136:111 + 137:111 138:111 139:50 140:50 141:50 142:154 143:154 144:119 + 145:177 146:204 147:119 148:119 149:119 150:119 151:119 152:115 + 153:158 154:150 155:122 156:131 157:160 158:207 159:131 160:111 + 161:50 162:119 163:119 164:119 165:150 166:85 167:85 168:108 + 169:104 170:207 171:207 172:207 173:69 174:115 175:115 176:207 + 177:207 178:207 179:207 180:207 181:154 182:154 183:154 184:105 + 185:207 186:207 187:207 188:207 189:129 190:129 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:114 199:154 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:128 208:121 + 209:150 210:119 211:119 212:119 213:51 214:58 215:58 216:58 + 217:207 218:207 219:207 220:207 221:105 222:58 223:207 224:158 + 225:127 226:158 227:158 228:119 229:158 230:115 231:119 232:126 + 233:150 234:150 235:150 236:118 237:141 238:129 239:129 240:72 + 241:207 242:106 243:207 244:130 245:130 246:207 247:129 248:131 + 249:129 250:25 251:81 252:81 253:81 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo UniversItalic + MaxNormalCharWidth 188 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:131 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:69 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:69 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:114 20:131 21:131 22:207 23:150 24:150 + 25:150 26:150 27:150 28:207 29:150 30:150 31:150 32:69 + 33:69 34:104 35:131 36:131 37:207 38:158 39:69 40:69 + 41:69 42:131 43:207 44:69 45:69 46:69 47:69 48:131 + 49:131 50:131 51:131 52:131 53:131 54:131 55:131 56:131 + 57:131 58:69 59:69 60:207 61:207 62:207 63:108 64:207 + 65:154 66:131 67:146 68:150 69:119 70:115 71:154 72:150 + 73:58 74:115 75:138 76:111 77:188 78:150 79:158 80:123 + 81:161 82:134 83:134 84:131 85:150 86:150 87:207 88:150 + 89:142 90:127 91:69 92:69 93:69 94:131 95:104 96:131 + 97:111 98:119 99:111 100:119 101:111 102:77 103:119 104:119 + 105:50 106:50 107:111 108:50 109:181 110:119 111:119 112:119 + 113:119 114:73 115:104 116:77 117:119 118:115 119:181 120:115 + 121:115 122:100 123:92 124:104 125:92 126:131 127:207 128:146 + 129:119 130:111 131:111 132:111 133:111 134:111 135:111 136:111 + 137:111 138:111 139:50 140:50 141:50 142:154 143:154 144:119 + 145:177 146:204 147:119 148:119 149:119 150:119 151:119 152:115 + 153:158 154:150 155:122 156:131 157:160 158:207 159:131 160:111 + 161:50 162:119 163:119 164:119 165:150 166:85 167:85 168:108 + 169:104 170:207 171:207 172:207 173:69 174:115 175:115 176:207 + 177:207 178:207 179:207 180:207 181:154 182:154 183:154 184:105 + 185:207 186:207 187:207 188:207 189:129 190:129 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:111 199:154 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:128 208:121 + 209:150 210:119 211:119 212:119 213:51 214:58 215:58 216:58 + 217:207 218:207 219:207 220:207 221:105 222:58 223:207 224:158 + 225:127 226:158 227:158 228:119 229:158 230:115 231:119 232:126 + 233:150 234:150 235:150 236:115 237:142 238:129 239:129 240:72 + 241:207 242:106 243:207 244:130 245:130 246:207 247:129 248:131 + 249:129 250:16 251:81 252:81 253:81 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo UniversBold + MaxNormalCharWidth 188 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:131 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:69 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:69 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:115 20:131 21:131 22:207 23:150 24:150 + 25:150 26:150 27:150 28:207 29:150 30:150 31:150 32:69 + 33:69 34:108 35:131 36:131 37:207 38:158 39:69 40:69 + 41:69 42:131 43:207 44:69 45:69 46:69 47:69 48:131 + 49:131 50:131 51:131 52:131 53:131 54:131 55:131 56:131 + 57:131 58:69 59:69 60:207 61:207 62:207 63:108 64:207 + 65:154 66:131 67:146 68:150 69:119 70:115 71:154 72:150 + 73:58 74:115 75:138 76:111 77:188 78:150 79:158 80:123 + 81:161 82:134 83:134 84:131 85:150 86:150 87:207 88:150 + 89:142 90:127 91:69 92:69 93:69 94:131 95:104 96:131 + 97:111 98:119 99:111 100:119 101:111 102:77 103:119 104:119 + 105:50 106:50 107:111 108:50 109:181 110:119 111:119 112:119 + 113:119 114:73 115:104 116:77 117:119 118:115 119:181 120:115 + 121:115 122:100 123:104 124:104 125:104 126:131 127:207 128:146 + 129:119 130:111 131:111 132:111 133:111 134:111 135:111 136:111 + 137:111 138:111 139:50 140:50 141:50 142:154 143:154 144:119 + 145:177 146:204 147:119 148:119 149:119 150:119 151:119 152:115 + 153:158 154:150 155:122 156:131 157:160 158:207 159:131 160:111 + 161:50 162:119 163:119 164:119 165:150 166:85 167:85 168:108 + 169:104 170:207 171:207 172:207 173:69 174:115 175:115 176:207 + 177:207 178:207 179:207 180:207 181:154 182:154 183:154 184:105 + 185:207 186:207 187:207 188:207 189:129 190:129 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:111 199:154 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:128 208:121 + 209:150 210:119 211:119 212:119 213:51 214:58 215:58 216:58 + 217:207 218:207 219:207 220:207 221:105 222:58 223:207 224:158 + 225:127 226:158 227:158 228:119 229:158 230:123 231:119 232:126 + 233:150 234:150 235:150 236:115 237:142 238:129 239:129 240:72 + 241:207 242:106 243:207 244:130 245:130 246:207 247:129 248:131 + 249:129 250:33 251:81 252:81 253:81 254:104 255:104 + EndCodeSection +EndFontInfo + +FontInfo UniversBoldItalic + MaxNormalCharWidth 188 + Ascent 167 + CodeSection 0:255 + 0:207 + 1:207 2:207 3:207 4:207 + 5:131 ! telephone character must be the same as # (35) + 6:207 + 7:69 ! non-breaking hyphen must be the same as hyphen (45) + 8:207 + 9:69 ! tab must be the same as space (32) + 10:207 11:150 12:150 13:104 + 14:69 ! potential hyphen must be the same as hyphen (45) + 15:69 ! non-breaking space must be the same as space (32) + 16:150 + 17:150 18:150 19:125 20:131 21:131 22:207 23:150 24:150 + 25:150 26:150 27:150 28:207 29:150 30:150 31:150 32:69 + 33:69 34:111 35:131 36:131 37:207 38:158 39:69 40:69 + 41:69 42:131 43:207 44:69 45:69 46:69 47:69 48:131 + 49:131 50:131 51:131 52:131 53:131 54:131 55:131 56:131 + 57:131 58:69 59:69 60:207 61:207 62:207 63:108 64:207 + 65:154 66:131 67:146 68:150 69:119 70:115 71:154 72:150 + 73:58 74:115 75:138 76:111 77:188 78:150 79:158 80:123 + 81:161 82:134 83:134 84:131 85:150 86:150 87:207 88:150 + 89:142 90:127 91:69 92:69 93:69 94:131 95:104 96:131 + 97:111 98:119 99:111 100:119 101:111 102:77 103:119 104:119 + 105:50 106:50 107:111 108:50 109:181 110:119 111:119 112:119 + 113:119 114:73 115:104 116:77 117:119 118:115 119:181 120:115 + 121:115 122:100 123:104 124:104 125:104 126:131 127:207 128:146 + 129:119 130:111 131:111 132:111 133:111 134:111 135:111 136:111 + 137:111 138:111 139:50 140:50 141:50 142:154 143:154 144:119 + 145:177 146:204 147:119 148:119 149:119 150:119 151:119 152:115 + 153:158 154:150 155:122 156:131 157:160 158:207 159:131 160:111 + 161:50 162:119 163:119 164:119 165:150 166:85 167:85 168:108 + 169:104 170:207 171:207 172:207 173:69 174:115 175:115 176:207 + 177:207 178:207 179:207 180:207 181:154 182:154 183:154 184:105 + 185:207 186:207 187:207 188:207 189:129 190:129 191:207 192:207 + 193:207 194:207 195:207 196:207 197:207 198:111 199:154 200:207 + 201:207 202:207 203:207 204:207 205:207 206:207 207:128 208:121 + 209:150 210:119 211:119 212:119 213:51 214:58 215:58 216:58 + 217:207 218:207 219:207 220:207 221:105 222:58 223:207 224:158 + 225:127 226:158 227:158 228:119 229:158 230:123 231:119 232:126 + 233:150 234:150 235:150 236:115 237:142 238:129 239:129 240:72 + 241:207 242:106 243:207 244:130 245:130 246:207 247:129 248:131 + 249:129 250:37 251:81 252:81 253:81 254:104 255:104 + EndCodeSection +EndFontInfo + +TypefaceFonts Courier + Name "Courier" Serif + Translates Telephone + FontHeight + Height 200 + Normal Courier10 + Bold Courier10 + Italic Courier10 + BoldItalic Courier10 + Command "" !<27>(s0p12h10v3T" + EndFontHeight + FontHeight + Height 240 + Normal Courier12 + Bold Courier12 + Italic Courier12 + BoldItalic Courier12 + Command "" !<27>(s0p10h12v3T" + EndFontHeight +EndTypefaceFonts + +TypefaceFonts LinePrinter + Name "Lineprinter" + Translates Telephone + FontHeight + Height 170 + Normal LinePrinter9 + Bold LinePrinter9 + Italic LinePrinter9 + BoldItalic LinePrinter9 + Command "<27>(s0p16.67h8.5v0T" + EndFontHeight +EndTypefaceFonts + +TypefaceFonts CgTimes + Name "CG Times" Proportional Serif + Translates Telephone + ScalableFontHeight + HeightMin 80 ! min font height 80 twips = 4 point + HeightMax 1200 ! max font height 1200 twips ( = 60 point) + HeightDelta 20 ! delta font height 20 twips = 1 point + Normal CgTimesStd + Bold CgTimesBold + Italic CgTimesItalic + BoldItalic CgTimesBoldItalic + Command "<27>(s1p%dv4101T" + EndScalableFontHeight +EndTypefaceFonts + +TypefaceFonts Univers + Name "Univers" Proportional + Translates Telephone + ScalableFontHeight + HeightMin 80 ! min font height 80 twips = 4 point + HeightMax 1200 ! max font height 1200 twips ( = 60 point) + HeightDelta 20 ! delta font height 20 twips = 1 point + Normal UniversStd + Bold UniversBold + Italic UniversItalic + BoldItalic UniversBoldItalic + Command "<27>(s1p%dv4148T" + EndScalableFontHeight +EndTypefaceFonts + +!ExtraInfo ExtraInfo +! "abcdefghijklmnopqrstuvwxyz" +! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +!EndExtraInfo + +Model HPLJ3 + Name "HP LaserJet III" RequiresPrinterPort + Uid 1000 + Flags 0 + Resources Pcl5Resources + KPixelWidth 4800 ! Twips = 300 dots per inch + KPixelHeight 4800 + PortraitOffset 75 0 ! Pixels + LandscapeOffset 60 0 + MinMarginLeft 50 ! Pixels + MinMarginRight 50 + MinMarginTop 50 + MinMarginBottom 50 + DisplayMode Gray2 + TypefaceFontss + Courier + LinePrinter NotInLandscape + CgTimes NotInPortrait + Univers + EndTypefaceFontss +EndModel + +Model HPDJ340 + Name "HP DeskJet 340" RequiresPrinterPort + Uid 1100 + Flags 3 ! 1 = MoveDownOnly, 2 = LanscapeBandOrientationVertical + Resources Pcl5Resources + KPixelWidth 4800 ! Twips = 300 dots per inch + KPixelHeight 4800 + PortraitOffset 75 0 ! Pixels + LandscapeOffset 60 0 + MinMarginLeft 50 ! Pixels + MinMarginRight 50 + MinMarginTop 75 + MinMarginBottom 200 + DisplayMode Gray2 + TypefaceFontss + Courier + LinePrinter + CgTimes + Univers + EndTypefaceFontss +EndModel + +Model HPDJ660C + Name "HP DeskJet 660C" RequiresPrinterPort + Uid 1200 + Flags 3 ! 1 = MoveDownOnly, 2 = LanscapeBandOrientationVertical + Resources Pcl5Resources + KPixelWidth 4800 ! Twips = 300 dots per inch + KPixelHeight 4800 + PortraitOffset 75 0 ! Pixels + LandscapeOffset 60 0 + MinMarginLeft 50 ! Pixels + MinMarginRight 50 + MinMarginTop 75 + MinMarginBottom 175 + DisplayMode Gray2 + TypefaceFontss + Courier + LinePrinter + CgTimes + Univers + EndTypefaceFontss +! SpareRecord ExtraInfo +EndModel + +PdrStoreFile + PDLName "test" + PDLUid 1 + Models + HPLJ3 + HPDJ340 + HPDJ660C + EndModels +EndPdrStoreFile diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/LEXICAL.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/LEXICAL.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header LEXICAL.CPP +* +*/ + + +#include "LEXICAL.H" + +Lexical::Lexical() + : iType(ELexNL), iNumber(0) + { + iText[0] = '\0'; + } + +Lexical::Lexical(const Lexical& aLex) + { + iType = aLex.iType; + iNumber = aLex.iNumber; + strcpy(iText, aLex.iText); + } + +Lexical& Lexical::operator = (const Lexical& aLex) + { + iType = aLex.iType; + iNumber = aLex.iNumber; + strcpy(iText, aLex.iText); + return *this; + } + +int Lexical::CovertStringToHex() + { + char* curPtr = iText; // Position of current lexical in line + int hexDigit; + int number = 0; + + while (HexDigit(*curPtr, hexDigit)) + { + number = (16 * number) + hexDigit; + curPtr++; + } + return number; + } + +int Lexical::HexDigit(char aDigit, int& decimalEquivalent) + { + boolean validDigit = efalse; + if ((aDigit >= '0') && (aDigit <= '9')) + { + decimalEquivalent = (aDigit - '0'); + validDigit = etrue; + } + else if ((aDigit >= 'a') && (aDigit <= 'f')) + { + decimalEquivalent = 10 + (aDigit - 'a'); + validDigit = etrue; + } + else if ((aDigit >= 'A') && (aDigit <= 'F')) + { + decimalEquivalent = 10 + (aDigit - 'A'); + validDigit = etrue; + } + return validDigit; + } + +ostream& operator << (ostream& out, const Lexical& aLex) + { + switch (aLex.iType) + { + case ELexEOF: + { + out << "EOF"; + break; + } + case ELexNL: + { + out << "NL"; + break; + } + case ELexNumber: + { + out << aLex.iNumber; + break; + } + case ELexOperator: + { + out << aLex.iText[0]; + break; + } + default: + { + out << aLex.iText; + } + } + return out; + } + +LexAnal::LexAnal(const char* aFilename) + : iFilename(aFilename) + { + iFin.open(aFilename); + iLex.iType = ELexNL; + iLineNo = 0; + } + +Lexical LexAnal::Read() // read next lexical into iLex + { + if (iLex.iType == ELexNL) + { + do + { + GetNextLex(); + } + while (iLex.iType == ELexNL); + } + else + GetNextLex(); + return iLex; + } + +Lexical LexAnal::ReadNextLine() // read first lex on next line + { + GetNextLine(); + return iLex; + } + +void LexAnal::Report() + { + cerr << iFilename.Text() << '(' << iLineNo << "): \n"; + cerr << iLine << '\n'; + for (char* p = iLine; p < iLexPtr; p++) + cerr << ' '; + cerr << "^\n"; + } + +LexAnal::~LexAnal() + { + iFin.close(); + } + +void LexAnal::GetNextLex() + { + char ch; + if (iLex.iType == ELexNL) + { + iFin.getline(iLine, MaxLineLen); + // Remove any CR character that appear at the end when + // reading a dos file on unix. + PurgeLastCR(iLine); + iCurPtr = iLine; + iLineNo++; + } + + while ((*iCurPtr == ' ') || (*iCurPtr == '\t')) + iCurPtr++; + ch = *iCurPtr; + iLexPtr = iCurPtr; + + if ((ch == '\0') && (iFin.eof())) // finds lexical type + iLex = ReadEOF(); + else if ((ch == '\0') || (ch == '!')) // ! is a comment + iLex = ReadNewLine(); + else if ((ch == '-') || ((ch >= '0') && (ch <= '9'))) + iLex = ReadNumber(); + else if (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '_')) + iLex = ReadIdent(); + else if (ch == '"') + iLex = ReadString(); + else + iLex = ReadOperator(); + } + +void LexAnal::GetNextLine() + { + iFin.getline(iLine, MaxLineLen); + // Remove any CR character that appear at the end when + // reading a dos file on unix. + PurgeLastCR(iLine); + iCurPtr = iLine; + iLineNo++; + + char ch; + while ((*iCurPtr == ' ') || (*iCurPtr == '\t')) + iCurPtr++; + ch = *iCurPtr; + iLexPtr = iCurPtr; + + if ((ch == '\0') && (iFin.eof())) // finds lexical type + iLex = ReadEOF(); + else if ((ch == '\0') || (ch == '!')) + iLex = ReadNewLine(); + else if ((ch == '-') || ((ch >= '0') && (ch <= '9'))) + iLex=ReadNumber(); + else if (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '_')) + iLex = ReadIdent(); + else if (ch == '"') + iLex = ReadString(); + else + iLex = ReadOperator(); + } + +void LexAnal::PurgeLastCR(char *aLine) + { + int len = strlen(aLine) - 1; + if (len >= 0 && aLine[len] == '\r') + { + aLine[len] = '\0'; + } + } + +Lexical LexAnal::ReadEOF() + { + Lexical lex; + lex.iType = ELexEOF; + return lex; + } + +Lexical LexAnal::ReadNewLine() + { + Lexical lex; + lex.iType = ELexNL; + while (*iCurPtr != '\0') + iCurPtr++; + return lex; + } + +Lexical LexAnal::ReadNumber() + { + Lexical lex; + char ch; + boolean negative = efalse; + lex.iType = ELexNumber; + if (*iCurPtr == '-') + { + negative = etrue; + iCurPtr++; + } + ch = *iCurPtr; + while ((ch >= '0') && (ch <= '9')) + { + if (negative) + lex.iNumber = (10 * lex.iNumber) - (*iCurPtr - '0'); + else + lex.iNumber=(10 * lex.iNumber) + (*iCurPtr - '0'); + iCurPtr++; + ch = *iCurPtr; + } + return lex; + } + + +Lexical LexAnal::ReadIdent() + { + Lexical lex; + char ch; + lex.iType = ELexIdent; + do + { + iCurPtr++; + ch = *iCurPtr; + } + while (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '_') || ((ch >= '0') && (ch <= '9'))); + strncpy(lex.iText, iLexPtr, iCurPtr - iLexPtr); + lex.iText[iCurPtr - iLexPtr] = '\0'; + return lex; + } + +Lexical LexAnal::ReadString() + { + Lexical lex; + char ch; + lex.iType = ELexString; + iCurPtr++; + ch = *iCurPtr; + while ((ch != '"') && (*iCurPtr != '\0')) + { + iCurPtr++; + ch = *iCurPtr; + } + strncpy(lex.iText, iLexPtr + 1, iCurPtr - (iLexPtr + 1)); + lex.iText[iCurPtr - (iLexPtr + 1)] = '\0'; + if (ch == '"') + iCurPtr++; // finds position after last double quotes + else + { + cerr << "Warning: missing quotes\n"; + Report(); + } + return lex; + } + +Lexical LexAnal::ReadOperator() + { + Lexical lex; + lex.iType = ELexOperator; + lex.iText[0] = *iCurPtr; + iCurPtr++; + return lex; + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRREADR.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRREADR.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,1009 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header PDRREADR.CPP +* +*/ + + +#include "PDRREADR.H" + +const int NumResources=34; + +String IdentResource[NumResources] = + { + "Reset", + "SetPageSize", + "PreAmble", + "PostAmble", + "SetTextColor", // !! + "BoldOn", + "BoldOff", + "ItalicOn", + "ItalicOff", + "UnderlineOn", + "UnderlineOff", + "StrikethroughOn", + "StrikethroughOff", + "NewPage", + "Portrait", + "Landscape", + "SetXPos", + "SetYPos", + "IncrementXPos", + "IncrementYPos", + "CarriageReturn", + "SetGraphicsColor", // !! + "BitmapStart", + "BitmapEnd", + "ScanLine", + "EndScanLine", // !! + "Resource1", + "Resource2", + "Resource3", + "Resource4", + "Resource5", + "Resource6", + "Resource7", + "Resource8" + }; + +const int NumDisplayModeValues = 11; + +String IdentDisplayModeValue[NumDisplayModeValues] = + { + "None", + "Gray2", + "Gray4", + "Gray16", + "Gray256", + "Color16", + "Color256", + "Color64K", + "Color16M", + "Rgb", + "Color4K" + }; + +EXPORT_C PdrReader::PdrReader() + : Reader(), + iPdrModelStore(), + iPdrStoreFile(NULL), + iResources(NULL), + iTranslates(NULL), + iCodeSection(NULL), + iFontInfo(NULL), + iIndex(Normal), + iFontHeight(NULL), + iTypefaceFonts(NULL), + iModel(NULL) + { + } + +EXPORT_C boolean PdrReader::Read(const String& aFilename) + { + boolean state = Open(aFilename); + + while (!_EOF() && state) + { + if (IdentComp(IdentResources)) + state = ReadResources(); + else if (IdentComp(IdentTranslates)) + state = ReadTranslates(); + else if (IdentComp(IdentFontInfo)) + state = ReadFontInfo(); + else if (IdentComp(IdentTypefaceFonts)) + state = ReadTypefaceFonts(); +// else if (IdentComp(IdentExtraInfo)) +// state = ReadExtraInfo(); + else if (IdentComp(IdentModel)) + state = ReadModel(); + else if (IdentComp(IdentPdrStoreFile)) + state = ReadPdrStoreFile(); + else + { + Error("Resource identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + return state; + } + +EXPORT_C PdrReader::~PdrReader() + { + } + +boolean PdrReader::ReadResources() + { + boolean state = etrue; + iResources = PdrResources::New(); + state = IdentCopy(iResources->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndResources) && !_EOF() && state) + { + int i; // DEF102183: Graphics tools fail to build using MS VC8. + for (i = 0; (i < NumResources) && !IdentComp(IdentResource[i]); i++) + { // Tries to match resources identifier + } + if (i < NumResources) + { + PdrResource *resource = PdrResource::New(); + state = Command(resource->iString); + resource->iId = i; + if (state) + { + iResources->AddResource(resource); + state = NewLine(); + } + else + resource->Delete(); + } + else + { + state = efalse; + Error("Resources identifier expected"); + } + } + if (state) + { + iPdrModelStore.AddResources(iResources); + cout << "Resources read\n"; + } + else + iResources->Delete(); + return state; + } + +boolean PdrReader::ReadTranslates() + { + int num; + boolean state = etrue; + iTranslates = PdrTranslates::New(); + state = IdentCopy(iTranslates->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndTranslates) && !_EOF() && state) + { + if (iLex->iType == ELexNumber) + { + PdrTranslation *translation = PdrTranslation::New(); + Number(num); + translation->iFrom = uint16(num); + char ch; + state = Operator(ch); + if (state) + { + state = (ch == ':'); + if (state) + { + if (iLex->iType == ELexNumber) + { + state = Number(num); + translation->iTo += char(num); + } + else + { + state = Command(translation->iTo); + } + if (state) + state = NewLine(); + } + else + { + Error("Operator ':' expected"); + } + } + if (state) + iTranslates->AddTranslation(translation); + else + translation->Delete(); + } + } + if (state) + { + iPdrModelStore.AddTranslates(iTranslates); + cout << "Translates read\n"; + } + else + iTranslates->Delete(); + return state; + } + +boolean PdrReader::ReadCodeSection(int aCode) + { + boolean state = etrue; + int code; + int num; + iCodeSection = WidthsCodeSection::New(); + char ch = 0; + state = Number(num); + if ((numiStart = uint16(num); + state = Operator(ch); + if (state) + state = (ch == ':'); + if (state) + { + state = Number(num); + iCodeSection->iEnd = uint16(num); + state = NewLine(); + } + else + { + state = efalse; + Error("Operator ':' expected"); + } + } + else + state = efalse; + while (!IdentComp(IdentEndCodeSection) && !_EOF() && state) + { + if (iLex->iType != ELexNL) + { + state = Number(code); + if ((code != iCodeSection->iStart + iCodeSection->NumWidths()) && state) + { + state = efalse; + Error("Width out of sequence"); + } + if (state) + state = Operator(ch); + if (state) + state = (ch == ':'); + if (state) + { + Width *width = Width::New(); + if (Number(num)) + { + width->iWidthInPixels = (uint16) num; + iCodeSection->AddWidth(width); + } + else + { + state = efalse; + width->Delete(); + } + } + } + else + state = NewLine(); + } + if (state) + { + num = ((iCodeSection->iEnd + 1) - iCodeSection->iStart); + if ((num != iCodeSection->NumWidths()) && (iCodeSection->NumWidths() != 1)) + { + Error("Wrong number of widths in codesection"); + state = efalse; + } + } + if (state) + { + iFontInfo->AddCodeSection(iCodeSection); +// cout << "Codesection read\n"; + } + else + iCodeSection->Delete(); + return state; + } + +boolean PdrReader::ReadFontInfo() + { + boolean state = etrue; + iFontInfo = FontInfo::New(); + int num; + state = IdentCopy(iFontInfo->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndFontInfo) && !_EOF() && state) + { + if (iLex->iType == ELexIdent) + { + if (IdentComp(IdentCodeSection)) + { + int code = 0,size = iFontInfo->NumCodeSections(); + if (size) + code = iFontInfo->CodeSectionList(size - 1)->iEnd + 1; + state = ReadCodeSection(code); + } + else if (IdentComp(IdentAscent)) + { + if (Number(num)) + iFontInfo->iAscentInPixels = uint16(num); + else + state = efalse; + } + else if (IdentComp(IdentMaxNormalCharWidth)) + { + state = Number(num); + if (state) + iFontInfo->iMaxNormalCharWidthInPixels = uint16(num); + } + else + { + Error("Unrecognised fontinfo identifier"); + state = efalse; + } + } + else + { + Error("Fontinfo identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + iFontInfo->iMaxCharWidthInPixels = 0; + for (int i = 0; i < iFontInfo->NumCodeSections(); i++) + { + WidthsCodeSection* codesection = iFontInfo->CodeSectionList(i); + for (int j = 0; j < codesection->NumWidths(); j++) + { + int width = codesection->WidthList(j)->iWidthInPixels; + if (width > iFontInfo->iMaxCharWidthInPixels) + iFontInfo->iMaxCharWidthInPixels = (uint16) width; + } + } + } + if (state) + { + iPdrModelStore.AddFontInfo(iFontInfo); + cout << "Fontinfo read\n"; + } + else + iFontInfo->Delete(); + return state; + } + +boolean PdrReader::ReadStyle() + { + boolean state = etrue; + Record *fontinfo; + PdrStyle *style; + String label; + if (!iTypefaceFonts->iIsScalable) + style = &iFontHeight->iStyle[iIndex]; + else + style = &iTypefaceFonts->iScalableFontHeight.iStyle[iIndex]; + style->iIsAvailable = etrue; + state = IdentCopy(label); + if (state) + { + fontinfo = iPdrModelStore.FindFontInfo(label); + if (fontinfo) + style->iFontInfo = fontinfo; + else + { + Error("Fontinfo not found"); + state = efalse; + } + } + return state; + } + +boolean PdrReader::ReadFontHeight() + { + boolean state = etrue; + int num; + if (iTypefaceFonts->iIsScalable == etrue) + { + state = efalse; + Error("Scalablefontheight already defined"); + } + else + iFontHeight = PdrFontHeight::New(); + if (state) + state = NewLine(); + + while (!IdentComp(IdentEndFontHeight) && !_EOF() && state) + { + if (iLex->iType == ELexIdent) + { + if (IdentComp(IdentHeight)) + { + if (Number(num)) + iFontHeight->iHeightInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentWidthScale)) + { + if (Number(num)) + iFontHeight->iWidthScale = num; + else + state = efalse; + } + else if (IdentComp(IdentNormal)) + { + iIndex = Normal; + state = ReadStyle(); + } + else if (IdentComp(IdentBold)) + { + iIndex = Bold; + state = ReadStyle(); + } + else if (IdentComp(IdentItalic)) + { + iIndex = Italic; + state = ReadStyle(); + } + else if (IdentComp(IdentBoldItalic)) + { + iIndex = BoldItalic; + state = ReadStyle(); + } + else if (IdentComp(IdentCommand)) + { + state = Command(iFontHeight->iCommandString); + } + else + { + Error("Unrecognised fontheight identifier"); + state = efalse; + } + } + else + { + Error("Fontheight identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + iTypefaceFonts->AddFontHeight(iFontHeight); + cout << "Fontheight read\n"; + } + else + iFontHeight->Delete(); + return state; + } + +boolean PdrReader::ReadScalableFontHeight() + { + boolean state = etrue; + int num; + if (iTypefaceFonts->NumFontHeights()) + { + state = efalse; + Error("Non-scalable fontheights already defined"); + } + else if (iTypefaceFonts->iIsScalable == etrue) + { + state = efalse; + Error("Scalablefontheight already defined"); + } + iTypefaceFonts->iIsScalable=etrue; + if (state) + state = NewLine(); + + while (!IdentComp(IdentEndScalableFontHeight) && !_EOF() && state) + { + if (iLex->iType == ELexIdent) + { + if (IdentComp(IdentHeightMin)) + { + if (Number(num)) + iTypefaceFonts->iScalableFontHeight.iHeightMinInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentHeightMax)) + { + if (Number(num)) + iTypefaceFonts->iScalableFontHeight.iHeightMaxInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentHeightDelta)) + { + if (Number(num)) + iTypefaceFonts->iScalableFontHeight.iHeightDeltaInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentNormal)) + { + iIndex = Normal; + state = ReadStyle(); + } + else if (IdentComp(IdentBold)) + { + iIndex = Bold; + state = ReadStyle(); + } + else if (IdentComp(IdentItalic)) + { + iIndex = Italic; + state = ReadStyle(); + } + else if (IdentComp(IdentBoldItalic)) + { + iIndex = BoldItalic; + state = ReadStyle(); + } + else if (IdentComp(IdentCommand)) + { + state = Command(iTypefaceFonts->iScalableFontHeight.iCommandString); + } + else + { + Error("Unrecognised scalablefontheight identifier"); + state = efalse; + } + } + else + { + Error("Scalablefontheight identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + cout << "Scalablefontheight read\n"; + } + else + { + if (!iTypefaceFonts->iIsScalable) + iFontHeight->Delete(); + } + return state; + } + +boolean PdrReader::ReadTypefaceFonts() + { + boolean state = etrue; + Record* translates; + String label; + iTypefaceFonts = TypefaceFonts::New(); + state = IdentCopy(iTypefaceFonts->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndTypefaceFonts) && !_EOF() && state) + { + if (iLex->iType == ELexIdent) + { + if (IdentComp(IdentTypefaceName)) + { + if (StringCopy(iTypefaceFonts->iTypeface.iName)) + while (iLex->iType != ELexNL) + { if (IdentComp(IdentProportional)) + iTypefaceFonts->iTypeface.iFlags = boolean(iTypefaceFonts->iTypeface.iFlags | Proportional); + else if (IdentComp(IdentSerif)) + iTypefaceFonts->iTypeface.iFlags = boolean(iTypefaceFonts->iTypeface.iFlags | Serif); + else if (IdentComp(IdentSymbol)) + iTypefaceFonts->iTypeface.iFlags = boolean(iTypefaceFonts->iTypeface.iFlags | Symbol); + else + { + Error("Typefacefonts identifier or newline expected"); + state = efalse; + } + } + else + state = efalse; + } + else if (IdentComp(IdentTypefaceTranslates)) + { + state = IdentCopy(label); + if (state) + { + translates = iPdrModelStore.FindTranslates(label); + if (translates) + iTypefaceFonts->iTranslates = translates; + else + { + Error("Translates not found"); + state = efalse; + } + } + } + else if (IdentComp(IdentFontHeight)) + { + state = ReadFontHeight(); + } + else if (IdentComp(IdentScalableFontHeight)) + { + state = ReadScalableFontHeight(); + } + else + { + Error("Unrecognised typefacefonts identifier"); + state = efalse; + } + } + else + { + Error("Typefacefonts identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + iPdrModelStore.AddTypefaceFonts(iTypefaceFonts); + cout << "Typefacefonts read\n"; + } + else + iTypefaceFonts->Delete(); + return state; + } + +boolean PdrReader::ReadModel() + { + boolean state = etrue; + int num; + iModel = PrinterModelHeader::New(); + Record* resources; +// Record* extrainfo; + String label; + state = IdentCopy(iModel->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndModel) && !_EOF() && state) + { + if (iLex->iType == ELexIdent) + { + if (IdentComp(IdentModelName)) + { + if (StringCopy(iModel->iEntry.iName)) + while (iLex->iType != ELexNL) + { + if (IdentComp(IdentRequiresPrinterPort)) + iModel->iEntry.iRequiresPrinterPort = etrue; + else + { + Error("Model identifier or newline expected"); + state = efalse; + } + } + else + state = efalse; + } + else if (IdentComp(IdentModelUid)) + state = Number(iModel->iEntry.iUid); + else if (IdentComp(IdentModelFlags)) + { + state = Number(num); + iModel->iInfo.iFlags = num; + } + else if (IdentComp(IdentModelResources)) + { + state = IdentCopy(label); + if (state) + { + resources = iPdrModelStore.FindResources(label); + if (resources) + iModel->iInfo.iResources = resources; + else + { + Error("Resources not found"); + state = efalse; + } + } + } +/* else if (IdentComp(IdentSpareRecord)) + { + state = IdentCopy(label); + if (state) + { + extrainfo = iPdrModelStore.FindExtraInfo(label); + if (extrainfo) + iModel->iInfo.iSpareRecord = extrainfo; + else + { + Error("Spare record not found"); + state = efalse; + } + } + } +*/ + else if (IdentComp(IdentKPixelWidth)) + { + if (Number(num)) + iModel->iInfo.iKPixelWidthInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentKPixelHeight)) + { + if (Number(num)) + iModel->iInfo.iKPixelHeightInTwips = num; + else + state = efalse; + } + else if (IdentComp(IdentPortraitOffset)) + { + if (Number(num)) + { + iModel->iInfo.iPortraitOffsetInPixels.iX = num; + if (Number(num)) + iModel->iInfo.iPortraitOffsetInPixels.iY = num; + else + state = efalse; + } + else + state = efalse; + } + else if (IdentComp(IdentLandscapeOffset)) + { + if (Number(num)) + { + iModel->iInfo.iLandscapeOffsetInPixels.iX = num; + if (Number(num)) + iModel->iInfo.iLandscapeOffsetInPixels.iY = num; + else + state = efalse; + } + else + state = efalse; + } + else if (IdentComp(IdentMinMarginLeft)) + { + if (Number(num)) + iModel->iInfo.iMinMarginsInPixels.iLeft = num; + else + state = efalse; + } + else if (IdentComp(IdentMinMarginRight)) + { + if (Number(num)) + iModel->iInfo.iMinMarginsInPixels.iRight = num; + else + state = efalse; + } + else if (IdentComp(IdentMinMarginTop)) + { + if (Number(num)) + iModel->iInfo.iMinMarginsInPixels.iTop = num; + else + state = efalse; + } + else if (IdentComp(IdentMinMarginBottom)) + { + if (Number(num)) + iModel->iInfo.iMinMarginsInPixels.iBottom = num; + else + state = efalse; + } + else if (IdentComp(IdentDisplayMode)) + { + int i; // DEF102183: Graphics tools fail to build using MS VC8. + for (i = 0; (i < NumDisplayModeValues) && !IdentComp(IdentDisplayModeValue[i]); i++) + { // Tries to match display mode identifier + } + if (i < NumDisplayModeValues) + { + iModel->iInfo.iDisplayMode = i; + } + else + { + state = efalse; + Error("Display mode identifier expected"); + } + } + else if (IdentComp(IdentTypefaceFontss)) + { + state = NewLine(); + while (!IdentComp(IdentEndTypefaceFontss) && !_EOF() && state) + { + TypefaceFontsEntry* typefacefontsentry = NULL; + if (iLex->iType == ELexIdent) + { + state = IdentCopy(label); + Record* typefacefonts = iPdrModelStore.FindTypefaceFonts(label); + if (typefacefonts) + { + typefacefontsentry = TypefaceFontsEntry::New(typefacefonts); + state = etrue; + } + else + { + Error("Typefacefonts not found"); + state = efalse; + } + } + if (state) + { + while ((iLex->iType != ELexNL) && !_EOF() && state) + { + if (IdentComp(IdentNotInPortrait)) + { + typefacefontsentry->iNotInPortrait = etrue; + } + else if (IdentComp(IdentNotInLandscape)) + { + typefacefontsentry->iNotInLandscape = etrue; + } + else + { + Error("Typefacefontsentry identifier or newline expected"); + state = efalse; + } + } + if (state) + iModel->iInfo.AddTypefaceFontsEntry(typefacefontsentry); + else + typefacefontsentry->Delete(); + } + if (state) + state = NewLine(); + } + } + else + { + Error("unrecognised model identifier"); + state = efalse; + } + } + else + { + Error("Model identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + iPdrModelStore.AddModel(iModel); + cout << "Model read\n"; + } + else + iModel->Delete(); + return state; + } + +boolean PdrReader::ReadPdrStoreFile() + { + boolean state = etrue; + if (iPdrStoreFile) + { + state = efalse; + Error("Pdrstorefile already read"); + } + else + { + iPdrStoreFile = PdrStoreFile::New(); + String label; + Record* model; + state = NewLine(); + while (!IdentComp(IdentEndPdrStoreFile) && !_EOF() && state) + { + if (IdentComp(IdentPDLName)) + { + state = StringCopy(iPdrStoreFile->iPDLName); + } + else if (IdentComp(IdentPDLUid)) + { + state = Number(iPdrStoreFile->iPDLUid); + } + else if (IdentComp(IdentModels)) + { + state = NewLine(); + while (!IdentComp(IdentEndModels) && !_EOF() && state) + { + state = IdentCopy(label); + if (state) + { + model = iPdrModelStore.FindModel(label); + if (model) + { + iPdrStoreFile->AddModel((PrinterModelHeader*)model); + } + else + { + Error("model not found"); + state = efalse; + } + } + if (state) + state = NewLine(); + } + } + else + { + Error("Pdrstorefile identifier expected"); + state = efalse; + } + if (state) + state = NewLine(); + } + if (state) + { + iPdrModelStore.AddPdrStoreFile(iPdrStoreFile); + cout << "Pdrstorefile read\n"; + } + else + iPdrStoreFile->Delete(); + } + return state; + } + +EXPORT_C boolean PdrReader::Store(const String& aFilename) + { + boolean state = etrue; + if (!iPdrStoreFile) + { + state = efalse; + Error("No pdrstore file record"); + } + else + state = iPdrModelStore.Store(aFilename); + return state; + } + +boolean PdrReader::Command(String& aCommand) + { + boolean state = etrue; + String string; + state = StringCopy(string); + int length = string.Length(); + for (int i = 0; i < length; i++) + { + char ch = string[i]; + if (ch == '<') // Read control character + { + ch = 0; + for (i = i + 1; (i < length) && (string[i] != '>'); i++) + ch = char((ch * 10) + (string[i] - '0')); + } + aCommand += ch; + } + return state; + } +/* +boolean PdrReader::ReadExtraInfo() + { + boolean state = etrue; + String label; + PdrExtraInfo* extrainfo = new PdrExtraInfo(); + state = IdentCopy(extrainfo->iLabel); + if (state) + state = NewLine(); + while (!IdentComp(IdentEndExtraInfo) && !_EOF() && state) + { + String* string = new String; + state = Command(*string); + if (state) + extrainfo->iInfo.Add(string); + else + delete string; + state = NewLine(); + } + if (state) + { + iPdrModelStore.AddExtraInfo(extrainfo); + cout << "Extra info read\n"; + } + else + delete extrainfo; + return state; + } +*/ diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRRECRD.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRRECRD.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,785 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header PDRRECRD.CPP +* +*/ + + +#include "PDRRECRD.H" + +EXPORT_C PdrResource* PdrResource::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PdrResource(); + } + +EXPORT_C void PdrResource::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrResource::Externalize(ostream& out) + { + uint8 id = (uint8) iId; + out.write((char*) &id, sizeof(id)); + iString.Externalize(out); + } + +EXPORT_C PdrResources* PdrResources::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PdrResources(); + } + +EXPORT_C void PdrResources::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrResources::Externalize(ostream& out) + { + iStreamId = out.tellp(); + iPdrResourceList.Externalize(out); + } + +EXPORT_C void PdrResources::AddResource(PdrResource* aResource) +/** Adds a printer resource to the object. + +@param aResource Printer resource. */ + { + iPdrResourceList.Add(aResource); + } + +PdrResources::~PdrResources() +/** Default destructor. */ + { + iPdrResourceList.Destroy(); + } + +EXPORT_C PdrTranslation* PdrTranslation::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PdrTranslation(); + } + +EXPORT_C void PdrTranslation::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrTranslation::Externalize(ostream& out) + { + out.write((char*) &iFrom, sizeof(iFrom)); + iTo.Externalize(out); + } + +EXPORT_C PdrTranslates* PdrTranslates::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PdrTranslates(); + } + +EXPORT_C void PdrTranslates::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrTranslates::Externalize(ostream& out) + { + iStreamId = out.tellp(); + iPdrTranslationList.Externalize(out); + } + +EXPORT_C void PdrTranslates::AddTranslation(PdrTranslation* aTranslation) +/** Adds a printer translation to the list. + +@param aTranslation Reference to a translation. */ + { + iPdrTranslationList.Add(aTranslation); + } + +PdrTranslates::~PdrTranslates() +/** This function is internal, and is not intended for use. */ + { + iPdrTranslationList.Destroy(); + } + +EXPORT_C Width* Width::New() +/** Creates a new instance of this object. + +@return Reference to a new object. */ + { + return new Width(); + } + +EXPORT_C void Width::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void Width::Externalize(ostream& out) + { + out.write ((char*) &iWidthInPixels, sizeof(iWidthInPixels)); + } + +WidthsCodeSection::WidthsCodeSection() + : iWidthList() +/** This function is internal only, and is not intended for use. */ + { + } + +EXPORT_C WidthsCodeSection* WidthsCodeSection::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new WidthsCodeSection(); + } + +EXPORT_C void WidthsCodeSection::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void WidthsCodeSection::Externalize(ostream& out) + { + out.write((char*) &iStart, sizeof(iStart)); + out.write((char*) &iEnd, sizeof(iEnd)); + iWidthList.Externalize(out); + } + +EXPORT_C void WidthsCodeSection::AddWidth(Width* aWidth) +/** Adds a new font width to the list. + +@param aWidth Font width. */ + { + iWidthList.Add(aWidth); + } + +EXPORT_C Width* WidthsCodeSection::WidthList(int i) +/** Returns a font width from the list at the position specified. + +@param i Position of font width in list. +@return Reference to a font width. */ + { + return iWidthList[i]; + } + +EXPORT_C int WidthsCodeSection::NumWidths() +/** Returns the number of font widths in the list. + +@return Number of widths. */ + { + return iWidthList.Size(); + } + +WidthsCodeSection::~WidthsCodeSection() +/** Default destructor. */ + { + iWidthList.Destroy(); + } + +EXPORT_C FontInfo* FontInfo::New() +/** Creates a new instance of this class. + +@return Reference to a new instance of this class. */ + { + return new FontInfo(); + } + +EXPORT_C void FontInfo::Delete() +/** Deletes the current FontInfo object. */ + { + delete this; + } + +void FontInfo::Externalize(ostream& out) + { + iStreamId = out.tellp(); + out.write((char*) &iAscentInPixels, sizeof(iAscentInPixels)); + out.write((char*) &iMaxCharWidthInPixels, sizeof(iMaxCharWidthInPixels)); + out.write((char*) &iMaxNormalCharWidthInPixels, sizeof(iMaxNormalCharWidthInPixels)); + iCodeSectionList.Externalize(out); + } + +EXPORT_C void FontInfo::AddCodeSection(WidthsCodeSection* aCodeSection) +/** Adds a section of information about the font to an internally-stored array. + +@param aCodeSection Font information. */ + { + iCodeSectionList.Add(aCodeSection); + } + +EXPORT_C WidthsCodeSection* FontInfo::CodeSectionList(int i) +/** Returns a section of font information from a specified position in the internally-stored +array. + +@param i Postion of information in the array. +@return Reference to section of font information. */ + { + return iCodeSectionList[i]; + } + +EXPORT_C int FontInfo::NumCodeSections() +/** Returns the number of sections of font information in the internally-stored +array. + +@return Current number of font information sections. */ + { + return iCodeSectionList.Size(); + } + +FontInfo::~FontInfo() +/** This function is internal, and not intended for use. */ + { + iCodeSectionList.Destroy(); + } + +EXPORT_C PdrStyle* PdrStyle::New() +/** Creates a new instance of this class + +@return Reference to a new object. */ + { + return new PdrStyle(); + } + +EXPORT_C void PdrStyle::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrStyle::Externalize(ostream& out) + { + out.write((char*) &iIsAvailable, sizeof(iIsAvailable)); + streamoff streamid = 0; + if (iIsAvailable) + streamid = iFontInfo->iStreamId; + ::ExternalizeStreamOff(out, streamid); + } + +PdrStyle::PdrStyle() + : iIsAvailable(efalse) +/** Default constructor. */ + { + } + +EXPORT_C PdrFontHeight* PdrFontHeight::New() +/** Returns a new instance of this class. + +@return Reference to new object. */ + { + return new PdrFontHeight(); + } + +EXPORT_C void PdrFontHeight::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PdrFontHeight::Externalize(ostream& out) + { + iCommandString.Externalize(out); + out.write((char*) &iHeightInTwips, sizeof(iHeightInTwips)); + out.write((char*) &iWidthScale, sizeof(iWidthScale)); + for (int style = Normal;style <= BoldItalic; style++) + iStyle[style].Externalize(out); + } + +PdrFontHeight::PdrFontHeight(): + iWidthScale(1) +/** Default constructor. */ + { + } + +PdrScalableFontHeight::PdrScalableFontHeight() +/** Default constructor. */ + { + } + +void PdrScalableFontHeight::Externalize(ostream& out) + { + iCommandString.Externalize(out); + out.write((char*) &iHeightMinInTwips, sizeof(iHeightMinInTwips)); + out.write((char*) &iHeightMaxInTwips, sizeof(iHeightMaxInTwips)); + out.write((char*) &iHeightDeltaInTwips, sizeof(iHeightDeltaInTwips)); + for (int style = Normal; style <= BoldItalic; style++) + iStyle[style].Externalize(out); + } + +EXPORT_C TypefaceFonts* TypefaceFonts::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new TypefaceFonts(); + } + +EXPORT_C void TypefaceFonts::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void TypefaceFonts::Externalize(ostream& out) + { + iStreamId = out.tellp(); + iTypeface.Externalize(out); + out.write((char*) &iIsScalable, sizeof(iIsScalable)); + if (iIsScalable) + iScalableFontHeight.Externalize(out); + else + iFontHeightList.Externalize(out); + ::ExternalizeStreamOff(out, iTranslates->iStreamId); + } + +EXPORT_C void TypefaceFonts::AddFontHeight(PdrFontHeight* aFontHeight) + { + iFontHeightList.Add(aFontHeight); + } + +EXPORT_C int TypefaceFonts::NumFontHeights() +/** Returns the number of font height descriptions currently held in the list. + +@return Number of descriptions. */ + { + return iFontHeightList.Size(); + } + +PdrFontHeight* TypefaceFonts::FontHeightList(int i) +/** Returns the font height description from the position specified in the list. + +@param i Position of description. +@return Font height description. */ + { + return iFontHeightList[i]; + } + +TypefaceFonts::TypefaceFonts(): + iIsScalable(efalse) +/** This function is internal only, and is not intended for use. */ + { + } + +TypefaceFonts::~TypefaceFonts() +/** This function is internal only, and is not intended for use. */ + { + iFontHeightList.Destroy(); + } + +EXPORT_C TypefaceFontsEntry* TypefaceFontsEntry::New(Record* aTypefaceFonts) + { + return new TypefaceFontsEntry(aTypefaceFonts); + } + +EXPORT_C void TypefaceFontsEntry::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void TypefaceFontsEntry::Externalize(ostream& out) + { + ::ExternalizeStreamOff(out, iTypefaceFonts->iStreamId); + out.write((char*) &iNotInPortrait, sizeof(iNotInPortrait)); + out.write((char*) &iNotInLandscape, sizeof(iNotInLandscape)); + } + +TypefaceFontsEntry::TypefaceFontsEntry(Record* aTypefaceFonts) + : iTypefaceFonts(aTypefaceFonts), iNotInPortrait(efalse), iNotInLandscape(efalse) + { + } + +TypefaceFontsEntry::~TypefaceFontsEntry() +/** Default destructor. */ + { + } + +void Margins::Externalize(ostream& out) + { + out.write((char*) &iLeft, sizeof(iLeft)); + out.write((char*) &iRight, sizeof(iRight)); + out.write((char*) &iTop, sizeof(iTop)); + out.write((char*) &iBottom, sizeof(iBottom)); + } + +/* +PdrExtraInfo::~PdrExtraInfo() + { + iInfo.Destroy(); + } + +void PdrExtraInfo::Externalize(ostream& out) + { + iInfo.Externalize(out); + } +*/ + +void PdrModelInfo::Externalize(ostream& out) + { + iStreamId=out.tellp(); + out.write((char*) &KPdrtranVersion, sizeof(KPdrtranVersion)); + out.write((char*) &iFlags, sizeof(iFlags)); + out.write((char*) &iKPixelWidthInTwips, sizeof(iKPixelWidthInTwips)); + out.write((char*) &iKPixelHeightInTwips, sizeof(iKPixelHeightInTwips)); + iPortraitOffsetInPixels.Externalize(out); + iLandscapeOffsetInPixels.Externalize(out); + iMinMarginsInPixels.Externalize(out); + out.write((char*) &iDisplayMode, sizeof(iDisplayMode)); + iTypefaceFontsEntryList.Externalize(out); + ::ExternalizeStreamOff(out, iResources->iStreamId); + streamoff streamid = 0; + if (iSpareRecord) + streamid = iSpareRecord->iStreamId; + ::ExternalizeStreamOff(out, streamid); + } + +EXPORT_C void PdrModelInfo::AddTypefaceFontsEntry(TypefaceFontsEntry* aTypefaceFontsEntry) +/** Adds an entry containing information about typeface fonts to an internally-stored +array. + +@param aTypefaceFontsEntry Typeface font information. */ + { + iTypefaceFontsEntryList.Add(aTypefaceFontsEntry); + } + +int PdrModelInfo::NumTypefaceFontsEntries() +/** Returns the number of entries containing information about typeface fonts in +the internally-stored array. + +@return Number of entries. */ + { + return iTypefaceFontsEntryList.Size(); + } + +TypefaceFontsEntry* PdrModelInfo::TypefaceFontsEntryList(int i) +/** Returns the typeface font entry stored the internal array from the position +specified. + +@param i Position in array. +@return Typeface font entry. */ + { + return iTypefaceFontsEntryList[i]; + } + +PdrModelInfo::PdrModelInfo() + : iStreamId(0), + iFlags(0), + iKPixelWidthInTwips(0), + iKPixelHeightInTwips(0), + iPortraitOffsetInPixels(), + iLandscapeOffsetInPixels(), + iMinMarginsInPixels(), + iDisplayMode(0), + iTypefaceFontsEntryList(), + iResources(NULL), + iSpareRecord(NULL) // !! Not used yet +/** Default constructor. */ + { + } + +PdrModelInfo::~PdrModelInfo() +/** Default destructor. */ + { + iTypefaceFontsEntryList.Destroy(); + } + +PrinterModelEntry::PrinterModelEntry() + : iName(), iRequiresPrinterPort(efalse), iUid(KNullUid) +/** Default constructor. */ + { + } + +void PrinterModelEntry::Externalize(ostream& out) + { + iName.Externalize(out); + out.write((char*) &iRequiresPrinterPort, sizeof(iRequiresPrinterPort)); + out.write((char*) &iUid, sizeof(iUid)); + } + +EXPORT_C PrinterModelHeader* PrinterModelHeader::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PrinterModelHeader(); + } + +EXPORT_C void PrinterModelHeader::Delete() +/** Deletes the current object. */ + { + delete this; + } + +void PrinterModelHeader::Externalize(ostream& out) + { + iEntry.Externalize(out); + ::ExternalizeStreamOff(out, iInfo.iStreamId); + } + +void PrinterModelHeader::ExternalizeData(ostream& out) + { + iInfo.Externalize(out); + } + +boolean PrinterModelHeader::IsPdrModel() +/** Determines whether printer information is available for this printer model. + +@return ETrue: printer description is available. */ + { + return iInfo.NumTypefaceFontsEntries() || iInfo.iResources; + } + +EXPORT_C PdrStoreFile* PdrStoreFile::New() +/** Creates a new instance of this class. + +@return Reference to a new object. */ + { + return new PdrStoreFile(); + } + +EXPORT_C void PdrStoreFile::Delete() +/** Deletes the current object. */ + { + delete this; + } + +EXPORT_C void PdrStoreFile::AddModel(PrinterModelHeader* aModel) +/** Adds a printer model. + +@param aModel Printer model. */ + { + iModelList.Add(aModel); + if (aModel->IsPdrModel()) + { + for (int i = 0; i < aModel->iInfo.NumTypefaceFontsEntries(); i++) + AddTypefaceFonts((TypefaceFonts*) aModel->iInfo.TypefaceFontsEntryList(i)->iTypefaceFonts); + iResourcesList.Add(aModel->iInfo.iResources); +// if (aModel->iInfo.iSpareRecord) +// iExtraInfoList.Add(aModel->iInfo.iSpareRecord); + } + } + +void PdrStoreFile::Externalize(ostream& out) + { + ExternalizeHeader(out); + ExternalizeComponents(out); + } + +void PdrStoreFile::ExternalizeHeader(ostream& out) + { + out.write((char*) &KStoreWriteOnceLayoutUid, sizeof(KStoreWriteOnceLayoutUid)); + out.write((char*) &KPdrStoreFileUid, sizeof(KPdrStoreFileUid)); + out.write((char*) &KNullUid, sizeof(KNullUid)); + out.write((char*) &KPdrStoreFileChecksum, sizeof(KPdrStoreFileChecksum)); + ::ExternalizeStreamOff(out, iStreamId); + iStreamId = out.tellp(); + iPDLName.Externalize(out); + out.write((char*) &iPDLUid, sizeof(iPDLUid)); + iModelList.Externalize(out); + } + +void PdrStoreFile::AddTypefaceFonts(TypefaceFonts* aTypefaceFonts) + { + iTypefaceFontsList.Add(aTypefaceFonts); + iTranslatesList.Add(aTypefaceFonts->iTranslates); + if (aTypefaceFonts->iIsScalable) + { + for (int style = Normal; style <= BoldItalic; style++) + { + if (aTypefaceFonts->iScalableFontHeight.iStyle[style].iIsAvailable) + iFontInfoList.Add(aTypefaceFonts->iScalableFontHeight.iStyle[style].iFontInfo); + } + } + else + { + for (int j = 0; j < aTypefaceFonts->NumFontHeights(); j++) + { + PdrFontHeight* fontheight = aTypefaceFonts->FontHeightList(j); + for (int style = Normal; style <= BoldItalic; style++) + { + if (fontheight->iStyle[style].iIsAvailable) + iFontInfoList.Add(fontheight->iStyle[style].iFontInfo); + } + } + } + } + +void PdrStoreFile::ExternalizeComponents(ostream& out) + { + for (int i = 0; i < iModelList.Size(); i++) + { + PrinterModelHeader* model = (PrinterModelHeader*) iModelList[i]; + if (model->IsPdrModel()) + model->ExternalizeData(out); + } + iTypefaceFontsList.Externalize(out); + iFontInfoList.Externalize(out); + iResourcesList.Externalize(out); + iTranslatesList.Externalize(out); +// iExtraInfoList.Externalize(out); + } + +PdrStoreFile::PdrStoreFile() + : Record(), + iPDLName(), + iPDLUid(KNullUid), + iModelList(), + iTypefaceFontsList(), + iFontInfoList(), + iResourcesList(), + iTranslatesList() +/** This function is internal only, and is not intended for use. */ + { + } + +EXPORT_C boolean PdrModelStore::Store(const String& aFilename) +/** Externalizes printer information from the store to the specfied external file. + +@param aFilename Filename. +@return ETrue: store successful. */ + { + boolean state = efalse; + ofstream fout; + String string = aFilename; + fout.open(string.Text(), ios::binary); + if (!fout.fail()) + { + iPdrStoreFile->Externalize(fout); + fout.close(); + fout.open(string.Text(), ios::binary | ios::trunc); + iPdrStoreFile->Externalize(fout); + fout.close(); + state = etrue; + } + return state; + } + +EXPORT_C void PdrModelStore::AddPdrStoreFile(PdrStoreFile* aPdrStoreFile) + { + iPdrStoreFile = aPdrStoreFile; + } + +EXPORT_C void PdrModelStore::AddModel(PrinterModelHeader *aModel) +/** Adds a printer model to the store. + +@param aModel Printer model. */ + { + iModelList.Add(aModel); + } + +EXPORT_C Record *PdrModelStore::FindModel(String& aLabel) + { + return iModelList.LabelToRecord(aLabel); + } + +EXPORT_C void PdrModelStore::AddTypefaceFonts(TypefaceFonts *aTypefaceFonts) +/** Adds typeface information to the store. + +@param aTypefaceFonts Typeface fonts. */ + { + iTypefaceFontsList.Add(aTypefaceFonts); + } + +EXPORT_C Record *PdrModelStore::FindTypefaceFonts(String& aLabel) + { + return iTypefaceFontsList.LabelToRecord(aLabel); + } + +EXPORT_C void PdrModelStore::AddFontInfo(FontInfo *aFontInfo) +/** Adds font information to the store. + +@param aFontInfo Font information. */ + { + iFontInfoList.Add(aFontInfo); + } + +EXPORT_C Record *PdrModelStore::FindFontInfo(String& aLabel) + { + return iFontInfoList.LabelToRecord(aLabel); + } + +EXPORT_C void PdrModelStore::AddResources(PdrResources *aResources) + { + iResourcesList.Add(aResources); + } + +EXPORT_C Record *PdrModelStore::FindResources(String& aLabel) + { + return iResourcesList.LabelToRecord(aLabel); + } + +EXPORT_C void PdrModelStore::AddTranslates(PdrTranslates *aTranslates) +/** Adds printer translations to the store. + +@param aTranslates Translation list. */ + { + iTranslatesList.Add(aTranslates); + } + +EXPORT_C Record *PdrModelStore::FindTranslates(String& aLabel) + { + return iTranslatesList.LabelToRecord(aLabel); + } + + /* +void PdrModelStore::AddExtraInfo(PdrExtraInfo *aInfo) + { + iExtraInfoList.Add(aInfo); + } + +Record* PdrModelStore::FindExtraInfo(String& aLabel) + { + return iExtraInfoList.LabelToRecord(aLabel); + } +*/ + +PdrModelStore::PdrModelStore() + : iPdrStoreFile(NULL), + iModelList(), + iTypefaceFontsList(), + iFontInfoList(), + iResourcesList()//, +// iExtraInfoList() +/** Default constructor. */ + { + } + +PdrModelStore::~PdrModelStore() +/** Default destructor. */ + { + delete iPdrStoreFile; + iModelList.Destroy(); + iTypefaceFontsList.Destroy(); + iFontInfoList.Destroy(); + iResourcesList.Destroy(); + iTranslatesList.Destroy(); +// iExtraInfoList.Destroy(); + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRTRAN.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/PDRTRAN.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header PDRTRAN.CPP +* +*/ + + +#include "PDRREADR.H" + +bool OutputUnicode = false; + +// Input and output filenames entered in command line +int main(int argc, char *argv[]) + { + cout << "\nPDRTRAN V"; + cout << KPdrtranVersion << "\n"; + cout << "Copyright (c) 1998-2004 Symbian Software Ltd.\n"; + + if(argc!=3) + { + cout << "Usage: PDRTRAN srcfile [srcfile2 ..] destfile\n"; + cout << "where srcfile is the file containing printer models,\n"; + cout << "typeface information and character width tables, and\n"; + cout << "destfile is the pdr store file.\n"; + return -1; + } + + PdrReader reader; + + for (int i = 1; i < argc - 1; i++) + { + if (!reader.Read(argv[i])) + { + cerr << "Problem encountered in file " << argv[i] << "\n"; + return -1; + } + } + if (!reader.Store(argv[argc - 1])) + { + cerr << "Problem writing pdr file " << argv[argc - 1] << "\n"; + return -1; + } + cout << argv[argc-1] << " created\n"; + return 0; + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/READER.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/READER.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header READER.CPP +* +*/ + + +#include "READER.H" + +Reader::Reader() + { + iLexAnal = NULL; + } + +boolean Reader::Open(const String& aFilename) + { + boolean state; + String string = aFilename; + if (iLexAnal != NULL) + delete iLexAnal; + iLexAnal = new LexAnal(string.Text()); + + if (iLexAnal) + { + state = etrue; + iLex =& (iLexAnal->iLex); + iLexAnal->Read(); // reads first lexical + } + else + state = efalse; + + return state; + } + +Reader::~Reader() + { + if (iLexAnal != NULL) + delete iLexAnal; + } + +boolean Reader::_EOF() + { + return ((iLex->iType) == ELexEOF); + } + +boolean Reader::NewLine() + { + boolean state; + if (iLex->iType == ELexNL) + { + iLexAnal->Read(); + state = etrue; + } + else + { + Error(String("Newline expected")); + state = efalse; + } + return state; + } + +boolean Reader::Number(int& aNumber) + { + boolean state; + if (iLex->iType == ELexNumber) + { + aNumber = iLex->iNumber; + iLexAnal->Read(); + state = etrue; + } + else + { + Error(String("Number expected")); + state = efalse; + } + return state; + } + +boolean Reader::IdentComp(const String& aIdent) + { + boolean state; + if (iLex->iType == ELexIdent) + { + if (aIdent == iLex->iText) + { + iLexAnal->Read(); + state = etrue; + } + else + state = efalse; + } + else + { + state = efalse; + } + return state; + } + +boolean Reader::IdentCopy(String& aIdent) + { + boolean state; + if (iLex->iType == ELexIdent) + { + aIdent = iLex->iText; + iLexAnal->Read(); + state = etrue; + } + else + { + Error(String("Identifier expected")); + state = efalse; + } + return state; + } + +boolean Reader::StringCopy(String& aString) + { + boolean state; + if (iLex->iType == ELexString) + { + aString = iLex->iText; + iLexAnal->Read(); + state = etrue; + } + else + { + Error(String("String expected")); + state = efalse; + } + return state; + } + +boolean Reader::Operator(char& aCh) + { + boolean state; + if (iLex->iType == ELexOperator) + { + aCh = iLex->iText[0]; + iLexAnal->Read(); + state = etrue; + } + else + { + Error(String("Operator expected")); + state = efalse; + } + return state; + } + +EXPORT_C void Reader::Error(const String& aString) + { + cerr << "Error: " << aString; + iLexAnal->Report(); + while ((iLex->iType != ELexNL) && (iLex->iType != ELexEOF)) + iLexAnal->Read(); + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/RECORD.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/RECORD.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header RECORD.CPP +* +*/ + + +#include "RECORD.H" + +EXPORT_C Record::Record() + : iLabel(), iStreamId(0) + { + } + +void RecordList::ExternalizeIds(ostream& out) + { + int32 i; + int32 size = Size(); + out.write((char*) &size, sizeof(size)); + for (i = 0; i < size; i++) + { + ::ExternalizeStreamOff(out, (*this)[i]->iStreamId); + } + } + +void RecordList::Externalize(ostream& out) + { + int32 size = Size(); + out.write ((char*) &size, sizeof(size)); + for (int i = 0; i < size; i++) + (*this)[i]->Externalize(out); + } + +void RecordList::ExternalizeComponents(ostream& out) + { + int32 size = Size(); + for (int i = 0; i < size; i++) + (*this)[i]->ExternalizeComponents(out); + } + +EXPORT_C void RecordList::Add(Record* aRecord) + { + if (!LabelToRecord(aRecord->iLabel)) + List::Add(aRecord); + } + +EXPORT_C Record *RecordList::LabelToRecord(const String& aLabel) + { + int32 size = Size(); + Record *record=NULL; + if (aLabel.Length()) + for (int i = 0; i < size; i++) + if ((*this)[i]->iLabel == aLabel) + record = (*this)[i]; + return record; + } + +EXPORT_C void RecordList::Destroy() + { + List::Destroy(); + } + +EXPORT_C RecordList::~RecordList() + { + } + +EXPORT_C Typeface::Typeface() + : iName(), iFlags(0) + { + } + +void Typeface::Externalize(ostream& out) + { + iName.Externalize(out); + out.put((char) iFlags); + } + +void Point::Externalize(ostream& out) + { + out.write((char*) &iX, sizeof(iX)); + out.write((char*) &iY, sizeof(iY)); + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/STRNG.CPP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/test_resources/tools2/pdrtran/src/STRNG.CPP Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header STRNG.CPP +* +*/ + + +#include "STRNG.H" + +extern bool OutputUnicode; + +ostream& operator << (ostream& out, const String& aString) + { + for (int i = 0; i < aString.iLength; i++) + out << aString.iText[i]; + out << '\n'; + return out; + } + +EXPORT_C void String::Externalize(ostream& out) + { + if (OutputUnicode) + { + // Convert the string to Unicode, allowing #NNNN (each N is a hex digit) + // to represent an arbitrary Unicode character. Other values are just + // extended, so don't use codepage 1252 values in the range 128..159. + unsigned short* buffer = new unsigned short[iLength]; + int i = 0; + int j = 0; + while (i < iLength) + { + if (iText[i] == '#') + { + i++; + char hex[5]; + hex[0] = iText[i++]; + hex[1] = iText[i++]; + hex[2] = iText[i++]; + hex[3] = iText[i++]; + hex[4] = 0; + buffer[j++] = (unsigned short)strtoul(hex, NULL, 16); + } + else + { + buffer[j] = iText[i]; + buffer[j] &= 0xFF; + i++; + j++; + } + } + int unicode_characters = j; + int32 length = (unicode_characters << 1); // 16-bit data + if (length < 0x80) + { + unsigned char len = (unsigned char)(length << 1); + out.write((char*)&len, sizeof(len)); + } + else if (length < 0x4000) + { + uint16 len = (uint16)((length << 2) + 1); + out.write((char*)&len, sizeof(len)); + } + else + { + // assert len<0x20000000 ? + uint32 len = (uint32)((length << 3) + 3); + out.write((char*)&len, sizeof(len)); + } + // Output Unicode characters using the Standard Compression Scheme for Unicode. + // To save the bother of doing this properly, use a degenerate form whereby each + // Unicode character is output as itself. 0x0F selects Unicode mode and 0xF0 quotes + // characters that would conflict with other tags. + out << (unsigned char)0x0F; + + for (i = 0; i < unicode_characters; i++) + { + unsigned char hi = (unsigned char)(buffer[i] >> 8); + unsigned char lo = (unsigned char)buffer[i]; + if ((hi >= 0xe0) && (hi <= 0xf2)) + out << 0xf0; + out << hi; + out << lo; + } + + delete [] buffer; + } + else + { + int32 length = (iLength << 1) + 1; // 8-bit data + if (length < 0x80) + { + unsigned char len = (unsigned char)(length << 1); + out.write((char*)&len, sizeof(len)); + } + else if (length < 0x4000) + { + uint16 len = (uint16)((length << 2) + 1); + out.write((char*)&len, sizeof(len)); + } + else + { + // assert len<0x20000000 ? + uint32 len = (uint32)((length << 3) + 3); + out.write((char*)&len, sizeof(len)); + } + out.write(iText, iLength); + } + } + +EXPORT_C int String::CreateText(const int aLength) + { + if (aLength != iLength) + { + char* text = new char[aLength + 1]; + if (text) + { + iLength = aLength; + iText = text; + } + else + { + iLength = 0; + delete [] iText; + iText = NULL; + } + } + return iLength; + } + +EXPORT_C void String::DeleteText(char* aText) const + { + if (aText != iText) + delete [] aText; + } + +EXPORT_C String::~String() + { + delete [] iText; + } diff -r e8791bf8cc82 -r d23e846951c5 sbsv2/raptor/test/smoke_suite/tools2_cross_compilation.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/test/smoke_suite/tools2_cross_compilation.py Tue Jan 26 14:20:07 2010 +0000 @@ -0,0 +1,143 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +from raptor_tests import SmokeTest + +def run(): + t = SmokeTest() + t.description = "Tests Raptor can build win32 tools on linux" + + t.id = "105a" + t.name = "tools2_cross_compilation_pdrtran" + t.command = "sbs -b smoke_suite/test_resources/tools2/pdrtran/BLD.INF -c tools2 -c tools2.win32" + + t.targets = [ + "$(EPOCROOT)/epoc32/release/tools2/deb/pdrtran.exe", + "$(EPOCROOT)/epoc32/release/tools2/rel/pdrtran.exe", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/deb/pdrtran", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/pdrtran", + "$(EPOCROOT)/epoc32/tools/pdrtran.exe", + "$(EPOCROOT)/epoc32/tools/pdrtran" + ] + t.addbuildtargets("smoke_suite/test_resources/tools2/pdrtran/BLD.INF", [ + "pdrtran_/pdrtran_exe/tools2/deb/PDRTRAN.o", + "pdrtran_/pdrtran_exe/tools2/deb/LEXICAL.o", + "pdrtran_/pdrtran_exe/tools2/deb/PDRREADR.o", + "pdrtran_/pdrtran_exe/tools2/deb/PDRRECRD.o", + "pdrtran_/pdrtran_exe/tools2/deb/READER.o", + "pdrtran_/pdrtran_exe/tools2/deb/RECORD.o", + "pdrtran_/pdrtran_exe/tools2/deb/STRNG.o", + "pdrtran_/pdrtran_exe/tools2/rel/PDRTRAN.o", + "pdrtran_/pdrtran_exe/tools2/rel/LEXICAL.o", + "pdrtran_/pdrtran_exe/tools2/rel/PDRREADR.o", + "pdrtran_/pdrtran_exe/tools2/rel/PDRRECRD.o", + "pdrtran_/pdrtran_exe/tools2/rel/READER.o", + "pdrtran_/pdrtran_exe/tools2/rel/RECORD.o", + "pdrtran_/pdrtran_exe/tools2/rel/STRNG.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/PDRTRAN.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/LEXICAL.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/PDRREADR.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/PDRRECRD.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/READER.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/RECORD.o", + "pdrtran_/pdrtran_exe/tools2/deb/$(HOSTPLATFORM_DIR)/STRNG.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/PDRTRAN.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/LEXICAL.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/PDRREADR.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/PDRRECRD.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/READER.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/RECORD.o", + "pdrtran_/pdrtran_exe/tools2/rel/$(HOSTPLATFORM_DIR)/STRNG.o" + ]) + t.run("linux") + + + t.id = "105b" + t.name = "tools2_cross_compilation_libs" + t.command = "sbs -b smoke_suite/test_resources/tools2/bld.inf -c tools2.win32 -c tools2" + + t.targets = [ + "$(EPOCROOT)/epoc32/release/tools2/deb/tool_exe.exe", + "$(EPOCROOT)/epoc32/release/tools2/deb/libtool_lib1.a", + "$(EPOCROOT)/epoc32/release/tools2/deb/libtool_lib2.a", + "$(EPOCROOT)/epoc32/release/tools2/rel/tool_exe.exe", + "$(EPOCROOT)/epoc32/release/tools2/rel/libtool_lib1.a", + "$(EPOCROOT)/epoc32/release/tools2/rel/libtool_lib2.a", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/deb/tool_exe", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/deb/libtool_lib1.a", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/deb/libtool_lib2.a", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/tool_exe", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/libtool_lib1.a", + "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/libtool_lib2.a", + "$(EPOCROOT)/epoc32/tools/tool_exe.exe", + "$(EPOCROOT)/epoc32/tools/tool_exe" + ] + t.addbuildtargets("smoke_suite/test_resources/tools2/bld.inf", [ + "libtool_lib1_a/libtool_lib1_lib/tools2/rel/tool_lib1_b.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/rel/tool_lib1_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/rel/tool_lib2_b.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/rel/tool_lib2_a.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/deb/tool_lib1_b.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/deb/tool_lib1_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/deb/tool_lib2_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/deb/tool_lib2_b.o", + "tool_exe_exe/tool_exe_exe/tools2/rel/tool_exe_a.o", + "tool_exe_exe/tool_exe_exe/tools2/rel/tool_exe_b.o", + "tool_exe_exe/tool_exe_exe/tools2/deb/tool_exe_b.o", + "tool_exe_exe/tool_exe_exe/tools2/deb/tool_exe_a.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/rel/$(HOSTPLATFORM_DIR)/tool_lib1_b.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/rel/$(HOSTPLATFORM_DIR)/tool_lib1_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/rel/$(HOSTPLATFORM_DIR)/tool_lib2_b.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/rel/$(HOSTPLATFORM_DIR)/tool_lib2_a.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/deb/$(HOSTPLATFORM_DIR)/tool_lib1_b.o", + "libtool_lib1_a/libtool_lib1_lib/tools2/deb/$(HOSTPLATFORM_DIR)/tool_lib1_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/deb/$(HOSTPLATFORM_DIR)/tool_lib2_a.o", + "libtool_lib2_a/libtool_lib2_lib/tools2/deb/$(HOSTPLATFORM_DIR)/tool_lib2_b.o", + "tool_exe_exe/tool_exe_exe/tools2/rel/$(HOSTPLATFORM_DIR)/tool_exe_a.o", + "tool_exe_exe/tool_exe_exe/tools2/rel/$(HOSTPLATFORM_DIR)/tool_exe_b.o", + "tool_exe_exe/tool_exe_exe/tools2/deb/$(HOSTPLATFORM_DIR)/tool_exe_b.o", + "tool_exe_exe/tool_exe_exe/tools2/deb/$(HOSTPLATFORM_DIR)/tool_exe_a.o" + ]) + t.run("linux") + + + t.usebash = True + t.id = "105c" + t.name = "tools2_cross_compilation_toolcheck_linux" + t.command = "$(EPOCROOT)/epoc32/tools/pdrtran smoke_suite/test_resources/tools2/pdrtran/TEST.PD $(EPOCROOT)/epoc32/build/TEST_PDRTRAN.PDR" + t.targets = [ + "$(EPOCROOT)/epoc32/build/TEST_PDRTRAN.PDR" + ] + t.mustmatch = [ + "PDRTRAN V41" + ] + t.run("linux") + + + t.id = "105d" + t.name = "tools2_cross_compilation_toolcheck_windows" + t.command = "file $(EPOCROOT)/epoc32/tools/pdrtran.exe" + t.targets = [] + t.mustmatch = [ + "MS Windows" + ] + t.run("linux") + + + t.id = "105" + t.name = "tools2_cross_compilation" + t.print_result() + return t