Commit Graph

578 Commits

Author SHA1 Message Date
Johan Bilien
727bb01805 Bug 557241 – "throws" flag for functions
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-injected-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
2008-10-21 17:04:11 +00:00
Colin Walters
c3330c06c7 Bug 557011 - Add g_object_info_get_abstract
svn path=/trunk/; revision=757
2008-10-20 17:04:17 +00:00
Tommi Komulainen
0de03983be Bug 556732 – generate gir files consistently
2008-10-17  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556732 – generate gir files consistently

	* girepository/girparser.c (start_parameter):
	* tests/boxed.gir:
	* tests/invoke/testfns-1.0.gir:
	* tools/generate.c (write_callable_info): write
	'transfer-ownership' attribute consistently with both
	return-value and parameter elements

svn path=/trunk/; revision=745
2008-10-17 14:59:23 +00:00
Tommi Komulainen
0fa82c6a4c Bug 556732 – generate gir files consistently
2008-10-17  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556732 – generate gir files consistently

	* giscanner/ast.py (Field): add readable and writable properties
	* giscanner/girparser.py (_parse_field): copy 'readable' and
	'writable' attributes
	* giscanner/transformer.py (_create_member): create fields as
	read-write
	* giscanner/glibtransformer.py (_introspect_object,
	_pair_class_struct): make object instance and class fields
	read-only
	* giscanner/girwriter.py (_write_field):
	* tools/generate.c (write_field_info): write field 'readable'
	and 'writable' attributes only if non-default (read-only)
	* girepository/girparser.c (start_field): in the absence of
	attributes assume fields are read-only
	* tests/boxed.gir:
	* tests/struct.gir: remove redundant readable="1" from fields
	* tests/scanner/foo-1.0-expected.gir:
	* tests/scanner/utility-1.0-expected.gir: add writable="1" to
	all record and union fields

svn path=/trunk/; revision=743
2008-10-17 14:58:37 +00:00
Tommi Komulainen
4fb5b001bb Bug 556543 – reduce compiler warnings
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,
	g_ir_node_can_have_member):
	* 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,
	post_filter):
	* girepository/gtypelib.c (validate_function_blob, validate_enum_blob):
	* giscanner/giscannermodule.c (directive_get_options,
	type_get_child_list):
	* 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
	statements.

svn path=/trunk/; revision=730
2008-10-16 17:07:05 +00:00
Tommi Komulainen
e8c772bdb6 Bug 556541 – access union members through UnionBlob rather than
2008-10-16  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556541 – access union members through UnionBlob rather than
	StructBlob

	* girepository/ginfo.c (g_union_info_find_method): access union
	members through UnionBlob rather than StructBlob

svn path=/trunk/; revision=729
2008-10-16 17:07:00 +00:00
Colin Walters
7db23628b0 Merge branch 'bug556331-includecleanup'
svn path=/trunk/; revision=724
2008-10-16 01:40:29 +00:00
Tommi Komulainen
cab23be329 Bug 556434 – unhandled interface/object/... member types
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
2008-10-15 22:28:53 +00:00
Tommi Komulainen
7d89fdf643 refactor common code for processing members to a function
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
2008-10-15 22:28:41 +00:00
Tommi Komulainen
9153ef51ae Bug 556174 – parse types for lists etc.
2008-10-15  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556174 – parse types for lists etc.

	* girepository/girparser.c (end_type_recurse):
	* tests/boxed.gir:
	* tools/generate.c (write_type_info, write_field_info,
	write_callable_info, write_callable_info, write_constant_info,
	write_property_info): use nested <type>s for lists and hashes

svn path=/trunk/; revision=717
2008-10-15 22:08:26 +00:00
Tommi Komulainen
6e266d5f53 Bug 556400 – Fails to build on OS X 10.4
2008-10-15  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556400 – Fails to build on OS X 10.4

	* configure.ac: check for functions backtrace and backtrace_symbols
	* girepository/girparser.c (backtrace_stderr): Comment out
	implementation if the functions are not available.
	* gcov.mak (clean-gcov, clean-gcno): always call 'find' with a
	directory for better portability

svn path=/trunk/; revision=711
2008-10-15 20:44:29 +00:00
Johan Bilien
03d8379142 add g_union_info_find_method
2008-10-14  Johan Bilien  <jobi@via.ecp.fr>

	* girepository/ginfo.c, girepository/girepository.h: add
	g_union_info_find_method


svn path=/trunk/; revision=706
2008-10-14 22:25:13 +00:00
Colin Walters
5069680682 Document g_irepository_get_dependencies
svn path=/trunk/; revision=701
2008-10-13 16:59:09 +00:00
Colin Walters
0103bf1fe3 Don't cast DirEntry to Blob, actually look it up by offset
svn path=/trunk/; revision=696
2008-10-12 21:22:44 +00:00
Tommi Komulainen
a940cef8c7 handle "transfer-ownership" attribute
2008-10-12  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* girepository/girparser.c (start_return_value): handle
	"transfer-ownership" attribute

svn path=/trunk/; revision=690
2008-10-12 21:07:33 +00:00
Tommi Komulainen
25e43d53d1 use "container" for container/shallow ownership transfer (not "shallow")
2008-10-12  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* girepository/girparser.c (parse_param_transfer):
	* tools/generate.c (write_callable_info): use "container" for
	container/shallow ownership transfer (not "shallow")

svn path=/trunk/; revision=689
2008-10-12 21:07:28 +00:00
Tommi Komulainen
bc54751766 Refactor handling of transfer=none/shallow/full to separate function
2008-10-12  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* girepository/girparser.c (parse_param_transfer,
	start_parameter): Refactor handling of transfer=none/shallow/full
	to separate function

svn path=/trunk/; revision=688
2008-10-12 21:07:22 +00:00
Colin Walters
1ff932e7a1 Fix inverted test for success in version parsing.
svn path=/trunk/; revision=687
2008-10-12 21:03:41 +00:00
Tommi Komulainen
6a82099f9b Bug 556048 – Crash in g_irepository_find_by_gtype
* girepository/gtypelib.h (BLOB_IS_REGISTERED_TYPE): added
	* girepository/girepository.c (find_interface): Fix
	find_by_gtype case to get the type name from right offset

svn path=/trunk/; revision=686
2008-10-12 20:53:26 +00:00
Tommi Komulainen
44172e786a make 'unregistered' one bit wide as everywhere else
2008-10-12  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* girepository/gtypelib.h (RegisteredTypeBlob): make
	'unregistered' one bit wide as everywhere else

svn path=/trunk/; revision=684
2008-10-12 19:30:22 +00:00
Colin Walters
5cfc7580a3 Add tests/repository which has some repository regression tests
svn path=/trunk/; revision=683
2008-10-12 16:36:29 +00:00
Colin Walters
3be641f836 Bug 552858: versioning
This is a big patch.  You should probably remove your installation
	tree to be cleaner.

	* docs/typelib-format.txt: Add nsversion entry which holds
	version of namespace.
	* girepository/girepository.h: Add 'version' parameter to
	g_irepository_require.  This may be NULL.  Normally
	bindings should pass an explicit version though.
	* girepository/girepository.c: Lots of infrastructure to
	support versioning.  Add some more documentation.  Disallow
	some usage of NULL namespaces.
	* girepository/girmodule.c: Add version parameter.
	* girepository/gtypelib.c: Update header size.
	* giscanner/ast.py: Add version to Namespace.
	* giscanner/girparser.py: Parse version attribute from
	XML, pass to Namespace.
	* giscanner/girwriter.py: Write out version parameter.
	* giscanner/transformer.py: Clean up include registration.
	* tests/*: Add version attribute.
	* tests/invoke/invoke.c: Don't try looking up test before
	it's loaded in repository.
	* tools/generate.c: Output version parameter.
	* gir/Makefile.am: Add 2.0 version to .gir files.

svn path=/trunk/; revision=677
2008-10-12 04:51:48 +00:00
Johan Bilien
1b2aa59534 ignore non-UTF-8 string constants
2008-10-11  Johan Bilien  <jobi@litl.com>

	* giscanner/scannerparser.y: ignore non-UTF-8 string constants

2008-10-11  Johan Bilien  <jobi@litl.com>

	Bug 552347: Parse #defines constants

	* girepository/gtypelib.c: update the list of value_size
	with recently defined type tags
	* giscanner/scannerparser.y: brought back parsing of #defined, as
	present in older version
	* giscanner/giscannermodule.c: bind gi_source_scanner_append_filename
	* giscanner/girwriter.py: write out constant tags in the gir
	* giscanner/sourcescanner.py: add accessor for const_string
	* giscanner/transformer.py, giscanner/glibtransformer.py: handle
	constant

svn path=/trunk/; revision=673
2008-10-11 23:19:59 +00:00
Lucas Rocha
a0d5227db5 fix regression on invoke test case by making sure we load the global
2008-10-09  Lucas Rocha  <lucasr@gnome.org>

	* girepository/girepository.c (register_internal): fix regression on
	invoke test case by making sure we load the global module in the
	typelib when dealing with inline typelibs.
	* girepository/gtypelib.c: a couple of coding style fixes.

svn path=/trunk/; revision=661
2008-10-09 16:44:11 +00:00
Lucas Rocha
728beb0424 Bug 555294: Add support for multiple shared libraries per typelib.
2008-10-06  Lucas Rocha  <lucasr@gnome.org>

	Bug 555294: Add support for multiple shared libraries per typelib.

	* girepository/ginvoke.c (g_function_info_invoke),
	girepository/ginfo.c(g_registered_type_info_get_g_type): use
	g_typelib_symbol instead of g_module_symbol.
	* girepository/girepository.h: remove g_typelib_set_module and add
	g_typelib_symbol.
	* girepository/gtypelib.[ch] (find_some_symbol, _g_typelib_init,
	g_typelib_new_from_memory, g_typelib_new_from_const_memory,
	g_typelib_free, g_typelib_symbol): chnage GTypeLib to hold a list of
	modules instead of just one. The symbol lookup is now abstracted
	behind g_typelib_symbol which tries to find the passed symbol name in
	one of its modules.
	* giscanner/girwriter.py, tools/g-ir-scanner: change scanner to read
	and write shared_library attribute as a comma-separated list of libs.

svn path=/trunk/; revision=660
2008-10-07 21:25:01 +00:00
Colin Walters
ea99326529 Merge branch 'bug551744-boxed-ctors'
svn path=/trunk/; revision=654
2008-10-03 19:30:12 +00:00
Colin Walters
aceef77051 Use g_alloca, suggested by Havoc Pennington
svn path=/trunk/; revision=649
2008-10-02 21:24:24 +00:00
Colin Walters
ec679636ef Merge branch 'bug552961-methods/wip'
svn path=/trunk/; revision=647
2008-10-02 21:24:20 +00:00
Colin Walters
d982b65391 Remove debug print
svn path=/trunk/; revision=644
2008-10-02 14:07:42 +00:00
Colin Walters
a99fdaf755 Merge branch 'bug552393-varargs'
svn path=/trunk/; revision=643
2008-10-02 14:07:38 +00:00
Colin Walters
b26d8d2dce Bug 554632: Create type tag for GType
svn path=/trunk/; revision=641
2008-10-02 13:25:46 +00:00
Colin Walters
9893df46cb Ensure we always have types for container nodes
svn path=/trunk/; revision=638
2008-09-29 19:03:46 +00:00
Colin Walters
ff654e2d4e Rework to use recursive XML
svn path=/trunk/; revision=637
2008-09-29 19:03:44 +00:00
Colin Walters
f32239577e Remove non-repository types from GIR
* giscanner/ast.py: The canonical name is 'utf8', not
	'string'.
	* giscanner/glibast.py: A few more glib type mappings.
	* girepository/girparser.c: We only parse repository types.
	* tests/*.gir: Update.

svn path=/trunk/; revision=628
2008-09-25 22:33:57 +00:00
Colin Walters
8fc943f941 Merge branch 'bug552566-timet/wip'
svn path=/trunk/; revision=624
2008-09-23 18:20:25 +00:00
Colin Walters
bfb6271201 Strengthen check for interface vs basic types
Previously we were just checking "reserved", but to be more correct
we should check whether reserved2 is zero as well because it is
possible for offsets to have reserved = 0 but reserved2 != 0.

svn path=/trunk/; revision=620
2008-09-19 23:43:38 +00:00
Colin Walters
c760a31723 Validate the "this" argument for methods
svn path=/trunk/; revision=615
2008-09-19 14:55:20 +00:00
Colin Walters
4e4c8c137d Bug 522384: Use SHLIB_SUFFIX intead of G_MODULE_SUFFIX for Darwin
On Darwin, the suffix for installed shared libraries (.dylib) is
different from loadable modules (.so).  We use a bit of magic shell
script from Behdad Esfahbod to figure out the right suffix.

svn path=/trunk/; revision=612
2008-09-19 02:24:05 +00:00
Colin Walters
450476b1a7 Don't add spurious * if type is pointer; the is_pointer flag is enough
svn path=/trunk/; revision=611
2008-09-16 19:44:30 +00:00
Colin Walters
0ab7337756 Bug 552065: Add deprecation information to GIR
* giscanner/ast.py: Add deprecation attributes.
	* giscanner/girwriter.py: Write out deprecation data.
	* girepository/girparser.c: Relax parsing; deprecated
	attribute now includes freeform string.
	* giscanner/scannerlexer.l: Parse Deprecated.
	* giscanner/transformer.py: Look for deprecated attribute
	on functions.
	* tests/scanner/*: Add a Deprecated test.

svn path=/trunk/; revision=603
2008-09-15 14:46:19 +00:00
Colin Walters
7a55bd25d9 Write out and parse full GObject property information (readable, writable, etc)
* girepository/girparser.c: Default to "readable" for properties.
	* giscanner/ast.py: Add readable, writable etc.
	* giscanner/girwriter.py: Writ them.
	* giscanner/glibtransformer.py: Inspect them.
	* tests/*: Update.

svn path=/trunk/; revision=587
2008-09-08 22:24:09 +00:00
Colin Walters
8f09203dda Allow both union and struct to be boxed or not
* 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
	format.
	* 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
2008-09-06 20:33:51 +00:00
Colin Walters
71473eb033 Look in c:type to determine pointer nature
* girepository/girparser.c: Look at c:type to determine
	whether or not an item is a pointer.

svn path=/trunk/; revision=571
2008-09-01 18:52:34 +00:00
Colin Walters
ae48f17999 Don't lose if we have no includedirs
* girepository/girparser.c: Don't lose if we
	have no includedirs

svn path=/trunk/; revision=551
2008-08-31 16:01:02 +00:00
Colin Walters
dcd4fe622a Add back unresolved
svn path=/trunk/; revision=545
2008-08-30 20:31:16 +00:00
Colin Walters
5a14ec555c Fix conflict
svn path=/trunk/; revision=544
2008-08-30 20:31:14 +00:00
Colin Walters
74651b01bd Remove g_irepository_unregister, add GIRepositoryLoadFlags
svn path=/trunk/; revision=543
2008-08-30 20:31:12 +00:00
Colin Walters
e6a68106a2 Don't lose on NULL shlib
svn path=/trunk/; revision=542
2008-08-30 20:31:10 +00:00
Colin Walters
6e656b4498 Put dependencies in typelibs, resolve them when loading
* gir/Makefile.am: Dep on Makefile
	* girepository/ginfo.c: Print out a nicer error
	message if we failed to load something.
	* girepository/girepository.c: Clean up
	default typelib handling; remove global
	default_typelib variable.  Ensure we handle
	NULL repository in more places.
	Support dependency resolution.
	* tests/Makefile.am: Kill off gobject.gir,
	it conflicts with the real one.
	* tests/Object.gir: Depend on GObject.
	* tools/generate.c: Take --includedir
	argument to say which directories to search
	for typelibs.  Print out dependencies.

svn path=/trunk/; revision=541
2008-08-30 20:31:07 +00:00
Colin Walters
2ee1470611 Add some assertions, blacklist a few more methods
* girepository/ginfo.c: Add some assertions regarding
	refcounts, just to be sure.
	* giscanner/glibtransformer.py: Blacklist a few more
	odd Gio methods.

svn path=/trunk/; revision=537
2008-08-30 02:31:53 +00:00