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

« back to all changes in this revision

Viewing changes to ccode/valaccodeexpressionstatement.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:
1
1
/* valaccodeexpressionstatement.vala
2
2
 *
3
 
 * Copyright (C) 2006  Jürg Billeter
 
3
 * Copyright (C) 2006-2007  Jürg Billeter
4
4
 *
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 "valaccodeexpressionstatement.h"
 
23
#include <ccode/valaccodeexpressionstatement.h>
24
24
#include <stdlib.h>
25
25
#include <string.h>
26
 
#include <ccode/valaccodeexpressionstatement.h>
27
26
#include <ccode/valaccodenode.h>
 
27
#include <ccode/valaccodelinedirective.h>
28
28
 
29
29
struct _ValaCCodeExpressionStatementPrivate {
30
30
        ValaCCodeExpression* _expression;
39
39
static void vala_ccode_expression_statement_dispose (GObject * obj);
40
40
 
41
41
 
42
 
ValaCCodeExpressionStatement* vala_ccode_expression_statement_new (ValaCCodeExpression* expr)
43
 
{
 
42
ValaCCodeExpressionStatement* vala_ccode_expression_statement_new (ValaCCodeExpression* expr) {
44
43
        GParameter * __params;
45
44
        GParameter * __params_it;
46
45
        ValaCCodeExpressionStatement * self;
58
57
}
59
58
 
60
59
 
61
 
static void vala_ccode_expression_statement_real_write (ValaCCodeNode* base, ValaCCodeWriter* writer)
62
 
{
 
60
static void vala_ccode_expression_statement_real_write (ValaCCodeNode* base, ValaCCodeWriter* writer) {
63
61
        ValaCCodeExpressionStatement * self;
64
 
        self = ((ValaCCodeExpressionStatement*) base);
 
62
        self = VALA_CCODE_EXPRESSION_STATEMENT (base);
65
63
        g_return_if_fail (VALA_IS_CCODE_WRITER (writer));
66
 
        vala_ccode_writer_write_indent (writer);
 
64
        vala_ccode_writer_write_indent (writer, vala_ccode_node_get_line (VALA_CCODE_NODE (self)));
67
65
        if (vala_ccode_expression_statement_get_expression (self) != NULL) {
68
66
                vala_ccode_node_write (VALA_CCODE_NODE (vala_ccode_expression_statement_get_expression (self)), writer);
69
67
        }
72
70
}
73
71
 
74
72
 
75
 
ValaCCodeExpression* vala_ccode_expression_statement_get_expression (ValaCCodeExpressionStatement* self)
76
 
{
 
73
ValaCCodeExpression* vala_ccode_expression_statement_get_expression (ValaCCodeExpressionStatement* self) {
77
74
        g_return_val_if_fail (VALA_IS_CCODE_EXPRESSION_STATEMENT (self), NULL);
78
75
        return self->priv->_expression;
79
76
}
80
77
 
81
78
 
82
 
void vala_ccode_expression_statement_set_expression (ValaCCodeExpressionStatement* self, ValaCCodeExpression* value)
83
 
{
84
 
        ValaCCodeExpression* __temp1;
 
79
void vala_ccode_expression_statement_set_expression (ValaCCodeExpressionStatement* self, ValaCCodeExpression* value) {
 
80
        ValaCCodeExpression* _tmp1;
85
81
        g_return_if_fail (VALA_IS_CCODE_EXPRESSION_STATEMENT (self));
86
 
        __temp1 = NULL;
87
 
        self->priv->_expression = (__temp1 = g_object_ref (value), (self->priv->_expression == NULL ? NULL : (self->priv->_expression = (g_object_unref (self->priv->_expression), NULL))), __temp1);
 
82
        _tmp1 = NULL;
 
83
        self->priv->_expression = (_tmp1 = g_object_ref (value), (self->priv->_expression == NULL ? NULL : (self->priv->_expression = (g_object_unref (self->priv->_expression), NULL))), _tmp1);
88
84
}
89
85
 
90
86
 
91
 
static void vala_ccode_expression_statement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec)
92
 
{
 
87
static void vala_ccode_expression_statement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
93
88
        ValaCCodeExpressionStatement * self;
94
89
        self = VALA_CCODE_EXPRESSION_STATEMENT (object);
95
90
        switch (property_id) {
96
91
                case VALA_CCODE_EXPRESSION_STATEMENT_EXPRESSION:
97
92
                g_value_set_object (value, vala_ccode_expression_statement_get_expression (self));
98
93
                break;
 
94
                default:
 
95
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
96
                break;
99
97
        }
100
98
}
101
99
 
102
100
 
103
 
static void vala_ccode_expression_statement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec)
104
 
{
 
101
static void vala_ccode_expression_statement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
105
102
        ValaCCodeExpressionStatement * self;
106
103
        self = VALA_CCODE_EXPRESSION_STATEMENT (object);
107
104
        switch (property_id) {
108
105
                case VALA_CCODE_EXPRESSION_STATEMENT_EXPRESSION:
109
106
                vala_ccode_expression_statement_set_expression (self, g_value_get_object (value));
110
107
                break;
 
108
                default:
 
109
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
110
                break;
111
111
        }
112
112
}
113
113
 
114
114
 
115
 
static void vala_ccode_expression_statement_class_init (ValaCCodeExpressionStatementClass * klass)
116
 
{
 
115
static void vala_ccode_expression_statement_class_init (ValaCCodeExpressionStatementClass * klass) {
117
116
        vala_ccode_expression_statement_parent_class = g_type_class_peek_parent (klass);
118
117
        g_type_class_add_private (klass, sizeof (ValaCCodeExpressionStatementPrivate));
119
118
        G_OBJECT_CLASS (klass)->get_property = vala_ccode_expression_statement_get_property;
120
119
        G_OBJECT_CLASS (klass)->set_property = vala_ccode_expression_statement_set_property;
121
120
        G_OBJECT_CLASS (klass)->dispose = vala_ccode_expression_statement_dispose;
122
121
        VALA_CCODE_NODE_CLASS (klass)->write = vala_ccode_expression_statement_real_write;
123
 
        g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_CCODE_EXPRESSION_STATEMENT_EXPRESSION, g_param_spec_object ("expression", "foo", "bar", VALA_TYPE_CCODE_EXPRESSION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
 
122
        g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_CCODE_EXPRESSION_STATEMENT_EXPRESSION, g_param_spec_object ("expression", "expression", "expression", VALA_TYPE_CCODE_EXPRESSION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
124
123
}
125
124
 
126
125
 
127
 
static void vala_ccode_expression_statement_init (ValaCCodeExpressionStatement * self)
128
 
{
 
126
static void vala_ccode_expression_statement_init (ValaCCodeExpressionStatement * self) {
129
127
        self->priv = VALA_CCODE_EXPRESSION_STATEMENT_GET_PRIVATE (self);
130
128
}
131
129
 
132
130
 
133
 
static void vala_ccode_expression_statement_dispose (GObject * obj)
134
 
{
 
131
static void vala_ccode_expression_statement_dispose (GObject * obj) {
135
132
        ValaCCodeExpressionStatement * self;
136
 
        ValaCCodeExpressionStatementClass * klass;
137
 
        GObjectClass * parent_class;
138
133
        self = VALA_CCODE_EXPRESSION_STATEMENT (obj);
139
134
        (self->priv->_expression == NULL ? NULL : (self->priv->_expression = (g_object_unref (self->priv->_expression), NULL)));
140
 
        klass = VALA_CCODE_EXPRESSION_STATEMENT_CLASS (g_type_class_peek (VALA_TYPE_CCODE_EXPRESSION_STATEMENT));
141
 
        parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
142
 
        parent_class->dispose (obj);
 
135
        G_OBJECT_CLASS (vala_ccode_expression_statement_parent_class)->dispose (obj);
143
136
}
144
137
 
145
138
 
146
 
GType vala_ccode_expression_statement_get_type (void)
147
 
{
 
139
GType vala_ccode_expression_statement_get_type (void) {
148
140
        static GType vala_ccode_expression_statement_type_id = 0;
149
141
        if (G_UNLIKELY (vala_ccode_expression_statement_type_id == 0)) {
150
142
                static const GTypeInfo g_define_type_info = { sizeof (ValaCCodeExpressionStatementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_ccode_expression_statement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCCodeExpressionStatement), 0, (GInstanceInitFunc) vala_ccode_expression_statement_init };