~ubuntu-branches/ubuntu/hardy/vala/hardy

« back to all changes in this revision

Viewing changes to vala/valasizeofexpression.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge, Marc-Andre Lureau, Sebastian Dröge
  • Date: 2007-10-15 14:37:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071015143751-zy7hqcyjutdyfkg3
Tags: 0.1.4-1
[ Marc-Andre Lureau ]
* New Upstream Version
* debian/patches:
  + Remove patch no longer needed in 0.1.4
* debian/rules
  + Add xsltproc build dependency for the Vala manual.
  + Add libenchant-dev build dependency for enchant test case.
* debian/control, debian/vala-doc.install:
  + Add a "vala-doc" documentation package.

[ Sebastian Dröge ]
* debian/control:
  + Let vala-doc suggest valac/devhelp and don't depend on libvala0.
* debian/libvala-dev.install:
  + Add the new vapicheck utility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Lesser General Public
7
7
 * License as published by the Free Software Foundation; either
8
 
 * version 2 of the License, or (at your option) any later version.
 
8
 * version 2.1 of the License, or (at your option) any later version.
9
9
 
10
10
 * This library is distributed in the hope that it will be useful,
11
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
20
 *      Jürg Billeter <j@bitron.ch>
21
21
 */
22
22
 
23
 
#include "valasizeofexpression.h"
 
23
#include <vala/valasizeofexpression.h>
24
24
#include <vala/valatypereference.h>
25
25
#include <vala/valasourcereference.h>
26
 
#include <vala/valasizeofexpression.h>
27
26
#include <vala/valacodevisitor.h>
28
27
 
29
28
struct _ValaSizeofExpressionPrivate {
46
45
 * @param source reference to source code
47
46
 * @return       newly created sizeof expression
48
47
 */
49
 
ValaSizeofExpression* vala_sizeof_expression_new (ValaTypeReference* type, ValaSourceReference* source)
50
 
{
 
48
ValaSizeofExpression* vala_sizeof_expression_new (ValaTypeReference* type, ValaSourceReference* source) {
51
49
        GParameter * __params;
52
50
        GParameter * __params_it;
53
51
        ValaSizeofExpression * self;
67
65
}
68
66
 
69
67
 
70
 
static void vala_sizeof_expression_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor)
71
 
{
 
68
static void vala_sizeof_expression_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor) {
72
69
        ValaSizeofExpression * self;
73
 
        self = ((ValaSizeofExpression*) base);
 
70
        self = VALA_SIZEOF_EXPRESSION (base);
74
71
        g_return_if_fail (VALA_IS_CODE_VISITOR (visitor));
75
72
        vala_code_node_accept (VALA_CODE_NODE (vala_sizeof_expression_get_type_reference (self)), visitor);
76
73
        vala_code_visitor_visit_sizeof_expression (visitor, self);
77
74
}
78
75
 
79
76
 
80
 
ValaTypeReference* vala_sizeof_expression_get_type_reference (ValaSizeofExpression* self)
81
 
{
 
77
ValaTypeReference* vala_sizeof_expression_get_type_reference (ValaSizeofExpression* self) {
82
78
        g_return_val_if_fail (VALA_IS_SIZEOF_EXPRESSION (self), NULL);
83
79
        return self->priv->_type_reference;
84
80
}
85
81
 
86
82
 
87
 
void vala_sizeof_expression_set_type_reference (ValaSizeofExpression* self, ValaTypeReference* value)
88
 
{
89
 
        ValaTypeReference* __temp1;
 
83
void vala_sizeof_expression_set_type_reference (ValaSizeofExpression* self, ValaTypeReference* value) {
 
84
        ValaTypeReference* _tmp1;
90
85
        g_return_if_fail (VALA_IS_SIZEOF_EXPRESSION (self));
91
 
        __temp1 = NULL;
92
 
        self->priv->_type_reference = (__temp1 = g_object_ref (value), (self->priv->_type_reference == NULL ? NULL : (self->priv->_type_reference = (g_object_unref (self->priv->_type_reference), NULL))), __temp1);
 
86
        _tmp1 = NULL;
 
87
        self->priv->_type_reference = (_tmp1 = g_object_ref (value), (self->priv->_type_reference == NULL ? NULL : (self->priv->_type_reference = (g_object_unref (self->priv->_type_reference), NULL))), _tmp1);
93
88
}
94
89
 
95
90
 
96
 
static void vala_sizeof_expression_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec)
97
 
{
 
91
static void vala_sizeof_expression_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
98
92
        ValaSizeofExpression * self;
99
93
        self = VALA_SIZEOF_EXPRESSION (object);
100
94
        switch (property_id) {
101
95
                case VALA_SIZEOF_EXPRESSION_TYPE_REFERENCE:
102
96
                g_value_set_object (value, vala_sizeof_expression_get_type_reference (self));
103
97
                break;
 
98
                default:
 
99
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
100
                break;
104
101
        }
105
102
}
106
103
 
107
104
 
108
 
static void vala_sizeof_expression_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec)
109
 
{
 
105
static void vala_sizeof_expression_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
110
106
        ValaSizeofExpression * self;
111
107
        self = VALA_SIZEOF_EXPRESSION (object);
112
108
        switch (property_id) {
113
109
                case VALA_SIZEOF_EXPRESSION_TYPE_REFERENCE:
114
110
                vala_sizeof_expression_set_type_reference (self, g_value_get_object (value));
115
111
                break;
 
112
                default:
 
113
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
114
                break;
116
115
        }
117
116
}
118
117
 
119
118
 
120
 
static void vala_sizeof_expression_class_init (ValaSizeofExpressionClass * klass)
121
 
{
 
119
static void vala_sizeof_expression_class_init (ValaSizeofExpressionClass * klass) {
122
120
        vala_sizeof_expression_parent_class = g_type_class_peek_parent (klass);
123
121
        g_type_class_add_private (klass, sizeof (ValaSizeofExpressionPrivate));
124
122
        G_OBJECT_CLASS (klass)->get_property = vala_sizeof_expression_get_property;
125
123
        G_OBJECT_CLASS (klass)->set_property = vala_sizeof_expression_set_property;
126
124
        G_OBJECT_CLASS (klass)->dispose = vala_sizeof_expression_dispose;
127
125
        VALA_CODE_NODE_CLASS (klass)->accept = vala_sizeof_expression_real_accept;
128
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_SIZEOF_EXPRESSION_TYPE_REFERENCE, g_param_spec_object ("type-reference", "foo", "bar", VALA_TYPE_TYPE_REFERENCE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
 
126
        g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_SIZEOF_EXPRESSION_TYPE_REFERENCE, g_param_spec_object ("type-reference", "type-reference", "type-reference", VALA_TYPE_TYPE_REFERENCE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
129
127
}
130
128
 
131
129
 
132
 
static void vala_sizeof_expression_init (ValaSizeofExpression * self)
133
 
{
 
130
static void vala_sizeof_expression_init (ValaSizeofExpression * self) {
134
131
        self->priv = VALA_SIZEOF_EXPRESSION_GET_PRIVATE (self);
135
132
}
136
133
 
137
134
 
138
 
static void vala_sizeof_expression_dispose (GObject * obj)
139
 
{
 
135
static void vala_sizeof_expression_dispose (GObject * obj) {
140
136
        ValaSizeofExpression * self;
141
 
        ValaSizeofExpressionClass * klass;
142
 
        GObjectClass * parent_class;
143
137
        self = VALA_SIZEOF_EXPRESSION (obj);
144
138
        (self->priv->_type_reference == NULL ? NULL : (self->priv->_type_reference = (g_object_unref (self->priv->_type_reference), NULL)));
145
 
        klass = VALA_SIZEOF_EXPRESSION_CLASS (g_type_class_peek (VALA_TYPE_SIZEOF_EXPRESSION));
146
 
        parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
147
 
        parent_class->dispose (obj);
 
139
        G_OBJECT_CLASS (vala_sizeof_expression_parent_class)->dispose (obj);
148
140
}
149
141
 
150
142
 
151
 
GType vala_sizeof_expression_get_type (void)
152
 
{
 
143
GType vala_sizeof_expression_get_type (void) {
153
144
        static GType vala_sizeof_expression_type_id = 0;
154
145
        if (G_UNLIKELY (vala_sizeof_expression_type_id == 0)) {
155
146
                static const GTypeInfo g_define_type_info = { sizeof (ValaSizeofExpressionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_sizeof_expression_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaSizeofExpression), 0, (GInstanceInitFunc) vala_sizeof_expression_init };