sbus_codegen revision fcd8093c58638dc7c4f9cddfc97f273b94ce2ead
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Stef Walter <stefw@redhat.com>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Copyright (C) 2014 Red Hat
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This program is free software; you can redistribute it and/or modify
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# it under the terms of the GNU General Public License as published by
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# the Free Software Foundation; either version 3 of the License, or
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# (at your option) any later version.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This program is distributed in the hope that it will be useful,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# but WITHOUT ANY WARRANTY; without even the implied warranty of
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# GNU General Public License for more details.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You should have received a copy of the GNU General Public License
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# along with this program. If not, see <http://www.gnu.org/licenses/>.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Some parser code from GLib
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Copyright (C) 2008-2011 Red Hat, Inc.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This library is free software; you can redistribute it and/or
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# modify it under the terms of the GNU Lesser General Public
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# License as published by the Free Software Foundation; either
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# version 2 of the License, or (at your option) any later version.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This library is distributed in the hope that it will be useful,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# but WITHOUT ANY WARRANTY; without even the implied warranty of
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Lesser General Public License for more details.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You should have received a copy of the GNU Lesser General
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Public License along with this library; if not, write to the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Boston, MA 02111-1307, USA.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Portions by: David Zeuthen <davidz@redhat.com>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# DBus interfaces are defined here:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# The introspection data format has become the standard way to represent a
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# DBus interface. For many examples see /usr/share/dbus-1/interfaces/ on a
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# typical linux machine.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# A word about annotations. These are extra flags or values that can be
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# assigned to anything. So far, the codegen supports this annotation:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# - An annotation specified in the specification that tells us what C symbol
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# to generate for a given interface or method. By default the codegen will
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# build up a symbol name from the DBus name.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# -----------------------------------------------------------------------------
elif self.file:
return message
self.args = []
self.methods = []
self.signals = []
self.properties = []
for sig in iface.signals:
if sig.args:
if sig.args:
for prop in properties:
elif prop.readable:
elif prop.writable:
if iface.methods:
if iface.signals:
if iface.properties:
if include_header:
if iface.methods:
if iface.signals:
if iface.properties:
for meth in iface.methods:
if iface.methods:
self.state_stack = []
try:
if self.state == STATE_IGNORED:
elif self.cur_object and name == STATE_ANNOTATION:
elif self.state == STATE_TOP:
if name == STATE_NODE:
elif self.state == STATE_NODE:
if name == STATE_INTERFACE:
elif self.state == STATE_INTERFACE:
if name == STATE_METHOD:
elif name == STATE_SIGNAL:
elif name == STATE_PROPERTY:
elif self.state == STATE_METHOD:
elif self.state == STATE_SIGNAL:
elif self.state == STATE_PROPERTY:
elif self.state == STATE_ARG:
if options.output:
if options.output:
try: