Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
bidicattable.h File Reference
#include "nscore.h"

Go to the source code of this file.

Functions

static eBidiCategory GetBidiCat (PRUint32 u)

Variables

static PRUint8 gBidiCatIdx1 [256]
static PRUint8 gBidiCatIdx2 [592]
static PRUint8 gBidiCatIdx3 [540]
static PRUint8 gBidiCatIdx4 [192]
static PRUint8 gBidiCatIdx5 [8]
static PRUint8 gBidiCatIdx6 [272]
static PRUint8 gBidiCatIdx7 [274]
static PRUint8 gBidiCatIdx8 [64]
static PRUint8 gBidiCatIdx9 [8]
static PRUint8 gBidiCatIdx10 [4]
static PRUint8 gBidiCatIdx11 [12]
static PRUint8 gBidiCatIdx12 [144]
static PRUint8 gBidiCatIdx13 [256]
static PRUint8 gBidiCatIdx14 [68]
static PRUint8 gBidiCatIdx15 [64]
static PRUint32 gBidiCatPat [175]

Function Documentation

static eBidiCategory GetBidiCat ( PRUint32  u) [static]

Definition at line 3023 of file bidicattable.h.

{
    PRUint32 pat;
    PRUint16 patidx;

    /*  Handle blocks which use index table mapping */   

    /* Handle U+0000 to U+07FF */
    if (u<=((PRUint32)0x07FF)) {
        patidx = gBidiCatIdx1 [( u  >> 3 )];
    }

    /* Handle U+0900 to U+1B7F */
    else if ((((PRUint32)0x0900)<=u)&&(u<=((PRUint32)0x1B7F))) {
        patidx = gBidiCatIdx2 [( (u -(PRUint32) 0x0900) >> 3 )];
    }

    /* Handle U+1D00 to U+2DDF */
    else if ((((PRUint32)0x1D00)<=u)&&(u<=((PRUint32)0x2DDF))) {
        patidx = gBidiCatIdx3 [( (u -(PRUint32) 0x1D00) >> 3 )];
    }

    /* Handle U+2E00 to U+33FF */
    else if ((((PRUint32)0x2E00)<=u)&&(u<=((PRUint32)0x33FF))) {
        patidx = gBidiCatIdx4 [( (u -(PRUint32) 0x2E00) >> 3 )];
    }

    /* Handle U+4DC0 to U+4DFF */
    else if ((((PRUint32)0x4DC0)<=u)&&(u<=((PRUint32)0x4DFF))) {
        patidx = gBidiCatIdx5 [( (u -(PRUint32) 0x4DC0) >> 3 )];
    }

    /* Handle U+A000 to U+A87F */
    else if ((((PRUint32)0xA000)<=u)&&(u<=((PRUint32)0xA87F))) {
        patidx = gBidiCatIdx6 [( (u -(PRUint32) 0xA000) >> 3 )];
    }

    /* Handle U+F900 to U+1018F */
    else if ((((PRUint32)0xF900)<=u)&&(u<=((PRUint32)0x1018F))) {
        patidx = gBidiCatIdx7 [( (u -(PRUint32) 0xF900) >> 3 )];
    }

    /* Handle U+10300 to U+104FF */
    else if ((((PRUint32)0x10300)<=u)&&(u<=((PRUint32)0x104FF))) {
        patidx = gBidiCatIdx8 [( (u -(PRUint32) 0x10300) >> 3 )];
    }

    /* Handle U+10800 to U+1083F */
    else if ((((PRUint32)0x10800)<=u)&&(u<=((PRUint32)0x1083F))) {
        patidx = gBidiCatIdx9 [( (u -(PRUint32) 0x10800) >> 3 )];
    }

    /* Handle U+10900 to U+1091F */
    else if ((((PRUint32)0x10900)<=u)&&(u<=((PRUint32)0x1091F))) {
        patidx = gBidiCatIdx10 [( (u -(PRUint32) 0x10900) >> 3 )];
    }

    /* Handle U+10A00 to U+10A5F */
    else if ((((PRUint32)0x10A00)<=u)&&(u<=((PRUint32)0x10A5F))) {
        patidx = gBidiCatIdx11 [( (u -(PRUint32) 0x10A00) >> 3 )];
    }

    /* Handle U+12000 to U+1247F */
    else if ((((PRUint32)0x12000)<=u)&&(u<=((PRUint32)0x1247F))) {
        patidx = gBidiCatIdx12 [( (u -(PRUint32) 0x12000) >> 3 )];
    }

    /* Handle U+1D000 to U+1D7FF */
    else if ((((PRUint32)0x1D000)<=u)&&(u<=((PRUint32)0x1D7FF))) {
        patidx = gBidiCatIdx13 [( (u -(PRUint32) 0x1D000) >> 3 )];
    }

    /* Handle U+2F800 to U+2FA1F */
    else if ((((PRUint32)0x2F800)<=u)&&(u<=((PRUint32)0x2FA1F))) {
        patidx = gBidiCatIdx14 [( (u -(PRUint32) 0x2F800) >> 3 )];
    }

    /* Handle U+E0000 to U+E01FF */
    else if ((((PRUint32)0xE0000)<=u)&&(u<=((PRUint32)0xE01FF))) {
        patidx = gBidiCatIdx15 [( (u -(PRUint32) 0xE0000) >> 3 )];
    }

    else {
      /* defaults for unassigned characters
       * see http://www.unicode.org/Public/UNIDATA/extracted/DerivedBidiClass.txt
       * and http://www.unicode.org/Public/UNIDATA/Blocks.txt
       */
      if (((u >= 0x0590) && (u <= 0x05FF)) ||
          ((u >= 0x07C0) && (u <= 0x08FF)) ||
          ((u >= 0xFB1D) && (u <= 0xFB4F)) ||
          ((u >= 0x10800) && (u <=0x10FFF)))
         return eBidiCat_R;
      else if (((u >= 0x0600) && (u <= 0x07BF)) ||
               ((u >= 0xFB50) && (u <= 0xFDFF)) ||
               ((u >= 0xFE70) && (u <= 0xFEFE)))
         return eBidiCat_AL;
      else
        return eBidiCat_L;
    }

    if (patidx < 0x10)
        return (eBidiCategory)patidx;
    else {
        pat = gBidiCatPat[patidx];
        return (eBidiCategory)((pat  >> ((u % 8) * 4)) & 0x0F);
    }
}

Variable Documentation

PRUint8 gBidiCatIdx1[256] [static]

Definition at line 46 of file bidicattable.h.

PRUint8 gBidiCatIdx10[4] [static]
Initial value:
 {
      2,  
      2,  
      2,  
    164,  
}

Definition at line 2279 of file bidicattable.h.

PRUint8 gBidiCatIdx11[12] [static]
Initial value:
 {
    165,  
    166,  
      2,  
      2,  
      2,  
      2,  
      2,  
    167,  
      2,  
      2,  
      2,  
      2,  
}

Definition at line 2286 of file bidicattable.h.

PRUint8 gBidiCatIdx12[144] [static]

Definition at line 2301 of file bidicattable.h.

PRUint8 gBidiCatIdx13[256] [static]

Definition at line 2448 of file bidicattable.h.

PRUint8 gBidiCatIdx14[68] [static]

Definition at line 2707 of file bidicattable.h.

PRUint8 gBidiCatIdx15[64] [static]

Definition at line 2778 of file bidicattable.h.

PRUint8 gBidiCatIdx2[592] [static]

Definition at line 305 of file bidicattable.h.

PRUint8 gBidiCatIdx3[540] [static]

Definition at line 900 of file bidicattable.h.

PRUint8 gBidiCatIdx4[192] [static]

Definition at line 1443 of file bidicattable.h.

PRUint8 gBidiCatIdx5[8] [static]
Initial value:
 {
      9,  
      9,  
      9,  
      9,  
      9,  
      9,  
      9,  
      9,  
}

Definition at line 1638 of file bidicattable.h.

PRUint8 gBidiCatIdx6[272] [static]

Definition at line 1649 of file bidicattable.h.

PRUint8 gBidiCatIdx7[274] [static]

Definition at line 1924 of file bidicattable.h.

PRUint8 gBidiCatIdx8[64] [static]

Definition at line 2201 of file bidicattable.h.

PRUint8 gBidiCatIdx9[8] [static]
Initial value:
 {
      2,  
      2,  
      2,  
      2,  
      2,  
      2,  
      2,  
      2,  
}

Definition at line 2268 of file bidicattable.h.

PRUint32 gBidiCatPat[175] [static]

Definition at line 2845 of file bidicattable.h.