~ubuntu-branches/ubuntu/breezy/lasso/breezy

« back to all changes in this revision

Viewing changes to lasso/xml/is_select.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-09-16 02:16:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050916021649-lr5tuka6pfmmks44
Tags: 0.6.2-3ubuntu1
* debian/control: removed hardcoded php dependency, added php:Depends
  substvar
* debian/rules: added phpapiver, added substitution of php:Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: is_select.c,v 1.2 2005/01/22 15:57:55 eraviart Exp $ 
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004, 2005 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: See AUTHORS file in top-level directory.
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; either version 2 of the License, or
 
13
 * (at your option) any later version.
 
14
 * 
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 * 
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#include <lasso/xml/is_select.h>
 
26
 
 
27
/*
 
28
 * Schema fragments (liberty-idwsf-interaction-svc-v1.0.xsd):
 
29
 *
 
30
 * <xs:element name="Select" type="SelectType"/>
 
31
 * <xs:complexType name="SelectType">
 
32
 *   <xs:complexContent>
 
33
 *     <xs:extension base="InquiryElementType">
 
34
 *       <xs:sequence>
 
35
 *         <xs:element name="Item" minOccurs="2" maxOccurs="unbounded"/>
 
36
 *       </xs:sequence>
 
37
 *       <xs:attribute name="multiple" type="xs:boolean" use="optional" default="false"/>
 
38
 *     </xs:extension>
 
39
 *   </xs:complexContent>
 
40
 * </xs:complexType>
 
41
 */ 
 
42
 
 
43
/*****************************************************************************/
 
44
/* private methods                                                           */
 
45
/*****************************************************************************/
 
46
 
 
47
static struct XmlSnippet schema_snippets[] = {
 
48
        { "Item", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsSelect, Item) },
 
49
        { "multiple", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN,
 
50
          G_STRUCT_OFFSET(LassoIsSelect, multiple) },
 
51
        { NULL, 0, 0}
 
52
};
 
53
 
 
54
/*****************************************************************************/
 
55
/* instance and class init functions                                         */
 
56
/*****************************************************************************/
 
57
 
 
58
static void
 
59
instance_init(LassoIsSelect *node)
 
60
{
 
61
        node->Item = NULL;
 
62
        node->multiple = FALSE;
 
63
}
 
64
 
 
65
static void
 
66
class_init(LassoIsSelectClass *klass)
 
67
{
 
68
        LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
 
69
 
 
70
        nclass->node_data = g_new0(LassoNodeClassData, 1);
 
71
        lasso_node_class_set_nodename(nclass, "Select");
 
72
        lasso_node_class_set_ns(nclass, LASSO_IS_HREF, LASSO_IS_PREFIX);
 
73
        lasso_node_class_add_snippets(nclass, schema_snippets);
 
74
}
 
75
 
 
76
GType
 
77
lasso_is_select_get_type()
 
78
{
 
79
        static GType this_type = 0;
 
80
 
 
81
        if (!this_type) {
 
82
                static const GTypeInfo this_info = {
 
83
                        sizeof (LassoIsSelectClass),
 
84
                        NULL,
 
85
                        NULL,
 
86
                        (GClassInitFunc) class_init,
 
87
                        NULL,
 
88
                        NULL,
 
89
                        sizeof(LassoIsSelect),
 
90
                        0,
 
91
                        (GInstanceInitFunc) instance_init,
 
92
                };
 
93
 
 
94
                this_type = g_type_register_static(LASSO_TYPE_NODE,
 
95
                                "LassoIsSelect", &this_info, 0);
 
96
        }
 
97
        return this_type;
 
98
}
 
99
 
 
100
LassoIsSelect*
 
101
lasso_is_select_new(LassoIsItem *item1, LassoIsItem *item2)
 
102
{
 
103
        LassoIsSelect *node;
 
104
 
 
105
        node = g_object_new(LASSO_TYPE_IS_SELECT, NULL);
 
106
 
 
107
        return node;
 
108
}