Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cr-num.c File Reference

The definition of the CRNum class. More...

#include "cr-num.h"
#include "string.h"

Go to the source code of this file.

Functions

CRNumcr_num_new (void)
 The default constructor of CRNum.
CRNumcr_num_new_with_val (gdouble a_val, enum CRNumType a_type)
 A constructor of CRNum.
guchar * cr_num_to_string (CRNum *a_this)
 Returns the string representation of the current instance of CRNum.
enum CRStatus cr_num_copy (CRNum *a_dest, CRNum *a_src)
 Copies an instance of CRNum.
CRNumcr_num_dup (CRNum *a_this)
 Duplicates an instance of CRNum.
enum CRStatus cr_num_set (CRNum *a_this, gdouble a_val, enum CRNumType a_type)
 Sets an instance of CRNum.
gboolean cr_num_is_fixed_length (CRNum *a_this)
 Tests if the current instance of CRNum is a fixed length value or not.
void cr_num_destroy (CRNum *a_this)
 The destructor of CRNum.


Detailed Description

The definition of the CRNum class.

Definition in file cr-num.c.


Function Documentation

enum CRStatus cr_num_copy CRNum a_dest,
CRNum a_src
 

Copies an instance of CRNum.

Parameters:
a_src the instance of CRNum to copy. Must be non NULL.
a_dst the destination of the copy. Must be non NULL
Returns:
CR_OK upon successful completion, an error code otherwise.

Definition at line 212 of file cr-num.c.

References CR_BAD_PARAM_ERROR, and CRNum.

Referenced by cr_font_size_copy(), cr_num_dup(), and cr_style_resolve_inherited_properties().

void cr_num_destroy CRNum a_this  ) 
 

The destructor of CRNum.

Parameters:
a_this the this pointer of the current instance of CRNum.

Definition at line 290 of file cr-num.c.

References CRNum.

Referenced by cr_font_size_adjust_destroy().

CRNum* cr_num_dup CRNum a_this  ) 
 

Duplicates an instance of CRNum.

Parameters:
a_this the instance of CRNum to duplicate.
Returns:
the newly created (duplicated) instance of CRNum. Must be freed by cr_num_destroy().

Definition at line 228 of file cr-num.c.

References cr_num_copy(), cr_num_new(), CR_OK, CRNum, and CRStatus.

gboolean cr_num_is_fixed_length CRNum a_this  ) 
 

Tests if the current instance of CRNum is a fixed length value or not.

Typically a fixed length value is anything from NUM_LENGTH_EM to NUM_LENGTH_PC. See the definition of CRNumType to see what we mean.

Returns:
TRUE if the instance of CRNum is a fixed length number, FALSE otherwise.

Definition at line 271 of file cr-num.c.

References CRNum, and NUM_LENGTH_EM.

CRNum* cr_num_new void   ) 
 

The default constructor of CRNum.

Returns:
the newly built instance of CRNum.

Definition at line 41 of file cr-num.c.

References cr_utils_trace_info, and CRNum.

Referenced by cr_num_dup(), and cr_num_new_with_val().

CRNum* cr_num_new_with_val gdouble  a_val,
enum CRNumType  a_type
 

A constructor of CRNum.

Parameters:
a_is_natural indicates whether the intance of CRNum is a natural number or not.
a_integer_part the integer part of the instance of CRNum
a_decimal_part in case the instance of CRNum natural number (but a decimal one) this parameter is the decimal part of the instance of CRNum.
Returns:
the newly built instance of CRNum or NULL if an error arises.

Definition at line 70 of file cr-num.c.

References cr_num_new(), CRNum, and _CRNum::val.

enum CRStatus cr_num_set CRNum a_this,
gdouble  a_val,
enum CRNumType  a_type
 

Sets an instance of CRNum.

Parameters:
a_this the current instance of CRNum to be set.
a_val the new numerical value to be hold by the current instance of CRNum
a_type the new type of CRNum.

Definition at line 252 of file cr-num.c.

References CR_BAD_PARAM_ERROR, CRNum, and _CRNum::val.

Referenced by cr_font_size_set_absolute_font_size(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values().

guchar* cr_num_to_string CRNum a_this  ) 
 

Returns the string representation of the current instance of CRNum.

Parameters:
a_this the current instance of CRNum.
Returns:
the newly built string representation of the current instance of CRNum. The returned string is NULL terminated. The caller *must* free the returned string.

Definition at line 94 of file cr-num.c.

References CRNum, NUM_ANGLE_DEG, NUM_ANGLE_GRAD, NUM_ANGLE_RAD, NUM_AUTO, NUM_FREQ_HZ, NUM_FREQ_KHZ, NUM_GENERIC, NUM_INHERIT, NUM_LENGTH_CM, NUM_LENGTH_EM, NUM_LENGTH_EX, NUM_LENGTH_IN, NUM_LENGTH_MM, NUM_LENGTH_PC, NUM_LENGTH_PT, NUM_LENGTH_PX, NUM_PERCENTAGE, NUM_TIME_MS, NUM_TIME_S, and _CRNum::val.

Referenced by cr_font_size_adjust_to_string(), cr_font_size_to_string(), cr_style_num_prop_val_to_string(), cr_term_one_to_string(), and cr_term_to_string().


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1