forked from AravisProject/aravis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharvdomelement.c
92 lines (74 loc) · 2.42 KB
/
arvdomelement.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
83
84
85
86
87
88
89
90
91
92
/* Aravis - Digital camera library
*
* Copyright © 2009-2022 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:arvdomelement
* @short_description: Base class for DOM element nodes
*/
#include <arvdomelement.h>
#include <string.h>
G_DEFINE_ABSTRACT_TYPE (ArvDomElement, arv_dom_element, ARV_TYPE_DOM_NODE)
/* ArvDomNode implementation */
static const char *
arv_dom_element_get_node_value (ArvDomNode *node)
{
return NULL;
}
static ArvDomNodeType
arv_dom_element_get_node_type (ArvDomNode *node)
{
return ARV_DOM_NODE_TYPE_ELEMENT_NODE;
}
/* ArvDomElement implementation */
const char *
arv_dom_element_get_attribute (ArvDomElement* self, const char* name)
{
g_return_val_if_fail (ARV_IS_DOM_ELEMENT (self), NULL);
g_return_val_if_fail (name != NULL, NULL);
return ARV_DOM_ELEMENT_GET_CLASS (self)->get_attribute (self, name);
}
void
arv_dom_element_set_attribute (ArvDomElement* self, const char* name, const char* attribute_value)
{
g_return_if_fail (ARV_IS_DOM_ELEMENT (self));
g_return_if_fail (name != NULL);
ARV_DOM_ELEMENT_GET_CLASS (self)->set_attribute (self, name, attribute_value);
arv_dom_node_changed (ARV_DOM_NODE (self));
}
const char *
arv_dom_element_get_tag_name (ArvDomElement *self)
{
g_return_val_if_fail (ARV_IS_DOM_ELEMENT (self), NULL);
return arv_dom_node_get_node_name (ARV_DOM_NODE (self));
}
static void
arv_dom_element_init (ArvDomElement *element)
{
}
/* ArvDomElement class */
static void
arv_dom_element_class_init (ArvDomElementClass *klass)
{
ArvDomNodeClass *node_class = ARV_DOM_NODE_CLASS (klass);
node_class->get_node_value = arv_dom_element_get_node_value;
node_class->get_node_type = arv_dom_element_get_node_type;
}