Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsRenderingContextBeOS.cpp File Reference
#include "nsFontMetricsBeOS.h"
#include "nsRenderingContextBeOS.h"
#include "nsRegionBeOS.h"
#include "nsImageBeOS.h"
#include "nsGraphicsStateBeOS.h"
#include "nsICharRepresentable.h"
#include "prenv.h"
#include <Polygon.h>
#include <math.h>

Go to the source code of this file.

Defines

#define BEGINS_CHAR(byte)   ((byte & 0xc0) != 0x80)
#define convert_to_utf8(str, uni_str)

Functions

static NS_DEFINE_CID (kRegionCID, NS_REGION_CID)
uint32 utf8_char_len (uchar byte)
uint32 utf8_str_len (const char *ustring)

Variables

static const pattern dashes = { {0xc7, 0x8f, 0x1f, 0x3e, 0x7c, 0xf8, 0xf1, 0xe3} }
static const pattern dots = { {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa} }

Define Documentation

#define BEGINS_CHAR (   byte)    ((byte & 0xc0) != 0x80)

Definition at line 997 of file nsRenderingContextBeOS.cpp.

#define convert_to_utf8 (   str,
  uni_str 
)
Value:
{\
       if ((uni_str[0]&0xff80) == 0)\
              *str++ = *uni_str++;\
       else if ((uni_str[0]&0xf800) == 0) {\
              str[0] = 0xc0|(uni_str[0]>>6);\
              str[1] = 0x80|((*uni_str++)&0x3f);\
              str += 2;\
       } else if ((uni_str[0]&0xfc00) != 0xd800) {\
              str[0] = 0xe0|(uni_str[0]>>12);\
              str[1] = 0x80|((uni_str[0]>>6)&0x3f);\
              str[2] = 0x80|((*uni_str++)&0x3f);\
              str += 3;\
       } else {\
		int val;\
              val = ((uni_str[0]-0xd7c0)<<10) | (uni_str[1]&0x3ff);\
              str[0] = 0xf0 | (val>>18);\
              str[1] = 0x80 | ((val>>12)&0x3f);\
              str[2] = 0x80 | ((val>>6)&0x3f);\
              str[3] = 0x80 | (val&0x3f);\
              uni_str += 2; str += 4;\
       }\
}

Definition at line 1015 of file nsRenderingContextBeOS.cpp.


Function Documentation

static NS_DEFINE_CID ( kRegionCID  ,
NS_REGION_CID   
) [static]
uint32 utf8_char_len ( uchar  byte) [inline]

Definition at line 990 of file nsRenderingContextBeOS.cpp.

{
       return (((0xE5000000 >> ((byte >> 3) & 0x1E)) & 3) + 1);
}
uint32 utf8_str_len ( const char *  ustring) [inline]

Definition at line 999 of file nsRenderingContextBeOS.cpp.

{
       uint32 cnt = 0;
       while ( *ustring != '\0')
       {
              if ( BEGINS_CHAR( *ustring ) )
                     ++cnt;
                     ++ustring;
       }
       return cnt;       
}

Here is the caller graph for this function:


Variable Documentation

const pattern dashes = { {0xc7, 0x8f, 0x1f, 0x3e, 0x7c, 0xf8, 0xf1, 0xe3} } [static]

Definition at line 50 of file nsRenderingContextBeOS.cpp.

const pattern dots = { {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa} } [static]

Definition at line 51 of file nsRenderingContextBeOS.cpp.