diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-10-08 16:06:56 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-08 16:06:56 +0100 |
commit | f9e20153b0c162662f95c821a6f4b27e5d2d9aec (patch) | |
tree | eba16317897a2ace9e073c68a69c489634f839cd /src/ir.h | |
parent | e170ee146791061f4fcc9523a901cdc1c6c8525b (diff) | |
download | nsgenbind-f9e20153b0c162662f95c821a6f4b27e5d2d9aec.tar.gz nsgenbind-f9e20153b0c162662f95c821a6f4b27e5d2d9aec.tar.bz2 |
Add automatic generation of property getters and setters
This allows the binding to omit specifying code for class property
getters and setters. The omitted code will be generated by genbind to
directly call suitable libdom accessors.
The type of the property (string, boolean etc.) is derived from the
IDL. If this type is incorrect, or is a type the generator cannot
automatically produce, then the property will be treated like it has no
binding implementation and generate unimplemented warnings.
Diffstat (limited to 'src/ir.h')
-rw-r--r-- | src/ir.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -52,11 +52,18 @@ struct ir_attribute_entry { const char *name; /** attribute name */ struct webidl_node *node; /**< AST attribute node */ - enum webidl_type_modifier modifier; + enum webidl_type base_type; /* type of attribute */ + enum webidl_type_modifier modifier; /* type modifier */ const char *putforwards; struct genbind_node *getter; /**< getter from binding */ struct genbind_node *setter; /**< getter from binding */ + + char *property_name; /**< the attribute name converted to output + * appropriate value. e.g. generators targetting c + * might lowercase the name or add underscores + * instead of caps + */ }; /** map entry for constants on an interface */ @@ -101,8 +108,8 @@ enum ir_entry_type { /** top level entry info common to interfaces and dictionaries */ struct ir_entry { - const char *name; /** dictionary name */ - struct webidl_node *node; /**< AST dictionary node */ + const char *name; /** IDL name */ + struct webidl_node *node; /**< AST node */ const char *inherit_name; /**< Name of interface inhertited from */ struct genbind_node *class; /**< class from binding (if any) */ |