~ubuntu-branches/ubuntu/precise/empathy/precise-proposed-201205180810

« back to all changes in this revision

Viewing changes to telepathy-yell/tools/gobject-foo.py

  • Committer: Bazaar Package Importer
  • Author(s): Brian Curtis, Brian Curtis, Ken VanDine
  • Date: 2011-06-01 10:35:24 UTC
  • mfrom: (1.1.70 upstream) (6.3.44 experimental)
  • Revision ID: james.westby@ubuntu.com-20110601103524-wx3wgp71394730jt
Tags: 3.1.1-1ubuntu1
[ Brian Curtis ]
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Drop geoclue/mapping build-depends (they are in Universe)
  - Add Vcz-Bzr link
  - Add Suggests on telepathy-idle
  - Bump telepathy-butterfly, telepathy-haze to recommends
  - Don't recommend the freedesktop sound theme we have an ubuntu one
  - Add build depend for libunity-dev
* debian/rules:
  - Use autoreconf.mk
  - Disable map and location
* debian/empathy.install:
  - Install message indicator configuration
* debian/indicators/empathy:
  - Message indicator configuration
* debian/patches/01_lpi.patch:
  - Add Launchpad integration
* debian/patches/10_use_notify_osd_icons.patch:
  - Use the notify-osd image for new messages
* debian/patches/34_start_raised_execpt_in_session.patch
  - If not started with the session, we should always raise
* debian/patches/36_chat_window_default_size.patch:
  - Make the default chat window size larger
* debian/patches/37_facebook_default.patch:
  - Make facebook the default chat account type
* debian/patches/38_lp_569289.patch
  - Set freenode as default IRC network for new IRC accounts 
* debian/patches/41_unity_launcher_progress.patch
  - Display file transfer progress in the unity launcher

[ Ken VanDine ]
* debian/control
  - build depend on libgcr-3-dev instead of libgcr-dev
  - dropped build depends for libindicate, we will use telepathy-indicator
  - Depend on dconf-gsettings-backend | gsettings-backend
  - Added a Recommends for telepathy-indicator
* +debian/empathy.gsettings-override
  - Added an override for notifications-focus
* debian/patches/series
  - commented out 23_idomessagedialog_for_voip_and_ft.patch, until ido has 
    been ported to gtk3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
# gobject-foo.py: generate standard GObject type macros etc.
4
 
#
5
 
# The master copy of this program is in the telepathy-glib repository -
6
 
# please make any changes there.
7
 
#
8
 
# Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/>
9
 
#
10
 
# This library is free software; you can redistribute it and/or
11
 
# modify it under the terms of the GNU Lesser General Public
12
 
# License as published by the Free Software Foundation; either
13
 
# version 2.1 of the License, or (at your option) any later version.
14
 
#
15
 
# This library 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 GNU
18
 
# Lesser General Public License for more details.
19
 
#
20
 
# You should have received a copy of the GNU Lesser General Public
21
 
# License along with this library; if not, write to the Free Software
22
 
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
 
 
24
 
def gobject_header(head, tail, as_interface=False):
25
 
    out = []
26
 
    o = out.append
27
 
 
28
 
    name = head + '_' + tail
29
 
    MixedCase = name.replace('_', '')
30
 
    lower_case = name.lower()
31
 
    UPPER_CASE = name.upper()
32
 
 
33
 
    gtype = head.upper() + '_TYPE_' + tail.upper()
34
 
 
35
 
    o("typedef struct _%s %s;" % (MixedCase, MixedCase))
36
 
    o("typedef struct _%sClass %sClass;" % (MixedCase, MixedCase))
37
 
    o("typedef struct _%sPrivate %sPrivate;" % (MixedCase, MixedCase))
38
 
    o("")
39
 
    o("GType %s_get_type (void);" % lower_case)
40
 
    o("")
41
 
 
42
 
    o("#define %s \\" % gtype)
43
 
    o("  (%s_get_type ())" % lower_case)
44
 
 
45
 
    o("#define %s(obj) \\" % UPPER_CASE)
46
 
    o("  (G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, \\" % gtype)
47
 
    o("                               %s))" % MixedCase)
48
 
 
49
 
    if not as_interface:
50
 
        o("#define %s_CLASS(klass) \\" % UPPER_CASE)
51
 
        o("  (G_TYPE_CHECK_CLASS_CAST ((klass), %s, \\" % gtype)
52
 
        o("                            %sClass))" % MixedCase)
53
 
 
54
 
    o("#define %s_IS_%s(obj) \\" % (head.upper(), tail.upper()))
55
 
    o("  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))" % gtype)
56
 
 
57
 
    if not as_interface:
58
 
        o("#define %s_IS_%s_CLASS(klass) \\" % (head.upper(), tail.upper()))
59
 
        o("  (G_TYPE_CHECK_CLASS_TYPE ((klass), %s))" % gtype)
60
 
 
61
 
    o("#define %s_GET_CLASS(obj) \\" % UPPER_CASE)
62
 
    o("  (G_TYPE_INSTANCE_GET_CLASS ((obj), %s, \\" % gtype)
63
 
    o("                              %sClass))" % MixedCase)
64
 
 
65
 
    return out
66
 
 
67
 
if __name__ == '__main__':
68
 
    import sys
69
 
    from getopt import gnu_getopt
70
 
 
71
 
    options, argv = gnu_getopt(sys.argv[1:], '', ['interface'])
72
 
 
73
 
    as_interface = False
74
 
 
75
 
    for opt, val in options:
76
 
        if opt == '--interface':
77
 
            as_interface = True
78
 
 
79
 
    head, tail = argv
80
 
 
81
 
    print '\n'.join(gobject_header(head, tail, as_interface=as_interface))