diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-01 21:47:58 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-01 22:22:39 +0800 |
commit | 621bbbb8631f4b149d0478a3423687e4e973b04f (patch) | |
tree | 5dc21cc9d4893343c50af7e8f109905ac6ae447e /tools/gobject-foo.py | |
parent | 9503c4aa28b9a4215e3e325a31b500f2c78b712a (diff) | |
download | gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.gz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.bz2 gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.lz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.xz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.zst gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.zip |
Update tools from telepathy-glib
Diffstat (limited to 'tools/gobject-foo.py')
-rw-r--r-- | tools/gobject-foo.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/gobject-foo.py b/tools/gobject-foo.py index 5921cab8a..002a290ba 100644 --- a/tools/gobject-foo.py +++ b/tools/gobject-foo.py @@ -5,7 +5,7 @@ # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # -# Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/> +# Copyright (C) 2007-2010 Collabora Ltd. <http://www.collabora.co.uk/> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -33,8 +33,13 @@ def gobject_header(head, tail, as_interface=False): gtype = head.upper() + '_TYPE_' + tail.upper() o("typedef struct _%s %s;" % (MixedCase, MixedCase)) - o("typedef struct _%sClass %sClass;" % (MixedCase, MixedCase)) - o("typedef struct _%sPrivate %sPrivate;" % (MixedCase, MixedCase)) + + if as_interface: + o("typedef struct _%sInterface %sInterface;" % (MixedCase, MixedCase)) + else: + o("typedef struct _%sClass %sClass;" % (MixedCase, MixedCase)) + o("typedef struct _%sPrivate %sPrivate;" % (MixedCase, MixedCase)) + o("") o("GType %s_get_type (void);" % lower_case) o("") @@ -54,13 +59,17 @@ def gobject_header(head, tail, as_interface=False): o("#define %s_IS_%s(obj) \\" % (head.upper(), tail.upper())) o(" (G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))" % gtype) - if not as_interface: + if as_interface: + o("#define %s_GET_IFACE(obj) \\" % UPPER_CASE) + o(" (G_TYPE_INSTANCE_GET_INTERFACE ((obj), %s, \\" % gtype) + o(" %sInterface))" % MixedCase) + else: o("#define %s_IS_%s_CLASS(klass) \\" % (head.upper(), tail.upper())) o(" (G_TYPE_CHECK_CLASS_TYPE ((klass), %s))" % gtype) - o("#define %s_GET_CLASS(obj) \\" % UPPER_CASE) - o(" (G_TYPE_INSTANCE_GET_CLASS ((obj), %s, \\" % gtype) - o(" %sClass))" % MixedCase) + o("#define %s_GET_CLASS(obj) \\" % UPPER_CASE) + o(" (G_TYPE_INSTANCE_GET_CLASS ((obj), %s, \\" % gtype) + o(" %sClass))" % MixedCase) return out |