Lines Matching refs:pBiDi
92 setTrailingWSStart(UBiDi *pBiDi) { in setTrailingWSStart() argument
95 const DirProp *dirProps=pBiDi->dirProps; in setTrailingWSStart()
96 UBiDiLevel *levels=pBiDi->levels; in setTrailingWSStart()
97 int32_t start=pBiDi->length; in setTrailingWSStart()
98 UBiDiLevel paraLevel=pBiDi->paraLevel; in setTrailingWSStart()
107 pBiDi->trailingWSStart=start; /* currently == pBiDi->length */ in setTrailingWSStart()
120 pBiDi->trailingWSStart=start; in setTrailingWSStart()
251 ubidi_getLevelAt(const UBiDi *pBiDi, int32_t charIndex) { in ubidi_getLevelAt() argument
253 if(!IS_VALID_PARA_OR_LINE(pBiDi) || charIndex<0 || pBiDi->length<=charIndex) { in ubidi_getLevelAt()
255 } else if(pBiDi->direction!=UBIDI_MIXED || charIndex>=pBiDi->trailingWSStart) { in ubidi_getLevelAt()
256 return GET_PARALEVEL(pBiDi, charIndex); in ubidi_getLevelAt()
258 return pBiDi->levels[charIndex]; in ubidi_getLevelAt()
263 ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) { in ubidi_getLevels() argument
267 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, NULL); in ubidi_getLevels()
268 if((length=pBiDi->length)<=0) { in ubidi_getLevels()
272 if((start=pBiDi->trailingWSStart)==length) { in ubidi_getLevels()
274 return pBiDi->levels; in ubidi_getLevels()
284 if(getLevelsMemory(pBiDi, length)) { in ubidi_getLevels()
285 UBiDiLevel *levels=pBiDi->levelsMemory; in ubidi_getLevels()
287 if(start>0 && levels!=pBiDi->levels) { in ubidi_getLevels()
288 uprv_memcpy(levels, pBiDi->levels, start); in ubidi_getLevels()
292 uprv_memset(levels+start, pBiDi->paraLevel, length-start); in ubidi_getLevels()
295 pBiDi->trailingWSStart=length; in ubidi_getLevels()
296 return pBiDi->levels=levels; in ubidi_getLevels()
305 ubidi_getLogicalRun(const UBiDi *pBiDi, int32_t logicalPosition, in ubidi_getLogicalRun() argument
312 RETURN_VOID_IF_BAD_RANGE(logicalPosition, 0, pBiDi->length, errorCode); in ubidi_getLogicalRun()
314 runCount=ubidi_countRuns((UBiDi *)pBiDi, &errorCode); in ubidi_getLogicalRun()
322 iRun=pBiDi->runs[0]; in ubidi_getLogicalRun()
325 iRun = pBiDi->runs[i]; in ubidi_getLogicalRun()
338 if(pBiDi->reorderingMode==UBIDI_REORDER_RUNS_ONLY) { in ubidi_getLogicalRun()
341 else if(pBiDi->direction!=UBIDI_MIXED || logicalPosition>=pBiDi->trailingWSStart) { in ubidi_getLogicalRun()
342 *pLevel=GET_PARALEVEL(pBiDi, logicalPosition); in ubidi_getLogicalRun()
344 *pLevel=pBiDi->levels[logicalPosition]; in ubidi_getLogicalRun()
352 ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode) { in ubidi_countRuns() argument
354 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, -1); in ubidi_countRuns()
355 ubidi_getRuns(pBiDi, pErrorCode); in ubidi_countRuns()
359 return pBiDi->runCount; in ubidi_countRuns()
363 ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex, in ubidi_getVisualRun() argument
368 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, errorCode, UBIDI_LTR); in ubidi_getVisualRun()
369 ubidi_getRuns(pBiDi, &errorCode); in ubidi_getVisualRun()
373 RETURN_IF_BAD_RANGE(runIndex, 0, pBiDi->runCount, errorCode, UBIDI_LTR); in ubidi_getVisualRun()
375 start=pBiDi->runs[runIndex].logicalStart; in ubidi_getVisualRun()
381 *pLength=pBiDi->runs[runIndex].visualLimit- in ubidi_getVisualRun()
382 pBiDi->runs[runIndex-1].visualLimit; in ubidi_getVisualRun()
384 *pLength=pBiDi->runs[0].visualLimit; in ubidi_getVisualRun()
392 getSingleRun(UBiDi *pBiDi, UBiDiLevel level) { in getSingleRun() argument
394 pBiDi->runs=pBiDi->simpleRuns; in getSingleRun()
395 pBiDi->runCount=1; in getSingleRun()
398 pBiDi->runs[0].logicalStart=MAKE_INDEX_ODD_PAIR(0, level); in getSingleRun()
399 pBiDi->runs[0].visualLimit=pBiDi->length; in getSingleRun()
400 pBiDi->runs[0].insertRemove=0; in getSingleRun()
437 reorderLine(UBiDi *pBiDi, UBiDiLevel minLevel, UBiDiLevel maxLevel) { in reorderLine() argument
454 runs=pBiDi->runs; in reorderLine()
455 levels=pBiDi->levels; in reorderLine()
456 runCount=pBiDi->runCount; in reorderLine()
459 if(pBiDi->trailingWSStart<pBiDi->length) { in reorderLine()
503 if(pBiDi->trailingWSStart==pBiDi->length) { in reorderLine()
520 static int32_t getRunFromLogicalIndex(UBiDi *pBiDi, int32_t logicalIndex) { in getRunFromLogicalIndex() argument
521 Run *runs=pBiDi->runs; in getRunFromLogicalIndex()
522 int32_t runCount=pBiDi->runCount, visualStart=0, i, length, logicalStart; in getRunFromLogicalIndex()
548 ubidi_getRuns(UBiDi *pBiDi, UErrorCode*) { in ubidi_getRuns() argument
553 if (pBiDi->runCount>=0) { in ubidi_getRuns()
557 if(pBiDi->direction!=UBIDI_MIXED) { in ubidi_getRuns()
560 getSingleRun(pBiDi, pBiDi->paraLevel); in ubidi_getRuns()
563 int32_t length=pBiDi->length, limit; in ubidi_getRuns()
564 UBiDiLevel *levels=pBiDi->levels; in ubidi_getRuns()
578 limit=pBiDi->trailingWSStart; in ubidi_getRuns()
595 getSingleRun(pBiDi, levels[0]); in ubidi_getRuns()
608 if(getRunsMemory(pBiDi, runCount)) { in ubidi_getRuns()
609 runs=pBiDi->runsMemory; in ubidi_getRuns()
651 if(pBiDi->paraLevel<minLevel) { in ubidi_getRuns()
652 minLevel=pBiDi->paraLevel; in ubidi_getRuns()
657 pBiDi->runs=runs; in ubidi_getRuns()
658 pBiDi->runCount=runCount; in ubidi_getRuns()
660 reorderLine(pBiDi, minLevel, maxLevel); in ubidi_getRuns()
676 int32_t trailingRun = ((pBiDi->paraLevel & 1) != 0)? 0 : runIndex; in ubidi_getRuns()
678 ADD_ODD_BIT_FROM_LEVEL(runs[trailingRun].logicalStart, pBiDi->paraLevel); in ubidi_getRuns()
684 if(pBiDi->insertPoints.size>0) { in ubidi_getRuns()
685 Point *point, *start=pBiDi->insertPoints.points, in ubidi_getRuns()
686 *limit=start+pBiDi->insertPoints.size; in ubidi_getRuns()
689 runIndex=getRunFromLogicalIndex(pBiDi, point->pos); in ubidi_getRuns()
690 pBiDi->runs[runIndex].insertRemove|=point->flag; in ubidi_getRuns()
695 if(pBiDi->controlCount>0) { in ubidi_getRuns()
697 const UChar *start=pBiDi->text, *limit=start+pBiDi->length, *pu; in ubidi_getRuns()
700 runIndex=getRunFromLogicalIndex(pBiDi, (int32_t)(pu-start)); in ubidi_getRuns()
701 pBiDi->runs[runIndex].insertRemove--; in ubidi_getRuns()
875 ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode) { in ubidi_getVisualIndex() argument
878 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, -1); in ubidi_getVisualIndex()
879 RETURN_IF_BAD_RANGE(logicalIndex, 0, pBiDi->length, *pErrorCode, -1); in ubidi_getVisualIndex()
882 switch(pBiDi->direction) { in ubidi_getVisualIndex()
887 visualIndex=pBiDi->length-logicalIndex-1; in ubidi_getVisualIndex()
890 if(!ubidi_getRuns(pBiDi, pErrorCode)) { in ubidi_getVisualIndex()
894 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
898 for(i=0; i<pBiDi->runCount; ++i) { in ubidi_getVisualIndex()
913 if(i>=pBiDi->runCount) { in ubidi_getVisualIndex()
919 if(pBiDi->insertPoints.size>0) { in ubidi_getVisualIndex()
921 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
939 else if(pBiDi->controlCount>0) { in ubidi_getVisualIndex()
941 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
944 UChar uchar=pBiDi->text[logicalIndex]; in ubidi_getVisualIndex()
972 uchar=pBiDi->text[j]; in ubidi_getVisualIndex()
985 ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode) { in ubidi_getLogicalIndex() argument
989 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, -1); in ubidi_getLogicalIndex()
990 RETURN_IF_BAD_RANGE(visualIndex, 0, pBiDi->resultLength, *pErrorCode, -1); in ubidi_getLogicalIndex()
992 if(pBiDi->insertPoints.size==0 && pBiDi->controlCount==0) { in ubidi_getLogicalIndex()
993 if(pBiDi->direction==UBIDI_LTR) { in ubidi_getLogicalIndex()
996 else if(pBiDi->direction==UBIDI_RTL) { in ubidi_getLogicalIndex()
997 return pBiDi->length-visualIndex-1; in ubidi_getLogicalIndex()
1000 if(!ubidi_getRuns(pBiDi, pErrorCode)) { in ubidi_getLogicalIndex()
1005 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1006 runCount=pBiDi->runCount; in ubidi_getLogicalIndex()
1007 if(pBiDi->insertPoints.size>0) { in ubidi_getLogicalIndex()
1011 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1035 else if(pBiDi->controlCount>0) { in ubidi_getLogicalIndex()
1062 uchar=pBiDi->text[k]; in ubidi_getLogicalIndex()
1110 ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) { in ubidi_getLogicalMap() argument
1113 ubidi_countRuns(pBiDi, pErrorCode); in ubidi_getLogicalMap()
1122 Run *runs=pBiDi->runs; in ubidi_getLogicalMap()
1123 if (pBiDi->length<=0) { in ubidi_getLogicalMap()
1126 if (pBiDi->length>pBiDi->resultLength) { in ubidi_getLogicalMap()
1127 uprv_memset(indexMap, 0xFF, pBiDi->length*sizeof(int32_t)); in ubidi_getLogicalMap()
1131 for(j=0; j<pBiDi->runCount; ++j) { in ubidi_getLogicalMap()
1147 if(pBiDi->insertPoints.size>0) { in ubidi_getLogicalMap()
1148 int32_t markFound=0, runCount=pBiDi->runCount; in ubidi_getLogicalMap()
1170 else if(pBiDi->controlCount>0) { in ubidi_getLogicalMap()
1171 int32_t controlFound=0, runCount=pBiDi->runCount; in ubidi_getLogicalMap()
1197 uchar=pBiDi->text[k]; in ubidi_getLogicalMap()
1211 ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) { in ubidi_getVisualMap() argument
1218 ubidi_countRuns(pBiDi, pErrorCode); in ubidi_getVisualMap()
1221 Run *runs=pBiDi->runs, *runsLimit=runs+pBiDi->runCount; in ubidi_getVisualMap()
1224 if (pBiDi->resultLength<=0) { in ubidi_getVisualMap()
1245 if(pBiDi->insertPoints.size>0) { in ubidi_getVisualMap()
1246 int32_t markFound=0, runCount=pBiDi->runCount; in ubidi_getVisualMap()
1248 runs=pBiDi->runs; in ubidi_getVisualMap()
1260 k=pBiDi->resultLength; in ubidi_getVisualMap()
1277 else if(pBiDi->controlCount>0) { in ubidi_getVisualMap()
1278 int32_t runCount=pBiDi->runCount, logicalEnd; in ubidi_getVisualMap()
1282 runs=pBiDi->runs; in ubidi_getVisualMap()
1308 uchar=pBiDi->text[m]; in ubidi_getVisualMap()