Data Structures | Typedefs | Enumerations | Functions | Variables

linebreak

Handle linebreak object. More...

Data Structures

struct  unistr_t
struct  mapent_t
struct  gcstring_t
struct  linebreak_t

Typedefs

typedef unsigned char propval_t
typedef struct linebreak_t linebreak_t

Enumerations

enum  linebreak_state_t {
  LINEBREAK_STATE_NONE = 0, LINEBREAK_STATE_SOT, LINEBREAK_STATE_SOP, LINEBREAK_STATE_SOL,
  LINEBREAK_STATE_LINE, LINEBREAK_STATE_EOL, LINEBREAK_STATE_EOP, LINEBREAK_STATE_EOT,
  LINEBREAK_STATE_MAX
}

Functions

void linebreak_update_lbclass (linebreak_t *obj, unichar_t c, propval_t p)
void linebreak_update_eawidth (linebreak_t *obj, unichar_t c, propval_t p)
void linebreak_clear_lbclass (linebreak_t *obj)
void linebreak_clear_eawidth (linebreak_t *obj)
linebreak_tlinebreak_new (void(*ref_func)())
linebreak_tlinebreak_incref (linebreak_t *obj)
linebreak_tlinebreak_copy (linebreak_t *obj)
void linebreak_destroy (linebreak_t *obj)
void linebreak_set_newline (linebreak_t *lbobj, unistr_t *newline)
void linebreak_set_stash (linebreak_t *lbobj, void *stash)
void linebreak_set_format (linebreak_t *lbobj, gcstring_t *(*format_func)(), void *format_data)
void linebreak_add_prep (linebreak_t *lbobj, gcstring_t *(*prep_func)(), void *prep_data)
void linebreak_set_sizing (linebreak_t *lbobj, double(*sizing_func)(), void *sizing_data)
void linebreak_set_urgent (linebreak_t *lbobj, gcstring_t *(*urgent_func)(), void *urgent_data)
void linebreak_set_user (linebreak_t *lbobj, gcstring_t *(*user_func)(), void *user_data)
void linebreak_reset (linebreak_t *lbobj)
propval_t linebreak_lbrule (propval_t b_idx, propval_t a_idx)
propval_t linebreak_lbclass (linebreak_t *obj, unichar_t c)
propval_t linebreak_eawidth (linebreak_t *obj, unichar_t c)

Variables

propval_tlinebreak_rules []
size_t linebreak_rulessiz

Detailed Description

Handle linebreak object.


Typedef Documentation

typedef struct linebreak_t linebreak_t

LineBreak object.

typedef unsigned char propval_t

Character property


Enumeration Type Documentation

state argument for format callback.

Enumerator:
LINEBREAK_STATE_NONE 
LINEBREAK_STATE_SOT 
LINEBREAK_STATE_SOP 
LINEBREAK_STATE_SOL 
LINEBREAK_STATE_LINE 
LINEBREAK_STATE_EOL 
LINEBREAK_STATE_EOP 
LINEBREAK_STATE_EOT 
LINEBREAK_STATE_MAX 

Function Documentation

void linebreak_add_prep ( linebreak_t lbobj,
gcstring_t *(*)()  prep_func,
void *  prep_data 
)

Setter: Add/clear prep_func/prep_data Member

Parameters:
[in] lbobj target linebreak object.
[in] prep_func preprocessing callback function or NULL.
[in] prep_data new prep_data value.
Returns:
none. New preprocessing callback is added. Reference count of prep_data item will be handled appropriately. if prep_func was NULL, all data are cleared.
void linebreak_clear_eawidth ( linebreak_t obj  ) 

Clear custom East_Asian_Width property map

Parameters:
[in] obj linebreak object.
Returns:
none. All East_Asian_Width values in custom map will be cleared.
void linebreak_clear_lbclass ( linebreak_t obj  ) 

Clear custom line breaking class map

Parameters:
[in] obj linebreak object.
Returns:
none. All line breaking class values in custom map will be cleared.
linebreak_t* linebreak_copy ( linebreak_t obj  ) 

Copy Constructor

Create deep copy of linebreak object. Reference count of new object will be set to 1. If ref_func member of object is not NULL, it will be executed to increase reference count of prep_data, format_data, sizing_data, urgent_data and stash members.

Parameters:
[in] obj linebreak object, must not be NULL.
Returns:
New linebreak object. If error occurred, errno is set then NULL is returned.
void linebreak_destroy ( linebreak_t obj  ) 

Decrease Reference Count; Destructor

Decrement reference count of linebreak object. When reference count becomes zero, free memories allocated for object and then, if ref_func member of object was not NULL, it will be executed to decrease reference count of prep_data, format_data, sizing_data, urgent_data and stash members.

Parameters:
[in] obj linebreak object.
Returns:
none. If obj was NULL, do nothing.
propval_t linebreak_eawidth ( linebreak_t obj,
unichar_t  c 
)

Get East_Asian_Width Property

Get UAX #11 East_Asian_Width property value of Unicode character. Class A will be resolved to appropriate property F or N.

Parameters:
[in] obj linebreak object, must not be NULL.
[in] c Unicode character.
Returns:
East_Asian_Width property value.
linebreak_t* linebreak_incref ( linebreak_t obj  ) 

Increase Reference Count

Increse reference count of linebreak object.

Parameters:
[in] obj linebreak object, must not be NULL.
Returns:
linebreak object itself. If error occurred, errno is set then NULL is returned.
propval_t linebreak_lbclass ( linebreak_t obj,
unichar_t  c 
)

Get Line Breaking Class

Get UAX #14 line breaking class of Unicode character. Classes XX and SG will be resolved to AL.

Parameters:
[in] obj linebreak object, must not be NULL.
[in] c Unicode character.
Returns:
line breaking class property value.
propval_t linebreak_lbrule ( propval_t  b_idx,
propval_t  a_idx 
)

Get breaking rule between two classes

From given two line breaking classes, get breaking rule determined by internal data.

Parameters:
[in] a_idx line breaking class.
[in] b_idx line breaking class.
Returns:
line breaking action: MANDATORY, DIRECT, INDIRECT or PROHIBITED. If action was not determined, returns DIRECT.
linebreak_t* linebreak_new ( void(*)()  ref_func  ) 

Constructor

Creates new linebreak object. Reference count of it will be set to 1.

Parameters:
[in] ref_func function to handle reference count of external objects, or NULL.
Returns:
New linebreak object. If error occurred, errno is set then NULL is returned.
void linebreak_reset ( linebreak_t lbobj  ) 

Reset State

Reset internal state of linebreak object. Internal state is set by linebreak_break_partial() function.

Parameters:
[in] lbobj linebreak object.
Returns:
none. If lbobj was NULL, do nothing.
void linebreak_set_format ( linebreak_t lbobj,
gcstring_t *(*)()  format_func,
void *  format_data 
)

Setter: Update format_func/format_data Member

Parameters:
[in] lbobj target linebreak object.
[in] format_func format callback function or NULL.
[in] format_data new format_data value.
Returns:
none. New format callback is set. Reference count of format_data member will be handled appropriately.
void linebreak_set_newline ( linebreak_t lbobj,
unistr_t newline 
)

Setter: Update newline member

Parameters:
[in] lbobj target linebreak object, must not be NULL.
[in] newline pointer to Unicode string.
Returns:
none. Copy of newline is set. If error occurred, lbobj->errnum is set.
void linebreak_set_sizing ( linebreak_t lbobj,
double(*)()  sizing_func,
void *  sizing_data 
)

Setter: Update sizing_func/sizing_data Member

Parameters:
[in] lbobj target linebreak object.
[in] sizing_func sizing callback function or NULL.
[in] sizing_data new sizing_data value.
Returns:
none. New sizing callback is set. Reference count of sizing_data member will be handled appropriately.
void linebreak_set_stash ( linebreak_t lbobj,
void *  stash 
)

Setter: Update stash Member

Parameters:
[in] lbobj target linebreak object, must not be NULL.
[in] stash new stash value or NULL.
Returns:
none. New stash value is set. Reference count of stash member will be handled appropriately.
void linebreak_set_urgent ( linebreak_t lbobj,
gcstring_t *(*)()  urgent_func,
void *  urgent_data 
)

Setter: Update urgent_func/urgent_data Member

Parameters:
[in] lbobj target linebreak object.
[in] urgent_func urgent breaking callback function or NULL.
[in] urgent_data new urgent_data value.
Returns:
none. New urgent breaking callback is set. Reference count of urgent_data member will be handled appropriately.
void linebreak_set_user ( linebreak_t lbobj,
gcstring_t *(*)()  user_func,
void *  user_data 
)

Setter: Update user_func/user_data Member

Deprecated:
Use linebreak_add_prep() instead.
Parameters:
[in] lbobj target linebreak object.
[in] user_func preprocessing callback function or NULL.
[in] user_data new user_data value.
Returns:
none. New preprocessing callback is set. Reference count of user_data member will be handled appropriately.
void linebreak_update_eawidth ( linebreak_t obj,
unichar_t  c,
propval_t  p 
)

Update custom East_Asian_Width propety map.

Parameters:
[in] obj linebreak object.
[in] c Unicode character.
[in] p New East_Asian_Width propery value.
Returns:
none. custom map will be updated.
void linebreak_update_lbclass ( linebreak_t obj,
unichar_t  c,
propval_t  p 
)

Update custom line breaking class map.

Parameters:
[in] obj linebreak object.
[in] c Unicode character.
[in] p New line breaking class propery value.
Returns:
none. Custom map will be updated.

Variable Documentation

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator