Lines Matching full:runs
48 * The implementation of the access to same-level-runs and of the reordering
54 * same-level-runs is created. Reordering then is done on this vector.
59 * This is inefficient if there are many very short runs. If the average run
155 pLineBiDi->runs=NULL; in ubidi_setLine()
318 /* this is done based on runs rather than on levels since levels have in ubidi_getLogicalRun()
322 iRun=pBiDi->runs[0]; in ubidi_getLogicalRun()
325 iRun = pBiDi->runs[i]; in ubidi_getLogicalRun()
349 /* runs API functions ------------------------------------------------------- */
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()
394 pBiDi->runs=pBiDi->simpleRuns; 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()
403 /* reorder the runs array (L2) ---------------------------------------------- */
406 * Reorder the same-level runs in the runs array.
414 * each sequence of same-level runs consists of only one run each, we
420 * in the last reordering the sequence of the runs at this level or higher
421 * will be all runs, and we don't need the elaborate loop to search for them.
433 * this run and can --runCount. If it is later part of the all-runs
438 Run *runs, tempRun; in reorderLine() local
454 runs=pBiDi->runs; in reorderLine()
466 /* loop for all sequences of runs */ in reorderLine()
468 /* look for a sequence of runs that are all at >=maxLevel */ in reorderLine()
470 while(firstRun<runCount && levels[runs[firstRun].logicalStart]<maxLevel) { in reorderLine()
474 break; /* no more such runs */ in reorderLine()
478 … for(limitRun=firstRun; ++limitRun<runCount && levels[runs[limitRun].logicalStart]>=maxLevel;) {} in reorderLine()
480 /* Swap the entire sequence of runs from firstRun to limitRun-1. */ in reorderLine()
483 tempRun = runs[firstRun]; in reorderLine()
484 runs[firstRun]=runs[endRun]; in reorderLine()
485 runs[endRun]=tempRun; in reorderLine()
491 break; /* no more such runs */ in reorderLine()
507 /* Swap the entire sequence of all runs. (endRun==runCount) */ in reorderLine()
509 tempRun=runs[firstRun]; in reorderLine()
510 runs[firstRun]=runs[runCount]; in reorderLine()
511 runs[runCount]=tempRun; in reorderLine()
518 /* compute the runs array --------------------------------------------------- */
521 Run *runs=pBiDi->runs; in getRunFromLogicalIndex() local
525 length=runs[i].visualLimit-visualStart; in getRunFromLogicalIndex()
526 logicalStart=GET_INDEX(runs[i].logicalStart); in getRunFromLogicalIndex()
539 * Compute the runs array from the levels array.
541 * and the runs are reordered.
542 * Odd-level runs have visualStart on their visual right edge and
552 * This method returns immediately if the runs are already set. This in ubidi_getRuns()
581 /* count the runs, there is at least one non-WS run, and limit>0 */ in ubidi_getRuns()
599 /* allocate and set the runs */ in ubidi_getRuns()
600 Run *runs; in ubidi_getRuns() local
611 runs=pBiDi->runsMemory; in ubidi_getRuns()
616 /* set the runs */ in ubidi_getRuns()
641 runs[runIndex].logicalStart=start; in ubidi_getRuns()
642 runs[runIndex].visualLimit=i-start; in ubidi_getRuns()
643 runs[runIndex].insertRemove=0; in ubidi_getRuns()
649 runs[runIndex].logicalStart=limit; in ubidi_getRuns()
650 runs[runIndex].visualLimit=length-limit; in ubidi_getRuns()
659 pBiDi->runs=runs; in ubidi_getRuns()
668 ADD_ODD_BIT_FROM_LEVEL(runs[i].logicalStart, levels[runs[i].logicalStart]); in ubidi_getRuns()
669 limit+=runs[i].visualLimit; in ubidi_getRuns()
670 runs[i].visualLimit=limit; in ubidi_getRuns()
680 ADD_ODD_BIT_FROM_LEVEL(runs[trailingRun].logicalStart, pBiDi->paraLevel); in ubidi_getRuns()
692 pBiDi->runs[runIndex].insertRemove|=point->flag; in ubidi_getRuns()
703 pBiDi->runs[runIndex].insertRemove--; in ubidi_getRuns()
843 break; /* no more such runs */ in ubidi_reorderVisual()
883 /* we can do the trivial cases without the runs array */ in ubidi_getVisualIndex()
896 Run *runs=pBiDi->runs; in ubidi_getVisualIndex() local
899 /* linear search for the run, search on the visual runs */ in ubidi_getVisualIndex()
901 length=runs[i].visualLimit-visualStart; in ubidi_getVisualIndex()
902 offset=logicalIndex-GET_INDEX(runs[i].logicalStart); in ubidi_getVisualIndex()
904 if(IS_EVEN_RUN(runs[i].logicalStart)) { in ubidi_getVisualIndex()
923 Run *runs=pBiDi->runs; in ubidi_getVisualIndex() local
927 length=runs[i].visualLimit-visualStart; in ubidi_getVisualIndex()
928 insertRemove=runs[i].insertRemove; in ubidi_getVisualIndex()
933 if(visualIndex<runs[i].visualLimit) { in ubidi_getVisualIndex()
943 Run *runs=pBiDi->runs; in ubidi_getVisualIndex() local
951 /* loop on runs */ in ubidi_getVisualIndex()
953 length=runs[i].visualLimit-visualStart; in ubidi_getVisualIndex()
954 insertRemove=runs[i].insertRemove; in ubidi_getVisualIndex()
956 if(visualIndex>=runs[i].visualLimit) { in ubidi_getVisualIndex()
964 if(IS_EVEN_RUN(runs[i].logicalStart)) { in ubidi_getVisualIndex()
966 start=runs[i].logicalStart; in ubidi_getVisualIndex()
971 limit=GET_INDEX(runs[i].logicalStart)+length; in ubidi_getVisualIndex()
988 Run *runs; in ubidi_getLogicalIndex() local
993 /* we can do the trivial cases without the runs array */ in ubidi_getLogicalIndex()
1007 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1013 runs=pBiDi->runs; in ubidi_getLogicalIndex()
1016 length=runs[i].visualLimit-visualStart; in ubidi_getLogicalIndex()
1017 insertRemove=runs[i].insertRemove; in ubidi_getLogicalIndex()
1025 if(visualIndex<(runs[i].visualLimit+markFound)) { in ubidi_getLogicalIndex()
1045 length=runs[i].visualLimit-visualStart; in ubidi_getLogicalIndex()
1046 insertRemove=runs[i].insertRemove; in ubidi_getLogicalIndex()
1048 if(visualIndex>=(runs[i].visualLimit-controlFound+insertRemove)) { in ubidi_getLogicalIndex()
1058 logicalStart=runs[i].logicalStart; in ubidi_getLogicalIndex()
1079 for(i=0; visualIndex>=runs[i].visualLimit; ++i) {} in ubidi_getLogicalIndex()
1087 if(visualIndex>=runs[i].visualLimit) { in ubidi_getLogicalIndex()
1089 } else if(i==0 || visualIndex>=runs[i-1].visualLimit) { in ubidi_getLogicalIndex()
1097 start=runs[i].logicalStart; in ubidi_getLogicalIndex()
1100 /* the offset in runs[i] is visualIndex-runs[i-1].visualLimit */ in ubidi_getLogicalIndex()
1102 visualIndex-=runs[i-1].visualLimit; in ubidi_getLogicalIndex()
1107 return GET_INDEX(start)+runs[i].visualLimit-visualIndex-1; in ubidi_getLogicalIndex()
1121 /* fill a logical-to-visual index map using the runs[] */ in ubidi_getLogicalMap()
1124 Run *runs=pBiDi->runs; in ubidi_getLogicalMap() local
1134 logicalStart=GET_INDEX(runs[j].logicalStart); in ubidi_getLogicalMap()
1135 visualLimit=runs[j].visualLimit; in ubidi_getLogicalMap()
1136 if(IS_EVEN_RUN(runs[j].logicalStart)) { in ubidi_getLogicalMap()
1155 length=runs[i].visualLimit-visualStart; in ubidi_getLogicalMap()
1156 insertRemove=runs[i].insertRemove; in ubidi_getLogicalMap()
1161 logicalStart=GET_INDEX(runs[i].logicalStart); in ubidi_getLogicalMap()
1180 length=runs[i].visualLimit-visualStart; in ubidi_getLogicalMap()
1181 insertRemove=runs[i].insertRemove; in ubidi_getLogicalMap()
1182 /* no control found within previous runs nor within this run */ in ubidi_getLogicalMap()
1186 logicalStart=runs[i].logicalStart; in ubidi_getLogicalMap()
1222 /* fill a visual-to-logical index map using the runs[] */ in ubidi_getVisualMap()
1223 Run *runs=pBiDi->runs, *runsLimit=runs+pBiDi->runCount; in ubidi_getVisualMap() local
1230 for(; runs<runsLimit; ++runs) { in ubidi_getVisualMap()
1231 logicalStart=runs->logicalStart; in ubidi_getVisualMap()
1232 visualLimit=runs->visualLimit; in ubidi_getVisualMap()
1250 runs=pBiDi->runs; in ubidi_getVisualMap()
1253 insertRemove=runs[i].insertRemove; in ubidi_getVisualMap()
1264 insertRemove=runs[i].insertRemove; in ubidi_getVisualMap()
1269 visualStart= i>0 ? runs[i-1].visualLimit : 0; in ubidi_getVisualMap()
1270 for(j=runs[i].visualLimit-1; j>=visualStart && markFound>0; j--) { in ubidi_getVisualMap()
1284 runs=pBiDi->runs; in ubidi_getVisualMap()
1289 length=runs[i].visualLimit-visualStart; in ubidi_getVisualMap()
1290 insertRemove=runs[i].insertRemove; in ubidi_getVisualMap()
1298 visualLimit=runs[i].visualLimit; in ubidi_getVisualMap()
1304 logicalStart=runs[i].logicalStart; in ubidi_getVisualMap()