summaryrefslogtreecommitdiffstats
path: root/codegen
Commit message (Collapse)AuthorAgeFilesLines
* fixed autotools buildJohn (J5) Palmieri2010-04-152-9/+15
| | | | | | | | * some file moved from codegen to codegen/libcodegen - create Makefile.am in libcodegen dir - remove refs to files and add the libcodegen subdir in codegen/Makefile.am * add AM_MAINTAINER_MODE to configure.ac - allows ./autogen.sh to be run without flags
* Python 3 support for setup.pyJohn Ehresman2010-04-1519-2880/+2590
|
* Modify codegen code to run under either Python 2.x or 3.xJohn Ehresman2010-04-151-2/+2
|
* Make pyglib-python-compat.h a public header and include in pygobject.h Also ↵John Ehresman2010-04-151-1/+1
| | | | #define PyVarObject_HEAD_INIT if not defined (in < python 2.6)
* Use richcompare slot rather than old compare slot and Py_TYPE macro in ↵John Ehresman2010-04-151-4/+3
| | | | preparation for py3k support
* codegen/docextract_to_xml.py: One more &...; replacement (&nbsp;).masterJosé Alburquerque2010-04-131-0/+1
| | | | | * codegen/docextract_to_xml.py: Replace &nbsp; which also causes errors with a regular space.
* codegen/docextract_to_xml.py: Replace some &..; that cause errors.José Alburquerque2010-04-131-0/+4
| | | | | * codegen/docextract_to_xml.py (escape_text): Replace some &..; expressions that cause errors with more appropriate output.
* codegen/docextract_to_xml.py: Handle C++ multi-line comments.José Alburquerque2010-04-111-0/+9
| | | | | | | * codegen/docextract_to_xml.py (escape_text): Translate '/*' and '*/' in text to '/ *' and '* /' respectively so that comment errors don't show up when the descriptions that include C++ code with C++ multi-line comments are used in Doxygen blocks.
* codegen/docextract.py: Stop final section processing on first match.José Alburquerque2010-04-111-0/+4
| | | | | | | * codegen/docextract.py (process_final_sections): Modify the final section pattern matching for loop to stop on first match so that it doesn't match both a colon return ('Returns: ...') and a no colon return ('Returns ...') which leads to annotation extraction errors.
* Update doc extraction tool to handle GObjectIntrospection annotations.José Alburquerque2010-04-112-112/+414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * codegen/docextract.py (FunctionDoc): Renamed class to GtkDoc. (GtkDoc::annotations): Added a list field to store annotations which are 2-tuples of (name, value). (GtkDoc::ret): Modified field to store the return description along with a list of annotations as described above. (GtkDoc::params): Now holds a list of 3-tupples: name, description and annotations (as described above). (GtkDoc::block_type): Add a field to tell if the comment block is a function block, signal block or property block. (GtkDoc::set_type): (GtkDoc::get_type): Add methods for setting/getting the block type. (GtkDoc::add_param): Modified to also accept a list of annotations to be added with the parameter. (GtkDoc::add_annotation): (GtkDoc::get_annotations): Added methods to add/get annotations for the comment block. (GtkDoc::append_description): Renamed to append_to_description(). (GtkDoc::get_param_description): Removed unused method. (GtkDoc::get_description): Added method to get block description. (GtkDoc::add_return): Added method to add a return accepting the first line of the description and its annotations. (GtkDoc::append_return): Renamed to append_to_return(). (Regular expressions): - Made the names of the variables un-abbreviated. - Added 'since', 'deprecated' and 'rename to' regular expressions. - Modified the return matching regular expression so that it doesn't match descriptions that begin with 'Returns ...'. This improves the docs of many function. - Added signal and property comment block identifier matching regular expressions in case those are useful. - Modified existing identifier matching regular expressions (function, signal, and property regular expressions) to properly parse annotations. Also added a regular expression for extracting annotations from the parameter and return descriptions. - Refined the function name matching regular expression to only accept identifiers that begin with a lowercase letter. This eliminates 'SECTION:' matches. - Finally, grouped commonly related expressions like return_pattern, since_pattern, etc. into groups (in lists) so that matching those sections can be done using loops. (Parsing algorithm): Modified the algorithm to use a functional approach to parsing. Extra methods like skip_to_comment() and processs_params() have been added and used in the parse_file() function to now process the comment blocks. (parse_dir): Added file processing output to stderr. * codegen/docextract_to_xml.py (usage): Added function to print out the usage. (print_annotations): Added function to print the given list of annotations. (options): Added --with-signals (-i), with-properties (-p) and --with-annotation (-a) to the existing --source-dir (-s) option. (algorithm): Now prints annotations, if specified. Also, prints signals and properties correctly (using names like Class::signal-one for signals and Classs:property) with xml such as <signal name="...">...</signal>. The return xml is slightly modified with annotations but this would only be exhibited if annotation xml is requested.
* * codegen/defsgen.py (clean_patterns): Strip out Windows DLL API macros.John Finlay2009-07-081-3/+3
|
* Allow h2def.py to work when there are tabs or multiple spaces after the ↵Murray Cumming2009-06-181-4/+4
| | | | struct keyword.
* Make codegen report errors using Python function/method namesPaul Pogonyshev2009-06-122-5/+14
| | | | Part of bug #584289.
* Install executable codegen parts with executing permissionsPaul Pogonyshev2009-05-318-11/+18
| | | | Also add shebang where it was missing. Bug #583979.
* Add -n --namespace option and the code to removeSiavash Safi2009-05-041-24/+109
| | | | | | dll API in headers, Added documentation Patch from bug #579275
* Code maintenance: add .gitignore filesPaul Pogonyshev2009-04-181-0/+2
|
* Bug 573753 – DeprecationWarning under python 2.6James Westby2009-04-141-1/+1
| | | | | | | | | | | 2009-04-14 James Westby <jw+debian@jameswestby.net> Bug 573753 – DeprecationWarning under python 2.6 * codegen/definitions.py (ReturnType.__init__): Don't pass 'type_name' argument to super __init__. svn path=/trunk/; revision=1063
* Bug 576566 – several scripts from codegen directory are not distributedKrzesimir Nowak2009-04-141-0/+6
| | | | | | | | | | | | 2009-04-14 Krzesimir Nowak <krnowak@svn.gnome.org> Bug 576566 – several scripts from codegen directory are not distributed * codegen/Makefile.am (codegen_PYTHON): List several missing scripts. svn path=/trunk/; revision=1062
* :write_enum_defs(): Prevent an exception when the prefix is empty.Murray Cumming2009-02-061-1/+1
| | | | | | | | | 2009-02-06 Murray Cumming <murrayc@murrayc.com> * codegen/h2def.py DefsWriter::write_enum_defs(): Prevent an exception when the prefix is empty. svn path=/trunk/; revision=1001
* Do not escape the ampersand "&" in entity references (bug #568485).Daniel Elstner2009-01-271-7/+12
| | | | | | | | * codegen/docextract_to_xml.py (escape_text): Do not escape the ampersand "&" in entity references (bug #568485). Replace some unusual entity references in the output with their literal values. svn path=/trunk/; revision=998
* Add option (-p) to use the modulename as a hint to the prefix of functionsJohn Finlay2008-11-031-18/+84
| | | | | | | | | | * codegen/defsgen.py (DefsWriter.write_enum_defs): Add option (-p) to use the modulename as a hint to the prefix of functions and type codes. Provide way to identify untyped enums and flags and print defs for them as well. svn path=/trunk/; revision=975
* Add defsgen to __all__ list. Strip out # directives from enum defintions.John Finlay2008-11-012-0/+6
| | | | | | | | | * codegen/__init__.py (__all__): Add defsgen to __all__ list. * codegen/h2def.py (find_enum_defs): Strip out # directives from enum defintions. (clean_func): Change ' * G_CONST_RETURN * ' to '** ' svn path=/trunk/; revision=974
* Add defsgen.pyJohn Finlay2008-10-311-0/+1
| | | | | | | * codegen/Makefile.am (codegen_PYTHON): Add defsgen.py svn path=/trunk/; revision=973
* Use the passed in prefix as a hint when creating a typecode.John Finlay2008-10-312-14/+29
| | | | | | | | | | | | | | | * codegen/defsgen.py (typecode): Use the passed in prefix as a hint when creating a typecode. (split_prefix,write_enum_defs,_write_obj_helper): Add function to use passed in prefix as a hint when splitting an object name into module and name. * codegen/h2def.py (DefsWriter.write_enum_defs): Make sure the prefix ends with a _ i.e. really handle the GDK_FONT_FONT, GDK_FONT_FONTSET case. svn path=/trunk/; revision=972
* Bug 551056 – make codegen not import when corresponding argument typesPaul Pogonyshev2008-09-082-7/+16
| | | | | | | | | | | | | | | | | | 2008-09-08 Paul Pogonyshev <pogonyshev@gmx.net> Bug 551056 – make codegen not import when corresponding argument types are not registered * codegen/override.py (import_pat): Add support for optional 'for' clause. (Overrides.__parse_override): Handle it. * codegen/codegen.py (SourceWriter.write_imports) (SourceWriter.write_object_imports): Adapt for changes in get_imports() return value. (is_registered_object): New function. svn path=/trunk/; revision=967
* add G_TYPE_CLOSURE boxed type in codegenGian Mario Tagliaretti2008-09-011-0/+1
| | | | svn path=/trunk/; revision=960
* More cleanups.Johan Dahlin2008-08-021-33/+38
| | | | svn path=/trunk/; revision=919
* PEP8ifyJohan Dahlin2008-08-021-69/+78
| | | | svn path=/trunk/; revision=918
* More refactoring. Avoid duplication, add xml string templatesJohan Dahlin2008-08-021-67/+62
| | | | svn path=/trunk/; revision=917
* further cleanupsJohan Dahlin2008-08-021-243/+255
| | | | svn path=/trunk/; revision=915
* Remove SGML support, require python 2.4, modernize, PEP-8ify. Make it runJohan Dahlin2008-08-022-108/+106
| | | | | | | | | | | | | | | | | 2008-08-02 Johan Dahlin <johan@gnome.org> * codegen/docgen.py: Remove SGML support, require python 2.4, modernize, PEP-8ify. Make it run on gio. * codegen/definitions.py: Make property iterable * gio/gio.defs: Include the gio-types.defs file. svn path=/trunk/; revision=914
* Rename from 'pygtk-codegen-2.0.in'.Paul Pogonyshev2008-07-152-2/+2
| | | | | | | | | | | | 2008-07-15 Paul Pogonyshev <pogonyshev@gmx.net> * codegen/pygobject-codegen-2.0.in: Rename from 'pygtk-codegen-2.0.in'. * configure.ac: * codegen/Makefile.am: Update accordingly. svn path=/trunk/; revision=813
* Bug 450659 – h2def.py - export 'typedef struct' object definitions notJohan Dahlin2008-07-141-1/+1
| | | | | | | | | | | | | 2008-07-15 Johan Dahlin <johan@gnome.org> Bug 450659 – h2def.py - export 'typedef struct' object definitions not working * codegen/h2def.py: Patch by Lauro Moura svn path=/trunk/; revision=807
* Map GSeekType to an intJohan Dahlin2008-07-141-0/+1
| | | | | | | | | | | | | | | 2008-07-14 Johan Dahlin <johan@gnome.org> * codegen/argtypes.py: Map GSeekType to an int * gio/gfileinfo.override: * gio/ginputstream.override: * gio/goutputstream.override: Add comments for missing API svn path=/trunk/; revision=798
* New class. (MethodDefBase.__init__): Make 'self.ret' a 'ReturnType'Paul Pogonyshev2008-07-143-10/+53
| | | | | | | | | | | | | | | | | | 2008-07-14 Paul Pogonyshev <pogonyshev@gmx.net> * codegen/definitions.py (ReturnType): New class. (MethodDefBase.__init__): Make 'self.ret' a 'ReturnType' instance, not string. Accept 'optional' flag. * codegen/argtypes.py (ArgMatcher.get_reverse_ret): Test if 'ptype' has true 'optional' attribute and copy it to 'props' then. * codegen/reversewrapper.py (ReturnType.support_optional): New class field, False by default. (GObjectReturn.support_optional, GObjectReturn.write_decl) (GObjectReturn.write_conversion): Support optional return. svn path=/trunk/; revision=796
* Add 'codegendir' variable. Make 'codegendir' refer to PyGObject's codegen,Paul Pogonyshev2008-07-131-1/+1
| | | | | | | | | | | 2008-07-14 Paul Pogonyshev <pogonyshev@gmx.net> * pygobject-2.0.pc.in: Add 'codegendir' variable. * codegen/pygtk-codegen-2.0.in: Make 'codegendir' refer to PyGObject's codegen, not PyGTK's one --- the latter will be removed (first part of bug #542821). svn path=/trunk/; revision=795
* clean_func(): Strip GSEAL out, to avoid us thinking that there are manyMurray Cumming2008-07-131-2/+6
| | | | | | | | | | | | | | | 2008-07-08 Murray Cumming <murrayc@murrayc.com> * codegen/h2def.py: clean_func(): Strip GSEAL out, to avoid us thinking that there are many functions called GSEAL (merge from PyGTK). 2008-01-29 Olivier Crete <tester@tester.ca> * codegen/h2def.py (DefsWriter.__init__): Fix copy-paste typos (merge from PyGTK). svn path=/trunk/; revision=794
* Update link to defs format discussionJohan Dahlin2008-04-211-1/+1
| | | | | | | | | 2008-04-21 Johan Dahlin <johan@gnome.org> * codegen/h2def.py: Update link to defs format discussion svn path=/trunk/; revision=778
* Add goffset to the int64 arg typeJohan Dahlin2008-04-061-0/+1
| | | | | | | | | 2008-04-06 Johan Dahlin <johan@gnome.org> * codegen/argtypes.py (arg): Add goffset to the int64 arg type svn path=/trunk/; revision=757
* Import codegen from pygtk. Add initial gio and gio.unix bindings.Johan Dahlin2008-01-1923-0/+7730
2008-01-19 Johan Dahlin <johan@gnome.org> * Makefile.am: * codegen/Makefile.am: * codegen/README.defs: * codegen/__init__.py: * codegen/argtypes.py: * codegen/code-coverage.py: * codegen/codegen.py: * codegen/createdefs.py: * codegen/definitions.py: * codegen/defsconvert.py: * codegen/defsgen.py: * codegen/defsparser.py: * codegen/docextract.py: * codegen/docextract_to_xml.py: * codegen/docgen.py: * codegen/h2def.py: * codegen/mergedefs.py: * codegen/missingdefs.py: * codegen/mkskel.py: * codegen/override.py: * codegen/pygtk-codegen-2.0.in: * codegen/reversewrapper.py: * codegen/scanvirtuals.py: * codegen/scmexpr.py: * configure.ac: * gio/Makefile.am: * gio/__init__.py: * gio/gio-types.defs: * gio/gio.defs: * gio/gio.override: * gio/giomodule.c: (init_gio): * gio/unix-types.defs: * gio/unix.defs: * gio/unix.override: * gio/unixmodule.c: (initunix): Import codegen from pygtk. Add initial gio and gio.unix bindings. svn path=/trunk/; revision=730