PEG Markdown Highlight
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
Classes | Typedefs | Enumerations | Functions
pmh_styleparser.h File Reference

Style parser public interface. More...

#include "pmh_definitions.h"
#include <stdbool.h>

Go to the source code of this file.

Classes

struct  pmh_attr_argb_color
 Color (ARGB) attribute value. More...
struct  pmh_attr_font_styles
 Font style attribute value. More...
struct  pmh_attr_font_size
 Font size attribute value. More...
union  pmh_attr_value
 Style attribute value. More...
struct  pmh_style_attribute
 Style attribute. More...
struct  pmh_style_collection
 Collection of styles. More...

Typedefs

typedef struct pmh_style_attribute pmh_style_attribute
 Style attribute.

Enumerations

enum  pmh_attr_type {
  pmh_attr_type_foreground_color, pmh_attr_type_background_color, pmh_attr_type_caret_color, pmh_attr_type_font_size_pt,
  pmh_attr_type_font_family, pmh_attr_type_font_style, pmh_attr_type_other
}
 Style attribute types. More...

Functions

pmh_style_collectionpmh_parse_styles (char *input, void(*error_callback)(char *, int, void *), void *error_callback_context)
 Parse stylesheet string, return style collection.
void pmh_free_style_collection (pmh_style_collection *collection)
 Free a pmh_style_collection.
char * pmh_attr_name_from_type (pmh_attr_type type)
pmh_attr_type pmh_attr_type_from_name (char *name)

Detailed Description

Style parser public interface.


Enumeration Type Documentation

Style attribute types.

Enumerator:
pmh_attr_type_foreground_color 

Foreground color

pmh_attr_type_background_color 

Background color

pmh_attr_type_caret_color 

Caret (insertion point) color

pmh_attr_type_font_size_pt 

Font size (in points)

pmh_attr_type_font_family 

Font family

pmh_attr_type_font_style 

Font style

pmh_attr_type_other 

Arbitrary custom attribute


Function Documentation

Free a pmh_style_collection.

Frees a pmh_style_collection value returned by pmh_parse_styles().

Parameters:
[in]collectionThe collection to free.
pmh_style_collection* pmh_parse_styles ( char *  input,
void(*)(char *, int, void *)  error_callback,
void *  error_callback_context 
)

Parse stylesheet string, return style collection.

Parameters:
[in]inputThe stylesheet string to parse.
[in]error_callbackCallback function to be called when errors occur during parsing. The first argument to the callback function is the error message and the second one the line number in the original input where the error occurred. The last argument will always get the value you pass in for the error_callback_context argument to this function. Pass in NULL to suppress error reporting.
[in]error_callback_contextArbitrary context pointer for the error callback function; will be passed in as the last argument to error_callback.
Returns:
A pmh_style_collection. You must pass this value to pmh_free_style_collection() when it's not needed anymore.