4
* depends on gerror.inc
8
{ These three are primarily intended for specific GMarkupParser
9
implementations to set.
13
PGMarkupError = ^TGMarkupError;
14
TGMarkupError = (G_MARKUP_ERROR_BAD_UTF8,
17
G_MARKUP_ERROR_UNKNOWN_ELEMENT,
18
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
19
G_MARKUP_ERROR_INVALID_CONTENT);
22
function G_MARKUP_ERROR : TGQuark;
25
function g_markup_error_quark:TGQuark;cdecl;external gliblib name 'g_markup_error_quark';
28
PGMarkupParseFlags = ^TGMarkupParseFlags;
29
TGMarkupParseFlags = integer;
32
{ Hmm, can't think of any at the moment }
33
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 shl 0;
36
PGMarkupParseContext = ^TGMarkupParseContext;
37
TGMarkupParseContext = pointer; // please correct me if it's wrong
40
PGMarkupParser = ^TGMarkupParser;
41
TGMarkupParser = record
43
{ Called for open tags <foo bar="baz"> }
44
start_element : procedure (context : PGMarkupParseContext;
45
element_name : Pgchar;
46
attribute_names : PPgchar;
47
attribute_values : PPgchar;
48
user_data : gpointer; error:PPGError);cdecl;
50
{ Called for close tags </foo> }
51
end_element : procedure (context : PGMarkupParseContext;
52
element_name : Pgchar;
54
error : PPGError); cdecl;
56
{ Called for character data }
57
{ text is not nul-terminated }
58
text : procedure (context : PGMarkupParseContext;
62
error : PPGError); cdecl;
64
{ Called for strings that should be re-saved verbatim in this same
65
position, but are not otherwise interpretable. At the moment
66
this includes comments and processing instructions.
68
{ text is not nul-terminated. }
70
passthrough : procedure (context : PGMarkupParseContext;
71
passthrough_text : Pgchar;
74
error : PPGError); cdecl;
76
{ Called on error, including one set by other
77
methods in the vtable. The GError should not be freed.
79
error : procedure (context : PGMarkupParseContext;
81
user_data : gpointer); cdecl;
86
function g_markup_parse_context_new (parser : PGMarkupParser;
87
flags : TGMarkupParseFlags;
89
user_data_dnotify : TGDestroyNotify): PGMarkupParseContext; cdecl;external gliblib name 'g_markup_parse_context_new';
91
procedure g_markup_parse_context_free(context : PGMarkupParseContext);cdecl;external gliblib name 'g_markup_parse_context_free';
93
function g_markup_parse_context_parse(context : PGMarkupParseContext;
96
error : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_parse';
98
function g_markup_parse_context_end_parse(context : PGMarkupParseContext;
99
error : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_end_parse';
101
{ For user-constructed error messages, has no precise semantics }
102
procedure g_markup_parse_context_get_position(context : PGMarkupParseContext;
104
char_number : Pgint);cdecl;external gliblib name 'g_markup_parse_context_get_position';
106
{ useful when saving }
107
function g_markup_escape_text (text : Pgchar;
108
length : gssize):Pgchar;cdecl;external gliblib name 'g_markup_escape_text';