[turbine] align GObject::{set,get}_property's arguments
- From: Thomas Wood <thos src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [turbine] align GObject::{set,get}_property's arguments
- Date: Wed, 2 Dec 2009 10:24:18 +0000 (UTC)
commit 320c351ef8539735a6ad6b12f4094adb34d1a282
Author: Damien Lespiau <damien lespiau intel com>
Date: Mon Nov 30 20:03:44 2009 +0000
align GObject::{set,get}_property's arguments
Fed up to have to align those manually every time a class is generated.
src/turbine/__init__.py | 5 ++++-
src/turbine/template.py | 10 ++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/turbine/__init__.py b/src/turbine/__init__.py
index 36a6809..2d17ac9 100755
--- a/src/turbine/__init__.py
+++ b/src/turbine/__init__.py
@@ -163,7 +163,10 @@ def handle_post(button, ui):
data['priv_typedef'] = "";
if data['props']:
- extra.append(template.prop_template)
+ indent = {}
+ indent['class_lower'] = data['class_lower']
+ indent['function_len'] = " " * (len(data['class_lower']) + 13)
+ extra.append(template.prop_template % indent)
if data['dispose']:
extra.append(template.dispose_template)
diff --git a/src/turbine/template.py b/src/turbine/template.py
index d101c0f..9a73055 100644
--- a/src/turbine/template.py
+++ b/src/turbine/template.py
@@ -118,7 +118,10 @@ struct _%(class_camel)sPrivate
prop_template = """\
static void
-%(class_lower)s_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
+%(class_lower)s_get_property (GObject *object,
+%(function_len)s guint property_id,
+%(function_len)s GValue *value,
+%(function_len)s GParamSpec *pspec)
{
switch (property_id)
{
@@ -128,7 +131,10 @@ static void
}
static void
-%(class_lower)s_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
+%(class_lower)s_set_property (GObject *object,
+%(function_len)s guint property_id,
+%(function_len)s const GValue *value,
+%(function_len)s GParamSpec *pspec)
{
switch (property_id)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]