forked from AravisProject/aravis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharvdomtext.c
82 lines (66 loc) · 2.02 KB
/
arvdomtext.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* Aravis - Digital camera library
*
* Copyright © 2009-2019 Emmanuel Pacaud
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* Author:
* Emmanuel Pacaud <[email protected]>
*/
/**
* SECTION:arvdomtext
* @short_description: Base class for DOM text nodes
*/
#include <arvdomtext.h>
G_DEFINE_TYPE (ArvDomText, arv_dom_text, ARV_TYPE_DOM_CHARACTER_DATA)
/* ArvDomNode implementation */
static const char *
arv_dom_text_get_node_name (ArvDomNode *node)
{
return "#text";
}
static const char *
arv_dom_text_get_node_value (ArvDomNode *node)
{
return arv_dom_character_data_get_data (ARV_DOM_CHARACTER_DATA (node));
}
static ArvDomNodeType
arv_dom_text_get_node_type (ArvDomNode *node)
{
return ARV_DOM_NODE_TYPE_TEXT_NODE;
}
/* ArvDomText implementation */
ArvDomNode *
arv_dom_text_new (const char *data)
{
ArvDomNode *node;
node = g_object_new (ARV_TYPE_DOM_TEXT, NULL);
arv_dom_character_data_set_data (ARV_DOM_CHARACTER_DATA (node), data);
return node;
}
static void
arv_dom_text_init (ArvDomText *text_node)
{
}
/* ArvDomText class */
static void
arv_dom_text_class_init (ArvDomTextClass *klass)
{
ArvDomNodeClass *node_class = ARV_DOM_NODE_CLASS (klass);
node_class->get_node_name = arv_dom_text_get_node_name;
node_class->get_node_value = arv_dom_text_get_node_value;
node_class->get_node_type = arv_dom_text_get_node_type;
}