1. 05 Mar, 2009 1 commit
    • Colin Walters's avatar
      Bug 557383 - Virtual method support · fdbe3cc3
      Colin Walters authored
      Broadly speaking, this change adds the concept of <vfunc> to the .gir.
      The typelib already had most of the infrastructure for virtual functions,
      though there is one API addition.
      The scanner assumes that any class callback slot that doesn't match
      a signal name is a virtual.  In the .gir, we write out *both* the <method>
      wrapper and a <vfunc>.  If we can determine an association between
      them (based on the names matching, or a new Virtual: annotation),
      then we notate that in the .gir.
      The typelib gains an association from the vfunc to the function, if
      it exists.  This will be useful for bindings since they already know
      how to consume FunctionInfo.
  2. 03 Mar, 2009 1 commit
    • Colin Walters's avatar
      Bug 571548 - Generic attributes · d5215b23
      Colin Walters authored
      We now support an extensible mechanism where arbitrary key-value
      pairs may be associated with almost all items, including objects,
      methods, and properties.
      These attributes appear in both the .gir and the .typelib.
  3. 28 Feb, 2009 1 commit
  4. 25 Feb, 2009 1 commit
  5. 20 Feb, 2009 1 commit
  6. 19 Feb, 2009 3 commits
  7. 06 Feb, 2009 1 commit
    • Colin Walters's avatar
      Bug 551738 - Associate classes with their structs · d1bf6a23
      Colin Walters authored
      Inside glibtransformer, we now look at structures ending in "Class" and
      see if they have an associated GlibObject (i.e. a structure of the same
      name without the "Class" suffix).  If found, pair them up.
      The .gir file for <class> gains an attribute denoting its associated
      class struct.  Any <record> many now have a glib:is-class-struct-for
      annotation which tells which (if any) <class> for which it defines the
      In the .typelib, we record the association between the class and
      its structure.  Generic structures however just have a boolean
      saying whether they're a class struct.  (Going from a generic class
      struct to its class should not be necessary).
      Finally, we expose GIRepository APIs to access both bits of information
      from the .typelib.
      svn path=/trunk/; revision=1088
  8. 05 Feb, 2009 1 commit
    • Colin Walters's avatar
      girnode.c: Fix copy & paste error · 4cec39e6
      Colin Walters authored
      This line is almost certainly a copy & paste error.  It appears to be
      harmless, but it's better to not have it.
      svn path=/trunk/; revision=1085
  9. 03 Jan, 2009 1 commit
    • Andreas Rottmann's avatar
      Bug 556489 鈥 callback annotations · bc88ef7b
      Andreas Rottmann authored
      2008-01-03  Andreas Rottmann  <a.rottmann@gmx.at>
      	Bug 556489 鈥 callback annotations
      	* giscanner/transformer.py 
      	* tools/generate.c (write_callable_info): Write out the new scope,
      	closure and destroy attributes.
      	* giscanner/transformer.py (Transformer._type_is_callback): New
      	method, checking if a given type is a callback.
      	(Transformer._augment_callback_params): New method; adds
      	information (closure, destroy) to callback parameters.
      	(Transformer._handle_closure, Transformer._handle_destroy): New methods, 
      	auxiliary to _augment_callback_params.
      	(Transformer._create_function): Call _augment_callback_params().
      	(Transformer._create_parameter): Handle scope option.
      	(Transformer._create_typedef_callback): New method, creates a
      	callback, and registers it in the typedef namespace
      	(Transformer._create_typedef): Use _create_typedef_callback()
      	instead of the plain _create_callback().
      	* giscanner/ast.py (Parameter): Added callback-related fields.
      	* giscanner/girwriter.py: Write out new Parameter fields.
      	* girepository/girnode.h (GIrNodeParam): Added fields scope, 
      	closure and destroy.
      	* girepository/gtypelib.h (ArgBlob): Ditto.
      	* girepository/girparser.c (start_parameter): Handle new fields.
      	* girepository/girmodule.c (g_ir_module_build_typelib): Adjust
      	arg_blob_size, bump major version due to this change.
      	* girepository/girnode.c (g_ir_node_get_full_size_internal)
      	* girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size
      	(g_ir_node_build_typelib): Fill in new ArgBlob flags from param. 
      	* girepository/girepository.h (GIScope): New enumeration, listing
      	the different possible scopes for callbacks.
      	* girepository/ginfo.c (g_arg_info_get_scope)
      	(g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for
      	callback-related argument indices (callback scope, closure for a
      	callback, destroy notification for a callback).
      	* tests/scanner/: Added testcases for new features.
      svn path=/trunk/; revision=998
  10. 25 Nov, 2008 1 commit
    • Colin Walters's avatar
      Bug 559705 鈥 Missing association between static methods and classes · 792c394d
      Colin Walters authored
      2008-11-25  Colin Walters  <walters@verbum.org>
              Bug 559705 鈥 Missing association between static methods and classes
              * docs/typelib-format.txt:
              * girepository/ginfo.c (g_function_info_get_flags):
              * girepository/girmodule.c (g_ir_module_build_typelib):
              * girepository/girnode.c (g_ir_node_get_size),
              * girepository/girparser.c (start_function):
              * girepository/gtypelib.c (g_typelib_check_sanity),
              (validate_header), (validate_function_blob):
              * girepository/gtypelib.h:
              * giscanner/ast.py:
              * giscanner/girwriter.py:
              * giscanner/glibtransformer.py:
              * tests/scanner/foo-1.0-expected.gir:
              * tests/scanner/foo-1.0-expected.tgir:
              * tests/scanner/foo.h:
      svn path=/trunk/; revision=972
  11. 18 Nov, 2008 2 commits
    • Colin Walters's avatar
      Use sizeof() instead of hard-coding struct sizes · a536b3f6
      Colin Walters authored
      svn path=/trunk/; revision=946
    • Owen Taylor's avatar
      Add "storage type" to the typelib data for enums · a2651795
      Owen Taylor authored
      In order to set and get enum and flag fields in structures, we need
      to know the integral type that the enumeration is stored as. We are already
      computing that at compile time in order to compute struct offsets, so the
      easiest thing to do is to save that in the typelib.
      * docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c
      girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob
      and compute and save it at compile time.
      * girepository/girepository.h girepository/ginfo.c:
      Add g_enum_info_get_storage_type().
      * girepository/gfield.c: Implement reading and writing enum and flags fields
      based on the storage type.
      svn path=/trunk/; revision=944
  12. 16 Nov, 2008 2 commits
    • Owen Taylor's avatar
      Respect is_pointer in serialize_type() · 3bf360cf
      Owen Taylor authored
      Add a '*' to the serialization for the cases where we set is_pointer
      in the type blob we write out depending on node->is_pointer. Don't
      add the '*' in the cases where is_pointer is set or not set in a
      fixed fashion.
      svn path=/trunk/; revision=931
    • Owen Taylor's avatar
      Bug 560825 鈥 Add size and alignment to typelib · c68cef1b
      Owen Taylor authored
      Include the size and alignment of structures and unions in the typelib,
      and add getter methods to retrieve them from GIStructInfo/GIUnionInfo.
      * docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c
      girepository/girmodule.c girepository/gtypelib.c: Add size and alignment
      to StructBlob and UnionBlob.
      * girepository/ginfo.c girepository/girepository.h:
      Add g_[struct|union]_get[size|alignment]().
      * test/offsets/gen-gitestoffsets: Test overall structure size and alignment.
      svn path=/trunk/; revision=930
  13. 13 Nov, 2008 1 commit
  14. 12 Nov, 2008 1 commit
  15. 11 Nov, 2008 2 commits
    • Owen Taylor's avatar
      Bug 560252 - Compute field offsets before writing typelib · 7e1e368b
      Owen Taylor authored
      girnode.h: Store the total size and alignment for
      giroffset.c: New file implementing computation of structure
       field offsets.
      girnode.c: Compute structure field offsets before writing types
       into the typelib.
      docs/typelib-format.txt: Document that a field offset of 0xFFFF
      means "unknown". Also fix description of the discriminator_offset
      field for unions.
      svn path=/trunk/; revision=876
    • Owen Taylor's avatar
      Bug 560250 - Fully parse included modules · 259eaeb7
      Owen Taylor authored
      For some things, like computing structure offsets to put into the typelib
      we need more than just the aliases from included modules. Do a completel
      parse of included modules and store in module->included_modules.
      Also add g_ir_find_node() to find node information from within the
      active set of modules and their includes.
      svn path=/trunk/; revision=874
  16. 25 Oct, 2008 1 commit
  17. 24 Oct, 2008 1 commit
  18. 22 Oct, 2008 1 commit
    • Tommi Komulainen's avatar
      Bug 557405 鈥 Use 'allow-none' consistently · dc651812
      Tommi Komulainen authored
      2008-10-22  Tommi Komulainen  <tommi.komulainen@iki.fi>
      	* docs/typelib-format.txt:
      	* girepository/ginfo.c (g_arg_info_may_be_null):
      	* girepository/girnode.c (g_ir_node_build_typelib):
      	* girepository/girnode.h (struct _GIrNodeParam):
      	* girepository/girparser.c (start_parameter):
      	* girepository/girwriter.c (function_generate):
      	* girepository/gtypelib.h (ArgBlob):
      	* tests/errors.gir:
      	* tests/function.gir:
      	* tools/generate.c (write_callable_info): Use 'allow-none'
      	consistently throughout
      svn path=/trunk/; revision=782
  19. 21 Oct, 2008 1 commit
    • Johan Bilien's avatar
      Bug 557241 鈥 "throws" flag for functions · efcca1bc
      Johan Bilien authored
      2008-10-21  Johan Bilien  <jobi@via.ecp.fr>
      	Bug 557241 鈥 "throws" flag for functions
      	* tests/scanner/drawable-1.0-expected.gir,
      	tests/scanner/drawable.[ch]: add simple test for throwing
      	function (has GError ** as last argument)
      	* giscanner/ast.py: add a 'throws' flag to Function
      	* giscanner/glibtransformer.py: if a function's last paramerter is
      	a GError, set the 'throws' flag and remove that parameter
      	* giscanner/girwriter.py: write out the 'throws' attribute
      	* giscanner/girparser.py: support parsing the 'throws' attribute
      	* tests/repository/gitestthrows.c: add a simple test to check the
      	throws flag in a typelib and invoke the function
      	* girepository/ginfo.c, girepository/girnode.[ch],
      	girepository/girnode.h, girepository/girparser.c,
      	girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag
      	* girepository/ginvoke.c: if a function throws, add a GError as last
      	arguments, and propagate the error to the invoker.
      svn path=/trunk/; revision=773
  20. 20 Oct, 2008 1 commit
  21. 16 Oct, 2008 1 commit
    • Tommi Komulainen's avatar
      Bug 556543 鈥 reduce compiler warnings · 7e1fa913
      Tommi Komulainen authored
      2008-10-16  Tommi Komulainen  <tommi.komulainen@iki.fi>
      	Bug 556543 鈥 reduce compiler warnings
      	* girepository/ginfo.c:
      	* girepository/girepository.c (register_internal,
      	count_interfaces, find_interface, find_namespace_version,
      	parse_version, g_irepository_require):
      	* girepository/girmodule.c (g_ir_module_build_typelib):
      	* girepository/girnode.c (init_stats, dump_stats,
      	_g_irnode_init_stats, _g_irnode_dump_stats,
      	* girepository/girparser.c (firstpass_end_element_handler,
      	locate_gir, parse_basic, parse_type_internal, resolve_aliases,
      	start_alias, start_type, end_type_top, parse_include, cleanup,
      	* girepository/gtypelib.c (validate_function_blob, validate_enum_blob):
      	* giscanner/giscannermodule.c (directive_get_options,
      	* giscanner/scannerlexer.l (parse_gtkdoc):
      	* giscanner/scannerparser.y (ctype_free):
      	* giscanner/sourcescanner.c:
      	* giscanner/sourcescanner.h (gi_source_scanner_parse_macros):
      	* tests/types/gitesttypes.c:
      	* tools/compiler.c (main):
      	* tools/generate.c (write_repository): Remove unused variables
      	and code, add missing includes, declarations and case
      svn path=/trunk/; revision=730
  22. 15 Oct, 2008 2 commits
    • Tommi Komulainen's avatar
      Bug 556434 鈥 unhandled interface/object/... member types · c6913c75
      Tommi Komulainen authored
      2008-10-15  Tommi Komulainen  <tommi.komulainen@iki.fi>
      	Bug 556434 鈥 unhandled interface/object/... member types
      	* girepository/girnode.c (g_ir_node_check_unhandled_members,
      	g_ir_node_build_typelib): Check all
      	interface/object/boxed/struct/union members are processed and
      	abort if they are not. (Mostly callbacks in structs, but also
      	fields in interfaces.)
      svn path=/trunk/; revision=722
    • Tommi Komulainen's avatar
      refactor common code for processing members to a function · bf913e7b
      Tommi Komulainen authored
      2008-10-15  Tommi Komulainen  <tommi.komulainen@iki.fi>
      	* a/girepository/girnode.c (g_ir_node_build_members,
      	g_ir_node_build_typelib): refactor common code for processing
      	members to a function
      svn path=/trunk/; revision=721
  23. 23 Sep, 2008 1 commit
  24. 16 Sep, 2008 1 commit
  25. 06 Sep, 2008 1 commit
    • Colin Walters's avatar
      Allow both union and struct to be boxed or not · e28078c7
      Colin Walters authored
      	* girepository/girnode.c: Allow gtype_name
      	and gtype_init in struct and union.
      	* girepository/girparser.c: Parse glib:
      	boxed bits for both structure and union.
      	* girepository/gtypelib.c: Don't barf
      	if structure is boxed.
      	* giscanner/girparser.py: Parse new XML
      	* giscanner/girwriter.py: Write out new
      	XML format.
      	* giscanner/glibast.py: Define new classes
      	which are both Boxed and Struct/Union, as
      	well as an "Other" for everything else.
      	* giscanner/glibtransformer.py: Handle
      	boxed types specially; we try to merge
      	them with a struct/union if one exists,
      	otherwise fall back to generic boxed.
      	* tests/*: Update.
      	* tools/generate.c: Write out new format.
      svn path=/trunk/; revision=575
  26. 28 Aug, 2008 1 commit
    • Tor Lillqvist's avatar
      Use binary mode for output file on Windows. · 2b24516e
      Tor Lillqvist authored
      2008-08-28  Tor Lillqvist  <tml@novell.com>
      	* tools/compiler.c (write_out_typelib): Use binary mode for output
      	file on Windows.
      	* girepository/girnode.c: Don't print NULL strings.
      	* tests/invoke/Makefile.am
      	* tests/scanner/Makefile.am: Use -no-undefined on Windows to
      	convince libtool to build shared libraries.
      	* tests/invoke/invoke.c: Don't needlessly include <dlfcn.h>. Use
      	g_assert() instead of printing out expected errors.
      svn path=/trunk/; revision=509
  27. 23 Aug, 2008 2 commits
  28. 22 Aug, 2008 1 commit
  29. 21 Aug, 2008 1 commit
    • Colin Walters's avatar
      Tweak to use UINT instead of INT. Not likely to matter. Add to · 59df1dd4
      Colin Walters authored
      2008-08-21  Colin Walters  <walters@verbum.org>
      	* girepository/girnode.c (write_string): Tweak to
      	use UINT instead of INT.  Not likely to matter.
      	* girepository/girmodule.c (g_ir_module_build_typelib):
      	Add to header_offset as well for header strings
      	to match what write_string does.
      	* girepository/gtypelib.c: Replace is_name with
      	validate_name, which more strongly validates and
      	handles errors in a better way.  Update all callers.
      	* giscanner/glibtransformer.py: Handle constructors
      svn path=/trunk/; revision=439
  30. 18 Aug, 2008 1 commit
    • Johan Dahlin's avatar
      Make enum serializing functions public. Clean up some whitespace. · dd3002bc
      Johan Dahlin authored
      2008-08-18  Johan Dahlin  <johan@gnome.org>
          * girepository/girepository.c (g_type_tag_to_string):
          * girepository/girepository.h:
          * girepository/girnode.c (g_ir_node_get_full_size_internal),
          * girepository/girnode.h:
          Make enum serializing functions public. Clean up some whitespace.
      svn path=/trunk/; revision=394
  31. 13 Aug, 2008 2 commits
    • Johan Dahlin's avatar
      Allow get_type to be None, set a get_type for GInitiallyUnowned too. · 727b6d41
      Johan Dahlin authored
      2008-08-13  Johan Dahlin  <johan@gnome.org>
          * girepository/girnode.c (g_ir_node_get_full_size_internal):
          * girepository/girparser.c (start_class):
          * giscanner/glibtransformer.py:
          Allow get_type to be None, set a get_type for GInitiallyUnowned too.
      svn path=/trunk/; revision=362
    • Colin Walters's avatar
      Record typedefs as <alias> elements. Also attempt to look up types in · 5ec7b605
      Colin Walters authored
      2008-08-12  Colin Walters  <walters@verbum.org>
      	* giscanner/transformer.py: Record typedefs as <alias> elements.
      	  Also attempt to look up types in external namespaces.
      	* giscanner/girwriter.py: Write them.
      	* giscanner/glibtransformer.py: Rework resolver using real instanceof
      	checks.  Resolve interface methods and properties.
      	* tests/scanner/foo-object.h: Add a method with typedef.
      	* tests/scanner/Foo-expected.gir: Update.
      	* girepository/girnode.c: Debug tweaks.
      	* girepository/girparser.c: Make a first pass through the XML where we
      	record all the aliases.  This lets us resolve them as we go through the
      	second pass.
      	* gir/Makefile.am: Don't install gobject-2.0.gir; we want that to come
      	from gir-repository.
      svn path=/trunk/; revision=355
  32. 12 Aug, 2008 1 commit