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, UErrorCode *pErrorCode) { in getRunFromLogicalIndex() argument
521 Run *runs=pBiDi->runs; in getRunFromLogicalIndex()
522 int32_t runCount=pBiDi->runCount, visualStart=0, i, length, logicalStart; in getRunFromLogicalIndex()
550 ubidi_getRuns(UBiDi *pBiDi, UErrorCode *pErrorCode) { in ubidi_getRuns() argument
555 if (pBiDi->runCount>=0) { in ubidi_getRuns()
559 if(pBiDi->direction!=UBIDI_MIXED) { in ubidi_getRuns()
562 getSingleRun(pBiDi, pBiDi->paraLevel); in ubidi_getRuns()
565 int32_t length=pBiDi->length, limit; in ubidi_getRuns()
566 UBiDiLevel *levels=pBiDi->levels; in ubidi_getRuns()
580 limit=pBiDi->trailingWSStart; in ubidi_getRuns()
597 getSingleRun(pBiDi, levels[0]); in ubidi_getRuns()
610 if(getRunsMemory(pBiDi, runCount)) { in ubidi_getRuns()
611 runs=pBiDi->runsMemory; in ubidi_getRuns()
653 if(pBiDi->paraLevel<minLevel) { in ubidi_getRuns()
654 minLevel=pBiDi->paraLevel; in ubidi_getRuns()
659 pBiDi->runs=runs; in ubidi_getRuns()
660 pBiDi->runCount=runCount; in ubidi_getRuns()
662 reorderLine(pBiDi, minLevel, maxLevel); in ubidi_getRuns()
678 int32_t trailingRun = ((pBiDi->paraLevel & 1) != 0)? 0 : runIndex; in ubidi_getRuns()
680 ADD_ODD_BIT_FROM_LEVEL(runs[trailingRun].logicalStart, pBiDi->paraLevel); in ubidi_getRuns()
686 if(pBiDi->insertPoints.size>0) { in ubidi_getRuns()
687 Point *point, *start=pBiDi->insertPoints.points, in ubidi_getRuns()
688 *limit=start+pBiDi->insertPoints.size; in ubidi_getRuns()
691 runIndex=getRunFromLogicalIndex(pBiDi, point->pos, pErrorCode); in ubidi_getRuns()
692 pBiDi->runs[runIndex].insertRemove|=point->flag; in ubidi_getRuns()
697 if(pBiDi->controlCount>0) { in ubidi_getRuns()
699 const UChar *start=pBiDi->text, *limit=start+pBiDi->length, *pu; in ubidi_getRuns()
702 runIndex=getRunFromLogicalIndex(pBiDi, (int32_t)(pu-start), pErrorCode); in ubidi_getRuns()
703 pBiDi->runs[runIndex].insertRemove--; in ubidi_getRuns()
877 ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode) { in ubidi_getVisualIndex() argument
880 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, -1); in ubidi_getVisualIndex()
881 RETURN_IF_BAD_RANGE(logicalIndex, 0, pBiDi->length, *pErrorCode, -1); in ubidi_getVisualIndex()
884 switch(pBiDi->direction) { in ubidi_getVisualIndex()
889 visualIndex=pBiDi->length-logicalIndex-1; in ubidi_getVisualIndex()
892 if(!ubidi_getRuns(pBiDi, pErrorCode)) { in ubidi_getVisualIndex()
896 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
900 for(i=0; i<pBiDi->runCount; ++i) { in ubidi_getVisualIndex()
915 if(i>=pBiDi->runCount) { in ubidi_getVisualIndex()
921 if(pBiDi->insertPoints.size>0) { in ubidi_getVisualIndex()
923 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
941 else if(pBiDi->controlCount>0) { in ubidi_getVisualIndex()
943 Run *runs=pBiDi->runs; in ubidi_getVisualIndex()
946 UChar uchar=pBiDi->text[logicalIndex]; in ubidi_getVisualIndex()
974 uchar=pBiDi->text[j]; in ubidi_getVisualIndex()
987 ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode) { in ubidi_getLogicalIndex() argument
991 RETURN_IF_NOT_VALID_PARA_OR_LINE(pBiDi, *pErrorCode, -1); in ubidi_getLogicalIndex()
992 RETURN_IF_BAD_RANGE(visualIndex, 0, pBiDi->resultLength, *pErrorCode, -1); in ubidi_getLogicalIndex()
994 if(pBiDi->insertPoints.size==0 && pBiDi->controlCount==0) { in ubidi_getLogicalIndex()
995 if(pBiDi->direction==UBIDI_LTR) { in ubidi_getLogicalIndex()
998 else if(pBiDi->direction==UBIDI_RTL) { in ubidi_getLogicalIndex()
999 return pBiDi->length-visualIndex-1; in ubidi_getLogicalIndex()
1002 if(!ubidi_getRuns(pBiDi, pErrorCode)) { in ubidi_getLogicalIndex()
1007 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1008 runCount=pBiDi->runCount; in ubidi_getLogicalIndex()
1009 if(pBiDi->insertPoints.size>0) { in ubidi_getLogicalIndex()
1013 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1037 else if(pBiDi->controlCount>0) { in ubidi_getLogicalIndex()
1064 uchar=pBiDi->text[k]; in ubidi_getLogicalIndex()
1112 ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) { in ubidi_getLogicalMap() argument
1115 ubidi_countRuns(pBiDi, pErrorCode); in ubidi_getLogicalMap()
1124 Run *runs=pBiDi->runs; in ubidi_getLogicalMap()
1125 if (pBiDi->length<=0) { in ubidi_getLogicalMap()
1128 if (pBiDi->length>pBiDi->resultLength) { in ubidi_getLogicalMap()
1129 uprv_memset(indexMap, 0xFF, pBiDi->length*sizeof(int32_t)); in ubidi_getLogicalMap()
1133 for(j=0; j<pBiDi->runCount; ++j) { in ubidi_getLogicalMap()
1149 if(pBiDi->insertPoints.size>0) { in ubidi_getLogicalMap()
1150 int32_t markFound=0, runCount=pBiDi->runCount; in ubidi_getLogicalMap()
1172 else if(pBiDi->controlCount>0) { in ubidi_getLogicalMap()
1173 int32_t controlFound=0, runCount=pBiDi->runCount; in ubidi_getLogicalMap()
1199 uchar=pBiDi->text[k]; in ubidi_getLogicalMap()
1213 ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) { in ubidi_getVisualMap() argument
1220 ubidi_countRuns(pBiDi, pErrorCode); in ubidi_getVisualMap()
1223 Run *runs=pBiDi->runs, *runsLimit=runs+pBiDi->runCount; in ubidi_getVisualMap()
1226 if (pBiDi->resultLength<=0) { in ubidi_getVisualMap()
1247 if(pBiDi->insertPoints.size>0) { in ubidi_getVisualMap()
1248 int32_t markFound=0, runCount=pBiDi->runCount; in ubidi_getVisualMap()
1250 runs=pBiDi->runs; in ubidi_getVisualMap()
1262 k=pBiDi->resultLength; in ubidi_getVisualMap()
1279 else if(pBiDi->controlCount>0) { in ubidi_getVisualMap()
1280 int32_t runCount=pBiDi->runCount, logicalEnd; in ubidi_getVisualMap()
1284 runs=pBiDi->runs; in ubidi_getVisualMap()
1310 uchar=pBiDi->text[m]; in ubidi_getVisualMap()