From: DongHun Kwak Date: Tue, 11 Jul 2017 23:37:35 +0000 (+0900) Subject: Imported Upstream version 2.90.4 X-Git-Tag: upstream/3.9.92~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c716c24c89f4229ba1dd2859df94827d8c935c8;p=platform%2Fupstream%2Fpygobject2.git Imported Upstream version 2.90.4 Change-Id: Ib8f95df396c1690e019c961142cb5fc6de1b394c Signed-off-by: DongHun Kwak --- diff --git a/ChangeLog b/ChangeLog index 13594e4..6e84e2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,598 @@ +commit 3ec4020205e909ee4400650434f9ae7b89c2bde8 +Author: John (J5) Palmieri +Date: Thu Sep 15 18:12:01 2011 -0400 + + edit HACKING file to show correct tag format + + HACKING | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 2e864fd05bc0adf48df9f65ab72785ebb1d0d3f0 +Author: John (J5) Palmieri +Date: Thu Sep 15 18:10:33 2011 -0400 + + update NEWS file to prep for release + + NEWS | 35 +++++++++++++++++++++++++++++++++++ + 1 files changed, 35 insertions(+), 0 deletions(-) + +commit 0da687fa699aba4f42c42a924d6754e2bd47df50 +Author: John (J5) Palmieri +Date: Thu Sep 15 17:59:31 2011 -0400 + + fix typo s/lenth/length + + gi/overrides/Gtk.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 0e4861abaff64d8e7e8d1aeedf9dd1e80de8aab2 +Author: John (J5) Palmieri +Date: Thu Sep 15 17:48:58 2011 -0400 + + fix typo in docstring + + gi/_gobject/propertyhelper.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit e7fcc326d64def610e5a1003cf6c7ca97023814d +Author: John (J5) Palmieri +Date: Thu Sep 15 17:46:46 2011 -0400 + + do not pass in len(str) to the length argument of + gtk_test_buffer_insert* apis + + * in python 3 len(str) returns the number of characters while + the length + parameter is expecting the number of bytes. It also excepts -1 + for null + terminated string. Since all of our strings are null terminated, + just + set length to that. + + gi/overrides/Gtk.py | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +commit 6f380153afb3390f7da9f4b8befb1c4ee224da17 +Author: Dieter Verfaillie +Date: Mon Sep 12 21:07:20 2011 +0200 + + Switch tarball compression format to tar.xz only. + + See + http://mail.gnome.org/archives/gnome-announce-list/2011-September/msg00031.html + for more information. + + https://bugzilla.gnome.org/show_bug.cgi?id=659140 + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 11c45ac6dcb6ffad766d03bfc77f45a6d703a90d +Author: Dieter Verfaillie +Date: Thu Sep 15 14:18:57 2011 +0200 + + Remove pygtk_version attribute from internal gi._gobject module. + + This used to be provided for backwards compatibility with older PyGTK + versions. As PyGObject3 no longer provides support for static bindings + like PyGTK, the pygtk_version attribute has become obsolete. + + https://bugzilla.gnome.org/show_bug.cgi?id=659142 + + gi/_gobject/gobjectmodule.c | 4 ---- + gi/_gobject/pygobject.h | 2 -- + 2 files changed, 0 insertions(+), 6 deletions(-) + +commit 7e48fd6dfd86b7082c3fd35d25d9693c56c9665a +Author: John (J5) Palmieri +Date: Thu Sep 15 15:52:18 2011 -0400 + + remove overridesdir from the .pc file and add it to the gi module + + * having the variable in the .pc file caused issues parallel + installing + for different versions of python + * putting it into the module allows us to give the correct directory + based on which version of python you run the script from + * access the var as such: + import gi + installdir = gi._overridesdir + + gi/__init__.py | 2 ++ + pygobject-3.0.pc.in | 10 +++++++++- + 2 files changed, 11 insertions(+), 1 deletions(-) + +commit beea7072a5a989be47a755ac46647380d4dbd6b4 +Author: John (J5) Palmieri +Date: Thu Sep 15 00:11:09 2011 -0400 + + fix tests to correctly construct a dummy Gtk.TargetEntry + + * structs are sometimes a pain in gi. Simply constructing them + using the + the standard constructor (e.g. Gtk.TargetEntry()) will malloc + the struct + but not correctly initialize the fields which can cause a crash. + * tests didn't crash before because they were sending in bogus + data that + somehow did not trigger the issue + * now with the C struct array marshallers doing the right thing, + the incorrect + use of TargetEntry was causing a crash + + https://bugzilla.gnome.org/show_bug.cgi?id=627236 + + tests/test_overrides.py | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 46ba7f04ef3df08e07ddda5c10f0c98bec5fa183 +Author: John (J5) Palmieri +Date: Thu Sep 15 00:08:31 2011 -0400 + + we now assume that C arrays of structs are flat so memcpy them + when marshalling + + * there is no way in GI to tell if a C array is flat or an array + of pointers + so we assume that all arrays of simple structs and gvalues are + flat and + all arrays of objects and boxed structs are pointer arrays. + * this will be removed once GI gets the ability to annotate level + of indirection + for arrays + https://bugzilla.gnome.org/show_bug.cgi?id=627236 + + gi/pygi-marshal-from-py.c | 35 ++++++++++++++++++++++++++++++++--- + tests/test_gi.py | 29 +++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+), 3 deletions(-) + +commit e30a41592baa942188574e5c9f99572963e2e387 +Author: John (J5) Palmieri +Date: Thu Sep 15 00:02:34 2011 -0400 + + only update the arg counts once if child arg comes before parent arg + + * if the child arg comes before the parent arg we need to update the + argument counts and take the child arg out of the marshalling lists + since it is handled by the parent + * when two parents reference the same child arg as is the case with + two arrays which have a single length argument we only want + to update + the count once + * to do this we introduce the PYGI_META_ARG_CHILD_NEEDS_UPDATE + meta type + and only do the count update if this is set + * APIs should keep in mind that this take extra processing so + child args + should really come after their parents + + https://bugzilla.gnome.org/show_bug.cgi?id=627236 + + gi/pygi-cache.c | 30 ++++++++++++++++++++---------- + gi/pygi-cache.h | 9 +++++++-- + 2 files changed, 27 insertions(+), 12 deletions(-) + +commit f6fa5dd8f39af1b8a52d7600d257400b0983e8c5 +Author: John (J5) Palmieri +Date: Wed Sep 14 20:26:15 2011 -0400 + + Fix refcount bug by not creating python wrapper during gobject + init stage + + * This only applys to python subclasses of GObject which are + instantiated + using GObject.new + * Because we were creating the wrapper when the gobject is + initialized + and then again calling pygobject_new_full the wrapper would get + ref'ed twice. + * we could not simply Py_DECREF the wrapper due to the fact that + non-subclassed objects (e.g. GObject.Object) instantiated via + new do not run the same initialization code and would not have the + extra ref + * solution was to simply not create the wrapper during initialization + because if it doesn't exist when pygobject_new_full is called + it gets created and registered there + * move the call to __init__ into pyg_object_new + + https://bugzilla.gnome.org/show_bug.cgi?id=657403 + + gi/_gobject/gobjectmodule.c | 32 +++++++++++++++----------------- + 1 files changed, 15 insertions(+), 17 deletions(-) + +commit 61b64a65beee9011f8e4ed20f0a83e6630ba154f +Author: John (J5) Palmieri +Date: Tue Sep 13 18:08:04 2011 -0400 + + don't destroy just created wrapper when object is created via + g_object_new + + https://bugzilla.gnome.org/show_bug.cgi?id=657403 + + gi/_gobject/gobjectmodule.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 93e12cc2eb7e7f2c18971da86e9c9452d3f566b7 +Author: Steve Frécinaux +Date: Fri Aug 26 11:22:09 2011 +0200 + + Remove deprecated API from pygobject.h + + https://bugzilla.gnome.org/show_bug.cgi?id=657416 + + gi/_gobject/pygobject.h | 19 +------------------ + 1 files changed, 1 insertions(+), 18 deletions(-) + +commit e1c71092af6e2cffa36248519adfceac1874051d +Author: Marcin Owsiany +Date: Wed Aug 31 09:43:28 2011 +0100 + + Convert gtk.TRUE/FALSE to Python True/False. + + https://bugzilla.gnome.org/show_bug.cgi?id=657785 + + pygi-convert.sh | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 3ace5c2e2268285a5dcb39889fcb2a71bc1063bd +Author: Steve Frécinaux +Date: Fri Sep 2 08:37:15 2011 +0200 + + Drop legacy __gobject_init__ method of GObject.Object. + + This method was used in gobject initialization at some point, but now + using GObject.__init__() is sufficient, so let's not keep this old + method around and let people misuse it. + + https://bugzilla.gnome.org/show_bug.cgi?id=658032 + + examples/signal.py | 2 -- + gi/_gobject/pygobject.c | 11 ----------- + 2 files changed, 0 insertions(+), 13 deletions(-) + +commit fcd457d1d1d8a813acb2ebfe5ee0e9aab2c9c88c +Author: Dieter Verfaillie +Date: Tue Sep 13 12:05:30 2011 +0200 + + AM_CHECK_PYTHON_LIBS does not work for lib64 + + But on Windows, Python extension modules need to be explicitly + linked to libpython. + + https://bugzilla.gnome.org/show_bug.cgi?id=658856 + + configure.ac | 4 +++- + gi/Makefile.am | 9 ++++++--- + gi/_glib/Makefile.am | 10 ++++++++-- + gi/_gobject/Makefile.am | 8 +++++++- + 4 files changed, 24 insertions(+), 7 deletions(-) + +commit 863c087911203a8f3ebaa8e77622a3437a7cd320 +Author: Dieter Verfaillie +Date: Mon Sep 12 23:03:05 2011 +0200 + + Remove common_ldflags from Makefile.am as it is no longer used. + + https://bugzilla.gnome.org/show_bug.cgi?id=658856 + + Makefile.am | 6 ------ + 1 files changed, 0 insertions(+), 6 deletions(-) + +commit 24b920f9922e367bdb8b3e56c2f61e0c8f5cdb66 +Author: John (J5) Palmieri +Date: Tue Sep 13 16:20:48 2011 -0400 + + cast params for PyObject_IsInstance to suppress warnings + + gi/_gobject/pygobject-private.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit 861369ec59b17f67151813dc2e87c6e86126b954 +Author: John (J5) Palmieri +Date: Tue Sep 13 16:04:31 2011 -0400 + + check if object is actually a PyGFlag before trying to access g_type + + * we are lucky this bit of code worked for as long as it did but when + checking if an object is a PyGFlag we can't just rely on looking + at the g_type field because if a regular gobject is passed in + as is the case when you compare a long to a gflag, the gobject + will not have a g_type field. Accessing a non-existant field + could at best give you a false positive and at worse read + memory beyond the bounds of the actual structure passed in + + gi/_gobject/pygobject-private.h | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +commit eea93e89fb064253bd8903c8b453daf4b3c87c2c +Author: John (J5) Palmieri +Date: Tue Sep 13 16:03:02 2011 -0400 + + fix regression - add instance type checks since Py3 no longer does + this for us + + gi/pygi-marshal-from-py.c | 21 +++++++++++++++++++-- + 1 files changed, 19 insertions(+), 2 deletions(-) + +commit a4e4318b50a24a688e32579273fbcfa51d1b422a +Author: John (J5) Palmieri +Date: Fri Sep 2 18:39:51 2011 -0400 + + refactor in/out marshalling to be to_py/from_py + + * in/out make sense from a C perspective but when you get to the + python layers it makes more sense to label them as to_py and + from_py to denote which way we are marshalling + * this helps clear up the difference between callbacks which + call into python and invoked functions which call into C + * in the callback case we marshal in values to Python objects + and out values to C types but in the invoke case we do the + reverse. Dealing with to_py/from_py makes the code much more + resuable and consistant + + https://bugzilla.gnome.org/show_bug.cgi?id=658362 + + gi/Makefile.am | 8 +- + gi/pygi-cache.c | 673 +++++++++++----------- + gi/pygi-cache.h | 62 ++- + gi/pygi-invoke.c | 144 +++--- + gi/pygi-marshal-cleanup.c | 168 +++--- + gi/pygi-marshal-cleanup.h | 128 ++-- + gi/pygi-marshal-from-py.c | 1412 + +++++++++++++++++++++++++++++++++++++++++++++ + gi/pygi-marshal-from-py.h | 186 ++++++ + gi/pygi-marshal-in.c | 1412 + --------------------------------------------- + gi/pygi-marshal-in.h | 186 ------ + gi/pygi-marshal-out.c | 768 ------------------------ + gi/pygi-marshal-out.h | 144 ----- + gi/pygi-marshal-to-py.c | 768 ++++++++++++++++++++++++ + gi/pygi-marshal-to-py.h | 144 +++++ + 14 files changed, 3122 insertions(+), 3081 deletions(-) + +commit 45b0fcff9e948c65a3903c32a3957802034c5e47 +Author: Dieter Verfaillie +Date: Fri Sep 9 16:50:25 2011 +0200 + + Examples: fix cairo-demo.py imports + + examples/cairo-demo.py | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +commit 3ca19fc13e6024fd04851e6f269020a92b09fa17 +Author: Dieter Verfaillie +Date: Fri Sep 9 15:08:27 2011 +0200 + + Fix paths and add missing overridesdir variable used in uninstalled + pkgconfig file + + https://bugzilla.gnome.org/show_bug.cgi?id=658654 + + pygobject-3.0-uninstalled.pc.in | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +commit 6e773175b9d2f46b3df5075ec952a8c5aff3c607 +Author: Dieter Verfaillie +Date: Fri Sep 9 15:08:04 2011 +0200 + + Remove no longer used variables from pkgconfig files + + https://bugzilla.gnome.org/show_bug.cgi?id=658654 + + pygobject-3.0-uninstalled.pc.in | 6 ------ + pygobject-3.0.pc.in | 5 +---- + 2 files changed, 1 insertions(+), 10 deletions(-) + +commit 81d388780311311d8dc4a027a59d114edf9a00fc +Author: Dieter Verfaillie +Date: Fri Sep 9 14:57:58 2011 +0200 + + docs/Makefile.am and m4/python.m4: Python3 portability fixes + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + docs/Makefile.am | 2 +- + m4/python.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7e692ee061406e48e4862b98a0829650b1d6d585 +Author: Dieter Verfaillie +Date: Fri Sep 9 14:57:46 2011 +0200 + + Refactor and clean Makefile.am files + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + Makefile.am | 2 - + gi/Makefile.am | 81 ++++++++++++++++++++++-------------- + gi/_glib/Makefile.am | 100 + +++++++++++++++++++++++++++++---------------- + gi/_gobject/Makefile.am | 85 ++++++++++++++++++++------------------ + gi/overrides/Makefile.am | 4 +- + gi/repository/Makefile.am | 4 +- + 6 files changed, 162 insertions(+), 114 deletions(-) + +commit 3dd59b07d1f4a93ee1f65d6a64e1afb6f5e84232 +Author: Dieter Verfaillie +Date: Fri Sep 9 14:57:36 2011 +0200 + + Remove all PLATFORM_VERSION = 2.0 traces + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + gi/Makefile.am | 2 -- + gi/overrides/Makefile.am | 1 - + gi/repository/Makefile.am | 1 - + 3 files changed, 0 insertions(+), 4 deletions(-) + +commit db1e484bfa157967de55ee2e0e18a82b8e388b61 +Author: Dieter Verfaillie +Date: Fri Sep 9 14:57:25 2011 +0200 + + Remove gi/tests/ directory as all the tests now live in tests/ + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + gi/tests/Makefile.am | 24 ------------------------ + gi/tests/runtests.py | 21 --------------------- + 2 files changed, 0 insertions(+), 45 deletions(-) + +commit b0ecbf00138ef1147e478ebf3c66f0e9b3f85dfc +Author: Dieter Verfaillie +Date: Fri Sep 9 14:55:25 2011 +0200 + + autogen.sh: Use autoreconf instead of a custom script and honor + ACLOCAL_FLAGS + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + Makefile.am | 2 +- + autogen.sh | 95 + +++++++---------------------------------------------------- + 2 files changed, 12 insertions(+), 85 deletions(-) + +commit 4671f5397003f376f00830e3fd1c214de594619f +Author: Dieter Verfaillie +Date: Fri Sep 9 14:55:01 2011 +0200 + + use improved python.m4 macros to search for Python headers and libs + + https://bugzilla.gnome.org/show_bug.cgi?id=658652 + + configure.ac | 3 ++- + m4/python.m4 | 47 +++++++++++++++++++++++++++++++++++++---------- + 2 files changed, 39 insertions(+), 11 deletions(-) + +commit 2c9fd09da196d35db968bff4ae63fcce2d891e69 +Author: Javier Jardón +Date: Fri Sep 9 15:38:22 2011 +0100 + + Make maintiner mode enabled by default + + See + http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/ + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit b24dcb415406668931e02a1f669ef9861bb3a660 +Author: Dieter Verfaillie +Date: Wed Aug 24 09:58:10 2011 +0200 + + Disable documentation for now since they are completely wrong for GI. + + https://bugzilla.gnome.org/show_bug.cgi?id=657054 + + Makefile.am | 2 +- + configure.ac | 25 ------------------------- + 2 files changed, 1 insertions(+), 26 deletions(-) + +commit ecea2358a379c8ff44dff2f8f9c30a9092af1681 +Author: Dieter Verfaillie +Date: Wed Sep 7 10:38:28 2011 +0200 + + Fix documentation installation directory + + https://bugzilla.gnome.org/show_bug.cgi?id=657054 + + docs/Makefile.am | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +commit 8d3125c8ce9890c70400dd8a3ac273b590fe6a31 +Author: Dieter Verfaillie +Date: Tue Sep 6 22:22:11 2011 +0200 + + Remove distutils based build system. + + The only reason this might be brought back to life again is when + the whole stack can be built with Visual Studio (including + gobject-introspection) again. Building with MinGW/MSYS can now + be done with the usual autogen.sh/configure/make/make install dance. + + https://bugzilla.gnome.org/show_bug.cgi?id=657054 + + MANIFEST.in | 7 - + Makefile.am | 25 +-- + README.win32 | 21 -- + dsextras.py | 509 + ---------------------------------------------- + pygobject_postinstall.py | 9 - + setup.py | 351 -------------------------------- + 6 files changed, 7 insertions(+), 915 deletions(-) + +commit b82d916635aa0b732840548088a3fcfcb2e41bc4 +Author: Dieter Verfaillie +Date: Wed Sep 7 10:40:36 2011 +0200 + + [gtk-demo] Fix syntax highlighter encoding issue + + With Python 3, Gtk.TextBuffer.get_text returns a str (not bytes), with + Python 2 however we get a str (not unicode). So with Python 2 the + tokenizer returned bogus data when ran over a demo that contains real + UTF-8 codepoints (like rotatedtext.py for example). + + This patch thus fixes the "Gtk-CRITICAL **: + gtk_text_iter_set_line_offset: + assertion `char_on_line <= chars_in_line` failed" assertions when + selecting + the rotated text demo in the treeview. + + demos/gtk-demo/gtk-demo.py | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 31db3ed3d233bd495c3a2f99b3fa51031bfa30c6 +Author: Ignacio Casal Quinteiro +Date: Tue Sep 6 22:13:54 2011 +0200 + + overrides: add constants for atoms + + gi/overrides/Gdk.py | 49 + +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 49 insertions(+), 0 deletions(-) + +commit 81861bc2d664eb38d46e5c38ff755d436f040f63 +Author: Steve Frécinaux +Date: Wed Aug 31 14:18:56 2011 +0200 + + Drop pygobject_construct() from public API. + + These functions were introduced in 2005 because python objects + could not + "just" be instantiated using g_object_new(), but this is not true + anymore since the introduction of new-style constructors. Hence + this API + has no reason to be there anymore. + + Nowadays, people who want to construct GObjects defined in python + should + just use g_object_new(). + + https://bugzilla.gnome.org/show_bug.cgi?id=657814 + + gi/_gobject/gobjectmodule.c | 118 + +++++++++------------------------------ + gi/_gobject/pygobject-private.h | 3 - + gi/_gobject/pygobject.h | 8 --- + 3 files changed, 26 insertions(+), 103 deletions(-) + +commit c4c55a98ccf9e39ed0d10ed49b66a76dc7d7c509 +Author: Ignacio Casal Quinteiro +Date: Wed Aug 31 18:00:44 2011 +0200 + + post release version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit ac5a0f46242abdd3cd98ec5f9f2bf8e5b05f3845 +Author: Ignacio Casal Quinteiro +Date: Wed Aug 31 17:58:37 2011 +0200 + + Release 2.90.3 + + NEWS | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + commit 429569abddada5a3bad554de707ddf35b349936e Author: John (J5) Palmieri Date: Thu Aug 25 13:57:53 2011 -0400 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 3781c83..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include ChangeLog AUTHORS COPYING NEWS README HACKING -include MANIFEST.in -include gobject/pygobject.h gobject/pygobject-private.h -include pygtk.py pygobject-2.0.pc.in -include dsextras.py -recursive-include examples *.py -global-exclude */CVS/* .cvsignore diff --git a/Makefile.am b/Makefile.am index 3b8b6fe..17cfc71 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,23 +1,18 @@ -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs examples gi tests +SUBDIRS = examples gi tests PLATFORM_VERSION = 3.0 CLEANFILES = -EXTRA_DIST = \ - MANIFEST.in \ - README.win32 \ +EXTRA_DIST = \ + ChangeLog.pre-2.18 \ pygobject-$(PLATFORM_VERSION).pc.in \ - PKG-INFO \ - PKG-INFO.in \ - setup.py \ - pygobject_postinstall.py \ - dsextras.py \ - ChangeLog.pre-2.18 \ - m4/as-ac-expand.m4 \ - m4/jhflags.m4 \ + PKG-INFO \ + PKG-INFO.in \ + m4/as-ac-expand.m4 \ + m4/jhflags.m4 \ m4/python.m4 MAINTAINERCLEANFILES = \ @@ -50,26 +45,13 @@ MAINTAINERCLEANFILES = \ BUILT_EXTRA_DIST = \ ChangeLog -INCLUDES = -I$(top_srcdir)/gobject $(PYTHON_INCLUDES) $(GLIB_CFLAGS) - # pkg-config files pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc -# python modules -pkgpyexecdir = $(pyexecdir)/gtk-2.0 -pkgpyexec_PYTHON = dsextras.py -pkgpyexec_LTLIBRARIES = - # python pyexec_LTLIBRARIES = -# linker flags -common_ldflags = -module -avoid-version -if PLATFORM_WIN32 -common_ldflags += -no-undefined -endif - # install pth file. install-data-local: $(mkinstalldirs) $(DESTDIR)$(pythondir) @@ -86,11 +68,10 @@ egg: $(top_srcdir)/gobject/gobject.la PKG-INFO $(MKDIR_P) $(EGG_TMPDIR) $(MKDIR_P) $(EGG_TMPDIR)/EGG-INFO $(MAKE) -C gobject install-pkgpyexecLTLIBRARIES pkgpyexecdir=$(EGG_TMPDIR) - $(INSTALL) dsextras.py $(EGG_TMPDIR) rm -fr $(EGG_TMPDIR)/gobject.la $(INSTALL) PKG-INFO $(EGG_TMPDIR)/EGG-INFO echo "gobject.so" >> $(EGG_TMPDIR)/EGG-INFO/native_libs.txt - ( echo "gobject" ; echo "dsextras.py" ) >> $(EGG_TMPDIR)/EGG-INFO/top_level.txt + ( echo "gobject" ) >> $(EGG_TMPDIR)/EGG-INFO/top_level.txt cd $(EGG_TMPDIR) && zip -rq $(EGG_NAME) . mv $(EGG_TMPDIR)/$(EGG_NAME) . rm -fr $(EGG_TMPDIR) diff --git a/Makefile.in b/Makefile.in index 1637831..9606f5d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,17 +35,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined subdir = . -DIST_COMMON = README $(am__configure_deps) $(pkgpyexec_PYTHON) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/PKG-INFO.in $(srcdir)/config.h.in \ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/PKG-INFO.in \ + $(srcdir)/config.h.in \ $(srcdir)/pygobject-3.0-uninstalled.pc.in \ - $(srcdir)/pygobject-3.0.pc.in $(top_srcdir)/configure \ - $(top_srcdir)/docs/reference/entities.docbook.in \ - $(top_srcdir)/docs/xsl/fixxref.py.in AUTHORS COPYING ChangeLog \ - INSTALL NEWS compile config.guess config.sub depcomp \ - install-sh ltmain.sh missing py-compile + $(srcdir)/pygobject-3.0.pc.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS compile config.guess config.sub \ + depcomp install-sh ltmain.sh missing py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -59,7 +56,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = pygobject-3.0.pc pygobject-3.0-uninstalled.pc \ - docs/reference/entities.docbook docs/xsl/fixxref.py PKG-INFO + PKG-INFO CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -82,9 +79,8 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" \ - "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pkgconfigdir)" -LTLIBRARIES = $(pkgpyexec_LTLIBRARIES) $(pyexec_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(pyexec_LTLIBRARIES) AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; @@ -100,7 +96,6 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive -py_compile = $(top_srcdir)/py-compile DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -142,12 +137,12 @@ am__relativize = \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -234,6 +229,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -244,7 +241,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -286,9 +282,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ - -# python modules -pkgpyexecdir = $(pyexecdir)/gtk-2.0 +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -304,21 +298,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 -SUBDIRS = docs examples gi tests +SUBDIRS = examples gi tests PLATFORM_VERSION = 3.0 CLEANFILES = EXTRA_DIST = \ - MANIFEST.in \ - README.win32 \ + ChangeLog.pre-2.18 \ pygobject-$(PLATFORM_VERSION).pc.in \ - PKG-INFO \ - PKG-INFO.in \ - setup.py \ - pygobject_postinstall.py \ - dsextras.py \ - ChangeLog.pre-2.18 \ - m4/as-ac-expand.m4 \ - m4/jhflags.m4 \ + PKG-INFO \ + PKG-INFO.in \ + m4/as-ac-expand.m4 \ + m4/jhflags.m4 \ m4/python.m4 MAINTAINERCLEANFILES = \ @@ -351,19 +340,13 @@ MAINTAINERCLEANFILES = \ BUILT_EXTRA_DIST = \ ChangeLog -INCLUDES = -I$(top_srcdir)/gobject $(PYTHON_INCLUDES) $(GLIB_CFLAGS) # pkg-config files pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc -pkgpyexec_PYTHON = dsextras.py -pkgpyexec_LTLIBRARIES = # python pyexec_LTLIBRARIES = - -# linker flags -common_ldflags = -module -avoid-version $(am__append_1) EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)-$(PLATFORM).egg all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -424,43 +407,8 @@ pygobject-3.0.pc: $(top_builddir)/config.status $(srcdir)/pygobject-3.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pygobject-3.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/pygobject-3.0-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ -docs/reference/entities.docbook: $(top_builddir)/config.status $(top_srcdir)/docs/reference/entities.docbook.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -docs/xsl/fixxref.py: $(top_builddir)/config.status $(top_srcdir)/docs/xsl/fixxref.py.in - cd $(top_builddir) && $(SHELL) ./config.status $@ PKG-INFO: $(top_builddir)/config.status $(srcdir)/PKG-INFO.in cd $(top_builddir) && $(SHELL) ./config.status $@ -install-pkgpyexecLTLIBRARIES: $(pkgpyexec_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkgpyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpyexecdir)" - @list='$(pkgpyexec_LTLIBRARIES)'; test -n "$(pkgpyexecdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgpyexecdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgpyexecdir)"; \ - } - -uninstall-pkgpyexecLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkgpyexec_LTLIBRARIES)'; test -n "$(pkgpyexecdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgpyexecdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgpyexecdir)/$$f"; \ - done - -clean-pkgpyexecLTLIBRARIES: - -test -z "$(pkgpyexec_LTLIBRARIES)" || rm -f $(pkgpyexec_LTLIBRARIES) - @list='$(pkgpyexec_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" @@ -501,44 +449,6 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt -install-pkgpyexecPYTHON: $(pkgpyexec_PYTHON) - @$(NORMAL_INSTALL) - test -z "$(pkgpyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpyexecdir)" - @list='$(pkgpyexec_PYTHON)'; dlist=; list2=; test -n "$(pkgpyexecdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ - if test -f $$b$$p; then \ - $(am__strip_dir) \ - dlist="$$dlist $$f"; \ - list2="$$list2 $$b$$p"; \ - else :; fi; \ - done; \ - for file in $$list2; do echo $$file; done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgpyexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgpyexecdir)" || exit $$?; \ - done || exit $$?; \ - if test -n "$$dlist"; then \ - if test -z "$(DESTDIR)"; then \ - PYTHON=$(PYTHON) $(py_compile) --basedir "$(pkgpyexecdir)" $$dlist; \ - else \ - PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pkgpyexecdir)" $$dlist; \ - fi; \ - else :; fi - -uninstall-pkgpyexecPYTHON: - @$(NORMAL_UNINSTALL) - @list='$(pkgpyexec_PYTHON)'; test -n "$(pkgpyexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - fileso=`echo "$$files" | sed 's|$$|o|'`; \ - echo " ( cd '$(DESTDIR)$(pkgpyexecdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgpyexecdir)" && rm -f $$files || exit $$?; \ - echo " ( cd '$(DESTDIR)$(pkgpyexecdir)' && rm -f" $$filesc ")"; \ - cd "$(DESTDIR)$(pkgpyexecdir)" && rm -f $$filesc || exit $$?; \ - echo " ( cd '$(DESTDIR)$(pkgpyexecdir)' && rm -f" $$fileso ")"; \ - cd "$(DESTDIR)$(pkgpyexecdir)" && rm -f $$fileso install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @@ -776,7 +686,6 @@ dist-bzip2: distdir dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) @@ -795,7 +704,7 @@ dist-zip: distdir $(am__remove_distdir) dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then @@ -878,7 +787,7 @@ check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -910,8 +819,8 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic clean-libtool clean-pkgpyexecLTLIBRARIES \ - clean-pyexecLTLIBRARIES mostlyclean-am +clean-am: clean-generic clean-libtool clean-pyexecLTLIBRARIES \ + mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -937,8 +846,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-exec-local install-pkgpyexecLTLIBRARIES \ - install-pkgpyexecPYTHON install-pyexecLTLIBRARIES +install-exec-am: install-exec-local install-pyexecLTLIBRARIES install-html: install-html-recursive @@ -979,7 +887,6 @@ ps: ps-recursive ps-am: uninstall-am: uninstall-local uninstall-pkgconfigDATA \ - uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ uninstall-pyexecLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ @@ -987,26 +894,23 @@ uninstall-am: uninstall-local uninstall-pkgconfigDATA \ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ - clean-libtool clean-pkgpyexecLTLIBRARIES \ - clean-pyexecLTLIBRARIES ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-local distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-local install-html \ + clean-libtool clean-pyexecLTLIBRARIES ctags ctags-recursive \ + dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzma \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-local distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA \ - install-pkgpyexecLTLIBRARIES install-pkgpyexecPYTHON \ - install-ps install-ps-am install-pyexecLTLIBRARIES \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-local uninstall-pkgconfigDATA \ - uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ - uninstall-pyexecLTLIBRARIES + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-pyexecLTLIBRARIES install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-local \ + uninstall-pkgconfigDATA uninstall-pyexecLTLIBRARIES # install pth file. @@ -1023,11 +927,10 @@ egg: $(top_srcdir)/gobject/gobject.la PKG-INFO $(MKDIR_P) $(EGG_TMPDIR) $(MKDIR_P) $(EGG_TMPDIR)/EGG-INFO $(MAKE) -C gobject install-pkgpyexecLTLIBRARIES pkgpyexecdir=$(EGG_TMPDIR) - $(INSTALL) dsextras.py $(EGG_TMPDIR) rm -fr $(EGG_TMPDIR)/gobject.la $(INSTALL) PKG-INFO $(EGG_TMPDIR)/EGG-INFO echo "gobject.so" >> $(EGG_TMPDIR)/EGG-INFO/native_libs.txt - ( echo "gobject" ; echo "dsextras.py" ) >> $(EGG_TMPDIR)/EGG-INFO/top_level.txt + ( echo "gobject" ) >> $(EGG_TMPDIR)/EGG-INFO/top_level.txt cd $(EGG_TMPDIR) && zip -rq $(EGG_NAME) . mv $(EGG_TMPDIR)/$(EGG_NAME) . rm -fr $(EGG_TMPDIR) diff --git a/NEWS b/NEWS index 0bebcaa..58eaed1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,38 @@ +2.90.4 15-Sep-2011 (3.0 pre-release) + - do not pass in len(str) to the length argument of gtk_test_buffer_insert* apis (John (J5) Palmieri) + - Switch tarball compression format to tar.xz only. (Dieter Verfaillie) + - Remove pygtk_version attribute from internal gi._gobject module. (Dieter Verfaillie) + - remove overridesdir from the .pc file and add it to the gi module (John (J5) Palmieri) + - fix tests to correctly construct a dummy Gtk.TargetEntry (John (J5) Palmieri) + - we now assume that C arrays of structs are flat so memcpy them when marshalling (John (J5) Palmieri) + - only update the arg counts once if child arg comes before parent arg (John (J5) Palmieri) + - Fix refcount bug by not creating python wrapper during gobject init stage (John (J5) Palmieri) + - don't destroy just created wrapper when object is created via g_object_new (John (J5) Palmieri) + - Remove deprecated API from pygobject.h (Steve Frécinaux) + - Convert gtk.TRUE/FALSE to Python True/False. (Marcin Owsiany) + - Drop legacy __gobject_init__ method of GObject.Object. (Steve Frécinaux) + - AM_CHECK_PYTHON_LIBS does not work for lib64 (Dieter Verfaillie) + - Remove common_ldflags from Makefile.am as it is no longer used. (Dieter Verfaillie) + - check if object is actually a PyGFlag before trying to access g_type (John (J5) Palmieri) + - fix regression - add instance type checks since Py3 no longer does this for us (John (J5) Palmieri) + - refactor in/out marshalling to be to_py/from_py (John (J5) Palmieri) + - Examples: fix cairo-demo.py imports (Dieter Verfaillie) + - Fix paths and add missing overridesdir variable used in uninstalled pkgconfig file (Dieter Verfaillie) + - Remove no longer used variables from pkgconfig files (Dieter Verfaillie) + - docs/Makefile.am and m4/python.m4: Python3 portability fixes (Dieter Verfaillie) + - Refactor and clean Makefile.am files (Dieter Verfaillie) + - Remove all PLATFORM_VERSION = 2.0 traces (Dieter Verfaillie) + - Remove gi/tests/ directory as all the tests now live in tests/ (Dieter Verfaillie) + - autogen.sh: Use autoreconf instead of a custom script and honor ACLOCAL_FLAGS (Dieter Verfaillie) + - use improved python.m4 macros to search for Python headers and libs (Dieter Verfaillie) + - Make maintiner mode enabled by default (Javier Jardón) + - Disable documentation for now since they are completely wrong for GI. (Dieter Verfaillie) + - Fix documentation installation directory (Dieter Verfaillie) + - Remove distutils based build system. (Dieter Verfaillie) + - [gtk-demo] Fix syntax highlighter encoding issue (Dieter Verfaillie) + - overrides: add constants for atoms (Ignacio Casal Quinteiro) + - Drop pygobject_construct() from public API. (Steve Frécinaux) + 2.90.3 31-Aug-2011 (3.0 pre-release) - support skip annotation for return values (John (J5) Palmieri) - Test GPtrArray regression (Xavier Claessens) diff --git a/PKG-INFO b/PKG-INFO index 0c75472..1be4de1 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 2.90.3 +Version: 2.90.4 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,7 +8,7 @@ Author-email: james@daa.com.au Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.90/pygobject-2.90.3.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.90/pygobject-2.90.4.tar.gz Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable diff --git a/README.win32 b/README.win32 deleted file mode 100644 index 5819c8d..0000000 --- a/README.win32 +++ /dev/null @@ -1,21 +0,0 @@ -Windows Setuptools Build Instructions -====================================== - - 1. Install gtk+ bundle from gtk.org (to C:\GTK for example) - 2. Install Python2.6 - 3. Install MinGW and MSYS - 4. Add the following to your msys environment variables - (open and append to C:\msys\1.0\etc\profile) or set for the session - - $ export PATH=/c/GTK/bin:/c/Python26:/c/Python26/Scripts:$PATH - $ export PKG_CONFIG_PATH=/c/GTK/lib/pkgconfig:/c/Python26/Lib/pkgconfig:$PKG_CONFIG_PATH - - 5. In msys shell, build with - - $ python setup.py build --compiler=mingw32 --enable-threading bdist_wininst --user-access-control=auto - -Tested with - * gtk+-bundle_2.20.0-20100406_win32.zip - * MinGW-5.16.exe - * MSYS-1.0.11.exe - * python-2.6.5.exe diff --git a/aclocal.m4 b/aclocal.m4 index 9508e3e..93ea784 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -19,597 +19,227 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Configure paths for GLIB -# Owen Taylor 1997-2001 +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, -dnl gthread, or gio is specified in MODULES, pass to pkg-config -dnl -AC_DEFUN([AM_PATH_GLIB_2_0], -[dnl -dnl Get the cflags and libraries from pkg-config -dnl -AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], - , enable_glibtest=yes) +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) - pkg_config_args=glib-2.0 - for module in . $4 - do - case "$module" in - gmodule) - pkg_config_args="$pkg_config_args gmodule-2.0" - ;; - gmodule-no-export) - pkg_config_args="$pkg_config_args gmodule-no-export-2.0" - ;; - gobject) - pkg_config_args="$pkg_config_args gobject-2.0" - ;; - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - gio*) - pkg_config_args="$pkg_config_args $module-2.0" - ;; - esac - done +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) - PKG_PROG_PKG_CONFIG([0.16]) +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - no_glib="" +# AM_AUX_DIR_EXPAND -*- Autoconf -*- - if test "x$PKG_CONFIG" = x ; then - no_glib=yes - PKG_CONFIG=no - fi +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - min_glib_version=ifelse([$1], ,2.0.0,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" - enable_glibtest=no - fi +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) - if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then - : - else - no_glib=yes - fi - fi - if test x"$no_glib" = x ; then - GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` - GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` - GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` +# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. - GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` - GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` - glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of pkg-config to some extent) -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include -#include -#include +# serial 4 -int -main () -{ - unsigned int major, minor, micro; - char *tmp_version; +# This was merged into AC_PROG_CC in Autoconf. - fclose (fopen ("conf.glibtest", "w")); +AU_DEFUN([AM_PROG_CC_STDC], +[AC_PROG_CC +AC_DIAGNOSE([obsolete], [$0: + your code should no longer depend upon `am_cv_prog_cc_stdc', but upon + `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when + you adjust the code. You can also remove the above call to + AC_PROG_CC if you already called it elsewhere.]) +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc +]) +AU_DEFUN([fp_PROG_CC_STDC]) - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } +# AM_CONDITIONAL -*- Autoconf -*- - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://www.freedesktop.org/software/pkgconfig/" - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - GLIB_GENMARSHAL="" - GOBJECT_QUERY="" - GLIB_MKENUMS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - AC_SUBST(GLIB_GENMARSHAL) - AC_SUBST(GOBJECT_QUERY) - AC_SUBST(GLIB_MKENUMS) - rm -f conf.glibtest -]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. # -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) +# serial 9 -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. # -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG +# serial 10 -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. # -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT]) - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .]) - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - - -# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# This was merged into AC_PROG_CC in Autoconf. - -AU_DEFUN([AM_PROG_CC_STDC], -[AC_PROG_CC -AC_DIAGNOSE([obsolete], [$0: - your code should no longer depend upon `am_cv_prog_cc_stdc', but upon - `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when - you adjust the code. You can also remove the above call to - AC_PROG_CC if you already called it elsewhere.]) -am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc -]) -AU_DEFUN([fp_PROG_CC_STDC]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 10 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers @@ -1678,6 +1308,376 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT]) + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .]) + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Configure paths for GLIB +# Owen Taylor 1997-2001 + +dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, +dnl gthread, or gio is specified in MODULES, pass to pkg-config +dnl +AC_DEFUN([AM_PATH_GLIB_2_0], +[dnl +dnl Get the cflags and libraries from pkg-config +dnl +AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], + , enable_glibtest=yes) + + pkg_config_args=glib-2.0 + for module in . $4 + do + case "$module" in + gmodule) + pkg_config_args="$pkg_config_args gmodule-2.0" + ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; + gobject) + pkg_config_args="$pkg_config_args gobject-2.0" + ;; + gthread) + pkg_config_args="$pkg_config_args gthread-2.0" + ;; + gio*) + pkg_config_args="$pkg_config_args $module-2.0" + ;; + esac + done + + PKG_PROG_PKG_CONFIG([0.16]) + + no_glib="" + + if test "x$PKG_CONFIG" = x ; then + no_glib=yes + PKG_CONFIG=no + fi + + min_glib_version=ifelse([$1], ,2.0.0,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + + if test x$PKG_CONFIG != xno ; then + ## don't try to run the test against uninstalled libtool libs + if $PKG_CONFIG --uninstalled $pkg_config_args; then + echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" + enable_glibtest=no + fi + + if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then + : + else + no_glib=yes + fi + fi + + if test x"$no_glib" = x ; then + GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` + GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` + GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` + + GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` + GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` + glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" +dnl +dnl Now check if the installed GLIB is sufficiently new. (Also sanity +dnl checks the results of pkg-config to some extent) +dnl + rm -f conf.glibtest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + unsigned int major, minor, micro; + char *tmp_version; + + fclose (fopen ("conf.glibtest", "w")); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If pkg-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); + printf("*** to point to the correct configuration files\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); + printf("*** correct copy of pkg-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$PKG_CONFIG" = "no" ; then + echo "*** A new enough version of pkg-config was not found." + echo "*** See http://www.freedesktop.org/software/pkgconfig/" + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_GENMARSHAL) + AC_SUBST(GOBJECT_QUERY) + AC_SUBST(GLIB_MKENUMS) + rm -f conf.glibtest +]) + m4_include([m4/as-ac-expand.m4]) m4_include([m4/jhflags.m4]) m4_include([m4/libtool.m4]) diff --git a/configure b/configure index 30e0390..c1cdb38 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for pygobject 2.90.3. +# Generated by GNU Autoconf 2.68 for pygobject 2.90.4. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='2.90.3' -PACKAGE_STRING='pygobject 2.90.3' +PACKAGE_VERSION='2.90.4' +PACKAGE_STRING='pygobject 2.90.4' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='' @@ -644,10 +644,9 @@ PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG THREADING_CFLAGS -ENABLE_DOCS_FALSE -ENABLE_DOCS_TRUE -XSLTPROC PLATFORM +PYTHON_LIB_LOC +PYTHON_LIBS PYTHON_INCLUDES pkgpyexecdir pyexecdir @@ -793,7 +792,6 @@ with_gnu_ld with_sysroot enable_libtool_lock enable_thread -enable_docs enable_glibtest with_ffi enable_cairo @@ -1360,7 +1358,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pygobject 2.90.3 to adapt to many kinds of systems. +\`configure' configures pygobject 2.90.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1430,7 +1428,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 2.90.3:";; + short | recursive ) echo "Configuration of pygobject 2.90.4:";; esac cat <<\_ACEOF @@ -1440,7 +1438,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') - --enable-maintainer-mode enable make rules and dependencies not useful + --disable-maintainer-mode disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1450,7 +1448,6 @@ Optional Features: --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --disable-thread Disable pygobject threading support - --enable-docs Enable documentation building --disable-glibtest do not try to compile and run a test GLIB program --enable-cairo Enable Cairo bindings using introspection information @@ -1556,7 +1553,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 2.90.3 +pygobject configure 2.90.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1834,7 +1831,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pygobject $as_me 2.90.3, which was +It was created by pygobject $as_me 2.90.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2198,9 +2195,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 90" >>confdefs.h PYGOBJECT_MINOR_VERSION=90 -$as_echo "#define PYGOBJECT_MICRO_VERSION 3" >>confdefs.h +$as_echo "#define PYGOBJECT_MICRO_VERSION 4" >>confdefs.h -PYGOBJECT_MICRO_VERSION=3 +PYGOBJECT_MICRO_VERSION=4 ac_config_headers="$ac_config_headers config.h" @@ -2684,7 +2681,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='2.90.3' + VERSION='2.90.4' cat >>confdefs.h <<_ACEOF @@ -2725,13 +2722,13 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to disable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else - USE_MAINTAINER_MODE=no + USE_MAINTAINER_MODE=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 @@ -12020,7 +12017,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -pygobject config.lt 2.90.3 +pygobject config.lt 2.90.4 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -14916,16 +14913,18 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for headers required to compile python extensions" >&5 $as_echo_n "checking for headers required to compile python extensions... " >&6; } -py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -PYTHON_CONFIG=`which $PYTHON`-config -if test -x "$PYTHON_CONFIG"; then -PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` -else -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -fi +if test "x$PYTHON_INCLUDES" == x; then + PYTHON_CONFIG=`which $PYTHON`-config + if test -x "$PYTHON_CONFIG"; then + PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` + else + py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` + py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + fi fi save_CPPFLAGS="$CPPFLAGS" @@ -14941,11 +14940,56 @@ $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } -as_fn_error $? "could not find Python headers" "$LINENO" 5 +as_fn_error $? "Python headers not found" "$LINENO" 5 fi rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" +if test "x$os_win32" = "xyes"; then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libraries required to embed python" >&5 +$as_echo_n "checking for libraries required to embed python... " >&6; } +py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` +if test "x$PYTHON_LIBS" == x; then + PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" +fi +if test "x$PYTHON_LIB_LOC" == x; then + PYTHON_LIB_LOC="${py_prefix}/lib" +fi + + +save_LIBS="$LIBS" +LIBS="$LIBS $PYTHON_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Py_Initialize (); +int +main () +{ +return Py_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS="$save_LIBS"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + LIBS="$save_LIBS"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; as_fn_error $? "Python libs not found. Windows requires Python modules to be explicitly linked to libpython." "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PySignal_SetWakeupFd in Python.h" >&5 $as_echo_n "checking for PySignal_SetWakeupFd in Python.h... " >&6; } @@ -14988,69 +15032,6 @@ else fi -# Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then : - enableval=$enable_docs; enable_docs=$enableval -else - enable_docs=no -fi - -if test "${enable_docs}" != no; then - # Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XSLTPROC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test -z "$XSLTPROC"; then - enable_docs=no - fi - - fi - - if test x$enable_docs != xno; then - ENABLE_DOCS_TRUE= - ENABLE_DOCS_FALSE='#' -else - ENABLE_DOCS_TRUE='#' - ENABLE_DOCS_FALSE= -fi - - py_mod_var=`echo thread'_' | sed 'y%./+-%__p_%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module thread" >&5 @@ -16178,7 +16159,7 @@ esac fi -ac_config_files="$ac_config_files Makefile pygobject-3.0.pc pygobject-3.0-uninstalled.pc docs/Makefile docs/reference/entities.docbook docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile gi/_glib/Makefile gi/_gobject/Makefile examples/Makefile tests/Makefile PKG-INFO" +ac_config_files="$ac_config_files Makefile pygobject-3.0.pc pygobject-3.0-uninstalled.pc gi/Makefile gi/repository/Makefile gi/overrides/Makefile gi/_glib/Makefile gi/_gobject/Makefile examples/Makefile tests/Makefile PKG-INFO" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16325,10 +16306,6 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_DOCS_TRUE}" && test -z "${ENABLE_DOCS_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_LIBFFI_TRUE}" && test -z "${HAVE_LIBFFI_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBFFI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16746,7 +16723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pygobject $as_me 2.90.3, which was +This file was extended by pygobject $as_me 2.90.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16812,7 +16789,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pygobject config.status 2.90.3 +pygobject config.status 2.90.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -17227,9 +17204,6 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pygobject-3.0.pc") CONFIG_FILES="$CONFIG_FILES pygobject-3.0.pc" ;; "pygobject-3.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pygobject-3.0-uninstalled.pc" ;; - "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; - "docs/reference/entities.docbook") CONFIG_FILES="$CONFIG_FILES docs/reference/entities.docbook" ;; - "docs/xsl/fixxref.py") CONFIG_FILES="$CONFIG_FILES docs/xsl/fixxref.py" ;; "gi/Makefile") CONFIG_FILES="$CONFIG_FILES gi/Makefile" ;; "gi/repository/Makefile") CONFIG_FILES="$CONFIG_FILES gi/repository/Makefile" ;; "gi/overrides/Makefile") CONFIG_FILES="$CONFIG_FILES gi/overrides/Makefile" ;; diff --git a/configure.ac b/configure.ac index 8937c18..4719176 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 2) m4_define(pygobject_minor_version, 90) -m4_define(pygobject_micro_version, 3) +m4_define(pygobject_micro_version, 4) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... @@ -37,8 +37,8 @@ AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version) AM_CONFIG_HEADER(config.h) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) -AM_INIT_AUTOMAKE(foreign) -AM_MAINTAINER_MODE +AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz]) +AM_MAINTAINER_MODE([enable]) dnl put the ACLOCAL flags in the makefile ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" @@ -101,7 +101,10 @@ if test $build_py3k = true ; then [AC_MSG_ERROR(too old)]) fi -AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) +AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found])) +if test "x$os_win32" = "xyes"; then + AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) +fi AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h]) old_CPPFLAGS=$CPPFLAGS @@ -124,28 +127,6 @@ AC_ARG_ENABLE(thread, AC_HELP_STRING([--disable-thread], [Disable pygobject threading support]),, enable_thread=yes) -dnl Building documentation -AC_ARG_ENABLE(docs, - AC_HELP_STRING([--enable-docs], [Enable documentation building]),enable_docs=$enableval, - enable_docs=no) -if test "${enable_docs}" != no; then - dnl - dnl Check for xsltproc - dnl - AC_PATH_PROG([XSLTPROC], [xsltproc]) - if test -z "$XSLTPROC"; then - enable_docs=no - fi - - dnl check for DocBook DTD and stylesheets in the local catalog. - dnl JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN], - dnl [DocBook XML DTD V4.1.2],,enable_docs=no) - dnl JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], - dnl [DocBook XSL Stylesheets],,enable_docs=no) -fi - -AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs != xno) - AM_CHECK_PYMOD(thread,,,enable_thread=check_for_py3_module) if test "x$enable_thread" = xcheck_for_py3_module; then dnl Python 3 uses the _thread module so check for that @@ -255,9 +236,6 @@ AC_CONFIG_FILES( Makefile pygobject-3.0.pc pygobject-3.0-uninstalled.pc - docs/Makefile - docs/reference/entities.docbook - docs/xsl/fixxref.py gi/Makefile gi/repository/Makefile gi/overrides/Makefile diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index ad68613..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,117 +0,0 @@ -REF_VERSION = $(PYGOBJECT_MAJOR_VERSION).$(PYGOBJECT_MINOR_VERSION) -FULL_VERSION = $(REF_VERSION).$(PYGOBJECT_MICRO_VERSION) - -BUILDDIR = $(top_builddir)/docs - -CSS_FILES = style.css - -HTML_FILES = \ - html/class-gobjectgboxed.html \ - html/class-gobjectginterface.html \ - html/class-gobjectgpointer.html \ - html/class-gobject.html \ - html/class-glibmaincontext.html \ - html/class-glibmainloop.html \ - html/glib-constants.html \ - html/glib-functions.html \ - html/gobject-class-reference.html \ - html/glib-class-reference.html \ - html/gobject-constants.html \ - html/gobject-functions.html \ - html/index.html \ - html/index.sgml \ - html/pygobject.devhelp \ - html/pygobject-introduction.html - - -XML_FILES = \ - reference/pygobject.xml \ - reference/pygobject-introduction.xml \ - reference/pygobject-classes.xml \ - reference/pygobject-constants.xml \ - reference/pygobject-ref.xml \ - reference/pygobject-functions.xml \ - reference/pygobject-gboxed.xml \ - reference/pygobject-ginterface.xml \ - reference/pygobject-gpointer.xml \ - reference/pyglib-classes.xml \ - reference/pyglib-constants.xml \ - reference/pyglib-functions.xml \ - reference/pyglib-maincontext.xml \ - reference/pyglib-mainloop.xml - -XSL_FILES = \ - xsl/common.xsl \ - xsl/devhelp.xsl \ - xsl/html.xsl \ - xsl/pdf-style.xsl \ - xsl/pdf.xsl \ - xsl/ref-html-style.xsl - -# fixxref cannot be included in XSL_FILES, because automake is touching it -# so the date is newer then the files in HTML_FILES -FIXXREF = xsl/fixxref.py - -TARGET_DIR = $(datadir)/gtk-doc/html/pygobject -CSSdir = $(TARGET_DIR) -CSS_DATA = $(CSS_FILES) - - -install-data-local: - installfiles=`echo $(srcdir)/html/*`; \ - if test "$$installfiles" = '$(srcdir)/html/*'; \ - then echo '-- Nothing to install' ; \ - else \ - $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ - for i in $$installfiles; do \ - echo '-- Installing '$$i ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ - done; \ - echo '-- Installing $(srcdir)/html/index.sgml' ; \ - $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ - fi - -uninstall-local: - rm -f $(DESTDIR)$(TARGET_DIR)/* - - -XSLdir = $(datadir)/pygobject/xsl -XSL_DATA = $(XSL_FILES) $(FIXXREF) - -EXTRA_DIST = \ - $(HTML_FILES) \ - $(XML_FILES) \ - $(XSL_FILES) \ - $(FIXXREF) \ - $(CSS_FILES) - -reference/builddate.xml: - @$(PYTHON) -c 'import datetime; print datetime.date.today()' > $@ - - -if ENABLE_DOCS - -BUILT_SOURCES = reference/builddate.xml $(HTML_FILES) -CLEANFILES = reference/builddate.xml $(HTML_FILES) - - -# Do not add a builddate.xml dependency here, because the generated html -# documentation will be included in the tarball so xsltproc is not needed to -# install the documentation. Adding a builddate.xml dependency will force -# the documentation to be rebuilt when it doesn't need to be. -$(HTML_FILES): $(XML_FILES) $(XSL_FILES) - @xsltproc --nonet --xinclude -o $(BUILDDIR)/html/ \ - --path $(BUILDDIR)/reference:$(srcdir)/reference \ - --stringparam gtkdoc.bookname "pygobject" \ - --stringparam gtkdoc.version ${REF_VERSION} \ - $(srcdir)/xsl/ref-html-style.xsl \ - $(srcdir)/reference/pygobject-ref.xml - -# pdf: $(REFERENCE_DEPS) reference/builddate.xml -# xsltproc --nonet --xinclude -o pygobject-ref.fo xsl/pdf-style.xsl \ -# reference/pygobject-ref.xml -# pdfxmltex pygobject-ref.fo >output $@ - -# Do not add a builddate.xml dependency here, because the generated html -# documentation will be included in the tarball so xsltproc is not needed to -# install the documentation. Adding a builddate.xml dependency will force -# the documentation to be rebuilt when it doesn't need to be. -@ENABLE_DOCS_TRUE@$(HTML_FILES): $(XML_FILES) $(XSL_FILES) -@ENABLE_DOCS_TRUE@ @xsltproc --nonet --xinclude -o $(BUILDDIR)/html/ \ -@ENABLE_DOCS_TRUE@ --path $(BUILDDIR)/reference:$(srcdir)/reference \ -@ENABLE_DOCS_TRUE@ --stringparam gtkdoc.bookname "pygobject" \ -@ENABLE_DOCS_TRUE@ --stringparam gtkdoc.version ${REF_VERSION} \ -@ENABLE_DOCS_TRUE@ $(srcdir)/xsl/ref-html-style.xsl \ -@ENABLE_DOCS_TRUE@ $(srcdir)/reference/pygobject-ref.xml - -# pdf: $(REFERENCE_DEPS) reference/builddate.xml -# xsltproc --nonet --xinclude -o pygobject-ref.fo xsl/pdf-style.xsl \ -# reference/pygobject-ref.xml -# pdfxmltex pygobject-ref.fo >output glib.MainContext

glib.MainContext

glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.

Synopsis

class glib.MainContext:
-    glib.MainContext()
def iteration(may_block)
def pending()

Ancestry

+-- glib.MainContext
-

Description

A glib.MainContext -represents a set of event sources that can be run in a single thread. File -descriptors (plain files, pipes or sockets) and timeouts are the standard -event sources for GTK and PyGTK though -others can be added. Each event source is assigned a priority. The default -priority, glib.PRIORITY_DEFAULT, is 0. Values less -than 0 denote higher priorities. Values greater than 0 denote lower -priorities. Events from high priority sources are always processed before -events from lower priority sources. Single iterations of a glib.MainContext -can be run with the iteration() -method.

Constructor

    glib.MainContext()

Returns :

a new glib.MainContext - object.

Creates a new glib.MainContext -object.

Methods

glib.MainContext.iteration

    def iteration()

may_block :

if True the call may block - waiting for an event.

Returns :

True if events were - dispatched.

The iteration() method runs a single -iteration. This involves:

  • checking to see if any associated event sources are ready -to be processed;
  • then if no events sources are ready and -may_block is True, waiting for a -source to become ready;
  • and finally, dispatching the highest priority events -sources that are ready

Note that even when may_block is -True, it is still possible for -iteration() to return False, -since the the wait may be interrupted for other reasons than an event source -becoming ready.

glib.MainContext.pending

    def pending()

Returns :

True if events are - pending.

The pending() method checks if any -associated sources have pending events.

diff --git a/docs/html/class-glibmainloop.html b/docs/html/class-glibmainloop.html deleted file mode 100644 index 37a0c7a..0000000 --- a/docs/html/class-glibmainloop.html +++ /dev/null @@ -1,38 +0,0 @@ -glib.MainLoop

glib.MainLoop

glib.MainLoop — an object representing the main event loop of a PyGTK - application.

Synopsis

class glib.MainLoop:
-    glib.MainLoop(context=None, is_running=0)
def get_context()
def is_running()
def quit()
def run()

Ancestry

+-- glib.MainLoop
-

Description

glib.MainLoop -represents a main event loop. A glib.MainLoop -is created with the glib.MainLoop() -constructor. After adding the initial event sources, the run() -method is called. This continuously checks for new events from each of the -event sources and dispatches them. Finally, the processing of an event from -one of the sources leads to a call to the quit() -method to exit the main loop, and the run() -method returns.

It is possible to create new instances of glib.MainLoop -recursively. This is often used in PyGTK applications -when showing modal dialog boxes. Note that event sources are associated with -a particular glib.MainContext, -and will be checked and dispatched for all main loops associated with that -glib.MainContext.

PyGTK contains wrappers of some of these -functions, e.g. the gtk.main(), gtk.main_quit() -and gtk.events_pending() -functions.

Constructor

    glib.MainLoop(context=None, is_running=None)

context :

a glib.MainContext - or None to use the default - context.

is_running :

if True indicates that the - loop is running. This is not very important since calling the run() - method will set this to True - anyway.

Returns :

a new glib.MainLoop - object.

Creates a new glib.MainLoop -object.

Methods

glib.MainLoop.get_context

    def get_context()

Returns :

the glib.MainContext - the mainloop is associated with

The get_context() method returns the -glib.MainContext -that the mainloop was created with.

glib.MainLoop.is_running

    def is_running()

Returns :

True if the mainloop is - currently being run.

The is_running() method checks to see -if the mainloop is currently being run via the run() -method.

glib.MainLoop.quit

    def quit()

The quit() method stops the mainloop -from running. Any subsequent calls to the run() -method will return immediately.

glib.MainLoop.run

    def run()

The run() method runs a mainloop until -the quit() -method is called. If this is called for the thread of the loop's glib.MainContext, -it will process events from the loop, otherwise it will simply wait.

diff --git a/docs/html/class-gobject.html b/docs/html/class-gobject.html deleted file mode 100644 index 5a10122..0000000 --- a/docs/html/class-gobject.html +++ /dev/null @@ -1,176 +0,0 @@ -gobject.GObject

gobject.GObject

gobject.GObject — the base class

Synopsis

class gobject.GObject:
-    def get_property(property_name)
def get_properties(first_property_name, ...)
def set_property(property_name, value)
def set_properties(property_name=value, ...)
def freeze_notify()
def notify(property_name)
def thaw_notify()
def get_data(key)
def set_data(key, data)
def connect(detailed_signal, handler)
def connect_after(detailed_signal, handler)
def connect_object(detailed_signal, handler)
def connect_object_after(detailed_signal, handler)
def disconnect(handler_id)
def handler_disconnect(handler_id)
def handler_is_connected(handler_id)
def handler_block(handler_id)
def handler_unblock(handler_id)
def handler_block_by_func(callable)
def handler_unblock_by_func(callable)
def emit(detailed_signal)
def stop_emission(detailed_signal)
def emit_stop_by_name(detailed_signal)
def chain()

Ancestry

+-- gobject.GObject
-

Attributes

"props"Read/Write -

This attribute gives full access to GObject properties as - simple attributes. It can be used to iterate over all the object - properties, and can be used both on class or instance objects.

-

Examples:

-
-button = Button()
-button_label = button.props.label
-button.props.label = 'Click on this fancy button'
-for pspec in button.props:
-    print pspec
-    print button.get_property(pspec.name)
-label_pspec = Button.props.label
-button_label = button.get_property(label_pspec.name)
-              
-
"__doc__"ReadThe documentation for the object type. Uses - "__gdoc__" if no specific documentation set.
"__gdoc__"ReadThe generated documentation for the underlying GObject - type.
"__gtype__"ReadThe underlying GObject type.
"__grefcount__"ReadThe reference count for the underlying GObject.

gobject.GObject Signal Prototypes

"notify"

def callback(gobject, property_spec, user_param1, ...)

Description

The gobject.GObject - class is the base class providing the common attributes and methods for - the PyGTK classes. The gobject.GObject - class is not a user interface widget class.

The gobject.GObject - class provides the signal management methods, the object property access - methods and the object data management methods.

Methods

gobject.GObject.get_property

    def get_property(property_name)

property_name :

a string containing the property name for the -GObject

Returns :

a Python object containing the value of the -property

The get_property() method returns the -value of the property specified by property_name or -None if there is no value associated with the property.

The TypeError exception is raised -if the property name is not registered with the object class.

gobject.GObject.get_properties

    def get_properties(first_property_name, ...)

first_property_name :

a string containing the first property name for the -GObject

... :

additional property names -

Returns :

a tuple containing the property values -requested

The get_properties() method returns a tuple containing -the values of the properties requested, or -None if there is no value associated with the property.

The TypeError exception is raised -if the property name is not registered with the object class.

gobject.GObject.set_property

    def set_property(property_name, value)

property_name :

a string containing the property -name

value :

a Python object containing the property value -to be set

The set_property() method sets the -property specified by property_name to the specified -value.

The TypeError exception is raised -if the property name is not registered with the object class or if the value -specified could not be converted to the property type.

gobject.GObject.set_properties

    def set_properties(property_name=value, ...)

property_name :

the property name

value :

a Python object containing the property value -to be set

... :

additional property name and value -kwargs

The set_properties() method sets the -property specified by property_name to the specified -value, followed by pairs of property name -and value as keyword arguments.

The TypeError exception is raised -if the property name is not registered with the object class or if the value -specified could not be converted to the property type.

gobject.GObject.freeze_notify

    def freeze_notify()

The freeze_notify() method freezes the -object's property-changed notification queue so that "notify" signals are -blocked until the thaw_notify() method is -called.

gobject.GObject.notify

    def notify(property_name)

property_name :

a string containing a property -name

The notify() method causes the "notify" -signal for the property specified by property_name to -be emitted.

gobject.GObject.thaw_notify

    def thaw_notify()

The thaw_notify() method thaws the -object's property-changed notification queue so that "notify" signals are -emitted.

gobject.GObject.get_data

    def get_data(key)

key :

a string used as the key

Returns :

a Python object containing the associated -data

The get_data() method returns the -Python object associated with the specified key or -None if there is no data associated with the key or -if there is no key associated with the object.

gobject.GObject.set_data

    def set_data(key, data)

key :

a string used as a key

data :

a Python object that is the value to be -associated with the key

The set_data() method associates the -specified Python object (data) with -key.

gobject.GObject.connect

    def connect(detailed_signal, handler, ...)

detailed_signal :

a string containing the signal -name

handler :

a Python function or method -object.

... :

additional optional -parameters

Returns :

an integer identifier

The connect() method adds a function or -method (handler)to the end of the list of signal -handlers for the named detailed_signal but before the -default class signal handler. An optional set of parameters may be specified -after the handler parameter. These will all be passed -to the signal handler when invoked.

For example if a function handler was connected to a signal -using:

-  handler_id = object.connect("signal_name", handler, arg1, arg2, arg3)
-

The handler should be defined as:

-  def handler(object, arg1, arg2, arg3):
-

A method handler connected to a signal using:

-  handler_id = object.connect("signal_name", self.handler, arg1, arg2)
-

requires an additional argument when defined:

-  def handler(self, object, arg1, arg2)
-

A TypeError exception is raised -if detailed_signal identifies a signal name that is -not associated with the object.

gobject.GObject.connect_after

    def connect_after(detailed_signal, handler, ...)

detailed_signal :

a string containing the signal -name

handler :

a Python function or method -object

... :

additional optional -parameters

Returns :

an integer handler -identifier

The connect_after() method is similar -to the connect() method except that the -handler is added to the signal handler list after the -default class signal handler. Otherwise the details of -handler definition and invocation are the -same.

gobject.GObject.connect_object

    def connect_object(detailed_signal, handler, gobject)

detailed_signal :

a string containing the signal -name

handler :

a Python function or method -object

gobject :

a GObject

Returns :

an integer handler -identifier

The connect_object() method is the same -as the connect() method except that the -handler is invoked with the specified -gobject in place of the object invoking the -connect_object() method. For example, a call with a -function handler:

-  handler_id = object("signal_name", handler, gobject)
-

will cause the handler to be invoked -as:

-  handler(gobject)
-

Likewise a method handler will be invoked as:

-  self.handler(gobject)
-

This can be helpful in invoking PyGTK widget methods that -require no arguments except the widget itself (e.g. -widget.destroy()) by using the class method as the -handler. For example, a Button "clicked" signal can be set up to invoke the -Window destroy() method as:

-  handler_id = button.connect_object("clicked", Window.destroy, window)
-

When the button is clicked the handler is invoked as:

-  Window.destroy(window)
-

which is the same as:

-  window.destroy()
-

Additional arguments may be passed to the handler as with the -connect() method handler invocations.

gobject.GObject.connect_object_after

    def connect_object_after(detailed_signal, handler)

detailed_signal :

a string containing the signal -name

handler :

a Python function or method -object

gobject :

a GObject

Returns :

an integer handler -identifier

The connect_object_after() method is -similar to the connect_object() method except that -the handler is added to the signal handler list after -the default class signal handler. Otherwise the details of -handler definition and invocation are the -same.

gobject.GObject.disconnect

    def disconnect(handler_id)

handler_id :

an integer handler -identifier

The disconnect() method removes the -signal handler with the specified handler_id from the -list of signal handlers for the object.

gobject.GObject.handler_disconnect

    def handler_disconnect(handler_id)

handler_id :

an integer handler -identifier

The handler_disconnect() method removes -the signal handler with the specified handler_id from -the list of signal handlers for the object.

gobject.GObject.handler_is_connected

    def handler_is_connected(handler_id)

handler_id :

an integer handler -identifier

Returns :

True if the signal handler -is connected to the object.

The handler_is_connected() method -returns True if the signal handler with the specified -handler_id is connected to the object.

gobject.GObject.handler_block

    def handler_block(handler_id)

handler_id :

an integer handler -identifier

The handler_block() method blocks the -signal handler with the specified handler_id from -being invoked until it is unblocked.

gobject.GObject.handler_unblock

    def handler_unblock(handler_id)

handler_id :

an integer handler -identifier

gobject.GObject.handler_block_by_func

    def handler_block_by_func(callable)

callable :

a callable python object

The handler_block_by_func() method blocks the -all signal handler connected to a specific callable from -being invoked until the callable is unblocked.

gobject.GObject.handler_unblock_by_func

    def handler_unblock_by_func(callback)

callable :

a callable python object

The handler_unblock_by_func() method unblocks -all signal handler connected to a specified callable -thereby allowing it to be invoked when the associated signals are -emitted.

gobject.GObject.emit

    def emit(detailed_signal, ...)

detailed_signal :

a string containing the signal -name

... :

additional parameters

Returns :

a PyObject*

The emit() method causes the object to -emit the signal specified by detailed_signal. The -additional parameters must match the number and type of the required signal -handler parameters. In most cases no additional parameters are needed. for -example:

-  button.emit("clicked")
-

is all that is required to emit the "clicked" signal for a -button. The most common case requiring additional parameters occurs when -emitting an event signal; for example:

-  button.emit("button_press_event", event)
-

gobject.GObject.stop_emission

    def stop_emission(detailed_signal)

detailed_signal :

a string containing the signal -name

The stop_emission() method stops the -current emission of the signal specified by -detailed_signal. Any signal handlers in the list -still to be run will not be invoked.

gobject.GObject.emit_stop_by_name

    def emit_stop_by_name(detailed_signal)

detailed_signal :

a string containing the signal -name

The emit_stop_by_name() method stops -the current emission of the signal specified by -detailed_signal. Any signal handlers in the list -still to be run will not be invoked.

gobject.GObject.chain

    def chain(...)

... :

additional parameters

Returns :

a Python object

The chain() method does something.

Signals

The GObject "notify" Signal

    def callback(gobject, property_spec, user_param1, ...)

gobject :

the gobject that received the -signal

property_spec :

the gobject.GParamSpec of the property that was -changed

user_param1 :

the first user parameter (if any) specified -with the connect() -method

... :

additional user parameters (if -any)

The "notify" signal is emitted on a gobject when one of its -properties has been changed. Note that getting this signal doesn't guarantee -that the value of the property has actually changed, it may also be emitted -when the setter for the property is called to reinstate the previous -value. For example to be notified of the change of the title of a gtk.Window you could -connect to the "notify" signal similar to:

-  window.connect("notify::title", callback)
-
diff --git a/docs/html/class-gobjectgboxed.html b/docs/html/class-gobjectgboxed.html deleted file mode 100644 index b9d8bbd..0000000 --- a/docs/html/class-gobjectgboxed.html +++ /dev/null @@ -1,9 +0,0 @@ -gobject.GBoxed

gobject.GBoxed

gobject.GBoxed — an object containing an opaque chunk of data

Synopsis

class gobject.GBoxed:
-    def copy()

Ancestry

+-- gobject.GBoxed
-

Description

gobject.GBoxed -is an abstract base class that encapsulates an opaque chunk of data to -provide an object-oriented interface and a type that is registered with the -GLIB type system. A boxed type is registered with -functions that provide for the copying and freeing of the underlying data -structure - this allows PyGTK to encapsulate these as Python objects.

Methods

gobject.GBoxed.copy

    def copy()

Returns :

a copy of the gobject.GBoxed - object

The copy() method makes and returns a copy of the boxed object.

diff --git a/docs/html/class-gobjectginterface.html b/docs/html/class-gobjectginterface.html deleted file mode 100644 index 9191f18..0000000 --- a/docs/html/class-gobjectginterface.html +++ /dev/null @@ -1,4 +0,0 @@ -gobject.GInterface

gobject.GInterface

gobject.GInterface — an object representing a GInterface

Synopsis

class gobject.GInterface:
-

Ancestry

+-- gobject.GInterface
-

Description

gobject.GInterface -is an abstract base class that encapsulates a GInterface.

diff --git a/docs/html/class-gobjectgpointer.html b/docs/html/class-gobjectgpointer.html deleted file mode 100644 index 7e8e1c0..0000000 --- a/docs/html/class-gobjectgpointer.html +++ /dev/null @@ -1,8 +0,0 @@ -gobject.GPointer

gobject.GPointer

gobject.GPointer — an object containing a completely opaque chunk of - data

Synopsis

class gobject.GPointer:
-

Ancestry

+-- gobject.GPointer
-

Description

gobject.GPointer -is an abstract base class that encapsulates an opaque chunk of data and -registers it with the GLIB type system. A pointer type -has no methods and generic ways of copying and freeing the data. It -shouldn't be used in PyGTK.

diff --git a/docs/html/glib-class-reference.html b/docs/html/glib-class-reference.html deleted file mode 100644 index fa78a88..0000000 --- a/docs/html/glib-class-reference.html +++ /dev/null @@ -1,3 +0,0 @@ -PyGlibClass Reference

PyGlibClass Reference

Table of Contents

glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK - application.
glib Functions — miscellaneous functions
glib Constants — the built-in constants of the glib module
diff --git a/docs/html/glib-constants.html b/docs/html/glib-constants.html deleted file mode 100644 index 4e997cf..0000000 --- a/docs/html/glib-constants.html +++ /dev/null @@ -1,40 +0,0 @@ -glib Constants

glib Constants

glib Constants — the built-in constants of the glib module

Description

Glib IO Condition Constants

The IO Condition constants are a set of bit-flags that specify a -condition to watch for on an event source.

glib.IO_IN

There is data to read

glib.IO_OUT

Data can be written (without blocking).

glib.IO_PRI

There is urgent data to read.

glib.IO_ERR

Error condition.

glib.IO_HUP

Hung up (the connection has been broken, usually for - pipes and sockets).

glib.IO_NVAL

Invalid request. The file descriptor is not - open.

Glib Priority Constants

The Priority constants specify

glib.PRIORITY_HIGH

Use this for high priority event sources.

glib.PRIORITY_DEFAULT

Use this for default priority event sources. This - priority is used when adding timeout functions with the glib.timeout_add() - function. This priority is also used for events from the X - server.

glib.PRIORITY_HIGH_IDLE

Use this for high priority idle functions. For example, - glib.PRIORITY_HIGH_IDLE + 10 is used for resizing operations; - and, glib.PRIORITY_HIGH_IDLE + 20, for redrawing - operations. (This is done to ensure that any pending resizes are - processed before any pending redraws, so that widgets are not - redrawn twice unnecessarily.)

glib.PRIORITY_DEFAULT_IDLE

Use this for default priority idle functions. This - priority is used when adding idle functions with the glib.idle_add() - function.

glib.PRIORITY_LOW

Use this for very low priority background - tasks.

Glib Spawn Flag Constants

The Spawn Flag constants are a set of bit-flags that can be -passed to the glib.spawn_async() -function.

glib.SPAWN_LEAVE_DESCRIPTORS_OPEN

the parent's open file descriptors will be inherited by -the child; otherwise all descriptors except stdin/stdout/stderr will be -closed before calling exec() in the child.

glib.SPAWN_DO_NOT_REAP_CHILD

the child will not be automatically reaped; you must -call waitpid() or handle SIGCHLD -yourself, or the child will become a zombie.

glib.SPAWN_SEARCH_PATH

argv[0] need not be an absolute -path, it will be looked for in the user's PATH.

glib.SPAWN_STDOUT_TO_DEV_NULL

the child's standard output will be discarded, instead -of going to the same location as the parent's standard output.

glib.SPAWN_STDERR_TO_DEV_NULL

the child's standard error will be discarded.

glib.SPAWN_CHILD_INHERITS_STDIN

the child will inherit the parent's standard input (by -default, the child's standard input is attached to /dev/null).

glib.SPAWN_FILE_AND_ARGV_ZERO

the first element of argv is the -file to execute, while the remaining elements are the actual argument vector -to pass to the file. Normally glib.spawn_async() -uses argv[0] as the file to execute, and passes all -of argv to the child.

Glib User Directory Constants

The User Directory constants are integer values that are currently used only as arguments to - glib.get_user_special_dir() - function. See function documentation for details.

glib.USER_DIRECTORY_DESKTOP

the user's Desktop directory

glib.USER_DIRECTORY_DOCUMENTS

the user's Documents directory

glib.USER_DIRECTORY_DOWNLOAD

the user's Downloads directory

glib.USER_DIRECTORY_MUSIC

the user's Music directory

glib.USER_DIRECTORY_PICTURES

the user's Pictures directory

glib.USER_DIRECTORY_PUBLIC_SHARE

the user's shared directory

glib.USER_DIRECTORY_TEMPLATES

the user's Templates directory

glib.USER_DIRECTORY_VIDEOS

the user's Movies directory

Glib Version Constants

The Version constants specify the version of -Glib used by PyGObject as a 3-tuple containing the major, -minor and patch release numbers.

glib.glib_version

A 3-tuple containing (major, minor, patch) release - numbers of glib.

glib.pyglib_version

A 3-tuple containing (major, minor, patch) release - numbers of the python bindings.
diff --git a/docs/html/glib-functions.html b/docs/html/glib-functions.html deleted file mode 100644 index 450894a..0000000 --- a/docs/html/glib-functions.html +++ /dev/null @@ -1,280 +0,0 @@ -glib Functions

glib Functions

glib Functions — miscellaneous functions

Synopsis

-    def glib.idle_add(callback, ...)
def glib.timeout_add(interval, callback, ...)
def glib.timeout_add_seconds(interval, callback, ...)
def glib.io_add_watch(fd, condition, callback, ...)
def glib.source_remove(tag)
def glib.main_context_default()
def glib.markup_escape_text(text)
def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)
def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)
def glib.get_current_time()
def glib.get_user_cache_dir()
def glib.get_user_config_dir()
def glib.get_user_data_dir()
def glib.get_user_special_dir(directory)
def glib.main_depth()
def glib.threads_init()
def glib.filename_display_name(filename)
def glib.filename_display_basename(filename)
def glib.filename_from_utf8(utf8string)

Description

These functions are part of the PyGObject glib -module but are not directly associated with a specific class.

Functions

glib.idle_add

    def glib.idle_add(callback, ...)

callback :

a function to call when -PyGTK is idle

... :

optionals arguments to be passed to -callback

Returns :

an integer ID

The glib.idle_add() function adds a -function (specified by callback) to be called -whenever there are no higher priority events pending to the default main -loop. The function is given the default idle priority, -glib.PRIORITY_DEFAULT_IDLE. Additional arguments to -pass to callback can be specified after -callback. The idle priority can be specified as a -keyword-value pair with the keyword "priority". If -callback returns False it is -automatically removed from the list of event sources and will not be called -again.

glib.timeout_add

    def glib.timeout_add(interval, callback, ...)

interval :

the time between calls to the function, in -milliseconds

callback :

the function to call

... :

zero or more arguments that will be passed to -callback

Returns :

an integer ID of the event -source

The glib.timeout_add() function sets a -function (specified by callback) to be called at -regular intervals (specified by interval, with the -default priority, glib.PRIORITY_DEFAULT. Additional -arguments to pass to callback can be specified after -callback. The idle priority may be specified as a -keyword-value pair with the keyword "priority".

The function is called repeatedly until it returns -False, at which point the timeout is automatically -destroyed and the function will not be called again. The first call to the -function will be at the end of the first interval. Note that timeout -functions may be delayed, due to the processing of other event sources. Thus -they should not be relied on for precise timing. After each call to the -timeout function, the time of the next timeout is recalculated based on the -current time and the given interval (it does not try to 'catch up' time lost -in delays).

glib.timeout_add_seconds

    def glib.timeout_add_seconds(interval, callback, ...)

interval :

the time between calls to the function, in -seconds

callback :

the function to call

... :

zero or more arguments that will be passed to -callback

Returns :

an integer ID of the event -source

The glib.timeout_add_seconds() is similar to - glib.timeout_add() except - that interval must be specified in seconds, not - milliseconds, and the function should cause less CPU wakeups, which is important - for laptops' batteries.

Unlike glib.timeout_add(), this function operates at - whole second granularity. The initial starting point of the timer is determined - by the implementation and the implementation is expected to group multiple timers - together so that they fire all at the same time. To allow this grouping, the - interval to the first timer is rounded and can deviate up to one second from the - specified interval. Subsequent timer iterations will generally run at the - specified interval.

Note that timeout functions may be delayed, due to the processing of other - event sources. Thus they should not be relied on for precise timing. After each - call to the timeout function, the time of the next timeout is recalculated based - on the current time and the given interval.

The grouping of timers to fire at the same time results in a more power and - CPU efficient behavior so if your timer is in multiples of seconds and you don't - require the first timer exactly one second from now, the use of - glib.timeout_add_seconds() is preferred - over glib.timeout_add().

glib.io_add_watch

    def glib.io_add_watch(fd, condition, callback, ...)

fd :

a Python file object or an integer file -descriptor ID

condition :

a condition mask

callback :

a function to call

... :

additional arguments to pass to -callback

Returns :

an integer ID of the event source

The glib.io_add_watch() function -arranges for the file (specified by fd) to be -monitored by the main loop for the specified -condition. fd may be a Python -file object or an integer file descriptor. The value of condition is a -combination of:

glib.IO_IN

There is data to read.

glib.IO_OUT

Data can be written (without blocking).

glib.IO_PRI

There is urgent data to read.

glib.IO_ERR

Error condition.

glib.IO_HUP

Hung up (the connection has been broken, usually for -pipes and sockets).

Additional arguments to pass to callback -can be specified after callback. The idle priority -may be specified as a keyword-value pair with the keyword "priority". The -signature of the callback function is:

-  def callback(source, cb_condition, ...)
-

where source is -fd, the file descriptor; -cb_condition is the condition that triggered the -signal; and, ... are the zero or more arguments that -were passed to the glib.io_add_watch() -function.

If the callback function returns False it -will be automatically removed from the list of event sources and will not be -called again. If it returns True it will be called again -when the condition is matched.

glib.source_remove

    def glib.source_remove(tag)

tag :

an integer ID

Returns :

True if the event source was -removed

The glib.source_remove() function -removes the event source specified by tag (as returned by the glib.idle_add(), -glib.timeout_add() -and glib.io_add_watch() -functions)

glib.main_context_default

    def glib.main_context_default()

Returns :

the default glib.MainContext -object

The glib.main_context_default() function -returns the default glib.MainContext object.

glib.markup_escape_text

    def glib.markup_escape_text(text)

text :

the UTF-8 string to be -escaped

Returns :

the escaped text

Note

This function is available in PyGTK 2.8 and above.

The glib.markup_escape_text() function -escapes the string specified by text so that the -markup parser will parse it verbatim. Less than, greater than, ampersand, -etc. are replaced with the corresponding entities. This function would -typically be used when writing out a file to be parsed with the markup -parser.

Note that this function doesn't protect whitespace and line -endings from being processed according to the XML rules for normalization of -line endings and attribute values.

glib.child_watch_add

    def glib.child_watch_add(pid, function, data=None, priority=glib.PRIORITY_DEFAULT)

pid :

process id of a child process to watch

function :

the function to call

data :

the optional data to pass to -function

priority :

the priority of the idle source - one of the -Glib Priority Constants

Returns :

the id of event source.

Note

This function is available in PyGTK 2.6 and above.

The glib.child_watch_add() function sets -the function specified by function to be called with -the user data specified by data when the child -indicated by pid exits. The signature for the -callback is:

-def callback(pid, condition, user_data)
-

where pid is is the child process id, -condition is the status information about the child -process and user_data is data -PyGTK supports only a single callback per process id.

glib.spawn_async

    def glib.spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None)

argv :

a sequence of strings containing the arguments -of the child process

envp :

the child's environment or -None to inherit the parent's -environment.

working_directory :

the child's current working directory, or -None to inherit parent's

flags :

flags from the Glib Spawn Flag Constants.

child_setup :

a function to run in the child just before -calling exec()

user_data :

the user data for the -child_setup function

standard_input :

if True return the file -descriptor for the child's stdin

standard_output :

if True return the file -descriptor for the child's stdout

standard_error :

if True return the file -descriptor for the child's stderr

Returns :

a 4-tuple containing the child's process id and -the stdin, stdout and stderr file descriptor integers.

Note

This function is available in PyGTK 2.6 and above.

The glib.spawn_async() function executes -a child program asynchronously (your program will not block waiting for the -child to exit). The child program is specified by the only argument that -must be provided, argv. argv -should be a sequence of strings, to be passed as the argument vector for the -child. The first string in argv is of course the name -of the program to execute. By default, the name of the program must be a -full path; the PATH shell variable will only be searched if -you pass the glib.SPAWN_SEARCH_PATH flag in -flags. The function returns a 4-tuple containing the -child's process id and the file descriptors for the child's stdin, stdout -and stderr. The stdin, stdout and stderr file descriptors are returned only -ofthe corresponding standard_input, -standard_output or -standard_error params are -True.

On Windows, the low-level child process creation API -(CreateProcess()) doesn't use argument vectors, but a -command line. The C runtime library's spawn*() family -of functions (which glib.spawn_async() -eventually calls) paste the argument vector elements into a command line, -and the C runtime startup code does a corresponding reconstruction of an -argument vector from the command line, to be passed to -main(). Complications arise when you have argument -vector elements that contain spaces of double quotes. The -spawn*() functions don't do any quoting or escaping, -but on the other hand the startup code does do unquoting and unescaping in -order to enable receiving arguments with embedded spaces or double -quotes. To work around this asymmetry, the glib.spawn_async() -function will do quoting and escaping on argument vector elements that need -it before calling the C runtime spawn() -function.

envp is a sequence of strings, where each - string has the form KEY=VALUE. This will become the - child's environment. If envp is - None or not specified, the child inherits its - parent's environment.

flags should be the bitwise -OR of the Glib Spawn Flag Constants you want to affect the -function's behaviour. The glib.SPAWN_DO_NOT_REAP_CHILD -flag means that the child will not automatically be reaped; you must use a -GChildWatch source to be notified about the death of the child -process. Eventually you must call g_spawn_close_pid() on the child_pid, in -order to free resources which may be associated with the child process. (On -Unix, using a GChildWatch source is equivalent to calling -waitpid() or handling the SIGCHLD -signal manually. On Windows, calling g_spawn_close_pid() is equivalent to -calling CloseHandle() on the process handle -returned).

glib.SPAWN_LEAVE_DESCRIPTORS_OPEN means -that the parent's open file descriptors will be inherited by the child; -otherwise all descriptors except stdin/stdout/stderr will be closed before -calling exec() in the -child. glib.SPAWN_SEARCH_PATH means that -argv[0] need not be an absolute path, it will be -looked for in the user's -PATH. glib.SPAWN_STDOUT_TO_DEV_NULL -means that the child's standard output will be discarded, instead of going -to the same location as the parent's standard output. If you use this flag, -standard_output must be -None. glib.SPAWN_STDERR_TO_DEV_NULL -means that the child's standard error will be discarded, instead of going to -the same location as the parent's standard error. If you use this flag, -standard_error must be -None. glib.SPAWN_CHILD_INHERITS_STDIN -means that the child will inherit the parent's standard input (by default, -the child's standard input is attached to -/dev/null). If you use this flag, -standard_input must be -None. glib.SPAWN_FILE_AND_ARGV_ZERO -means that the first element of argv is the file to -execute, while the remaining elements are the actual argument vector to pass -to the file. Normally the glib.spawn_async() -function uses argv[0] as the file to execute, and -passes all of argv to the child.

child_setup and -user_data are a function and user data. On POSIX -platforms, the function is called in the child after GLib has performed all -the setup it plans to perform (including creating pipes, closing file -descriptors, etc.) but before calling exec(). That is, -child_setup is called just before calling -exec() in the child. Obviously actions taken in this -function will only affect the child, not the parent. On Windows, there is no -separate fork() and exec() -functionality. Child processes are created and run right away with one API -call, -CreateProcess(). child_setup is -called in the parent process just before creating the child process. You -should carefully consider what you do in child_setup -if you intend your software to be portable to Windows.

The returned child process id can be used to send signals to the -child, or to wait for the child if you specified the -glib.SPAWN_DO_NOT_REAP_CHILD flag. On Windows, child -pid will be returned only if you specified the -glib.SPAWN_DO_NOT_REAP_CHILD flag.

The caller of the glib.spawn_async() -must close any returned file descriptors when they are no longer in -use.

If standard_input is -None, the child's standard input is attached to -/dev/null unless -glib.SPAWN_CHILD_INHERITS_STDIN is set.

If standard_error is -None, the child's standard error goes to the same -location as the parent's standard error unless -glib.SPAWN_STDERR_TO_DEV_NULL is set.

If standard_output is -None, the child's standard output goes to the same -location as the parent's standard output unless -glib.SPAWN_STDOUT_TO_DEV_NULL is set.

If an error occurs, the glib.GError exception will be -raised.

glib.get_current_time

    def glib.get_current_time()

Returns :

the current time as the number of seconds and -microseconds from the epoch.

Note

This function is available in PyGTK 2.8 and above.

The glib.get_current_time() function -reurns the current time of day as the number of seconds and microseconds -from the epoch.

glib.get_user_cache_dir

    def glib.get_user_cache_dir()

Returns :

- a strings with a path to user's cache directory. -

Note

This function is available in PyGObject 2.18 and above.

Returns a base directory in which to store non-essential, - cached data specific to particular user.

On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification.

glib.get_user_config_dir

    def glib.get_user_config_dir()

Returns :

- a strings with a path to user's configuration directory. -

Note

This function is available in PyGObject 2.18 and above.

Returns a base directory in which to store user-specific - application configuration information such as user preferences - and settings.

On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification.

glib.get_user_data_dir

    def glib.get_user_data_dir()

Returns :

- a strings with a path to user's data directory. -

Note

This function is available in PyGObject 2.18 and above.

Returns a base directory in which to access application - data such as icons that is customized for a particular - user

On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification.

glib.get_user_special_dir

    def glib.get_user_special_dir(directory)

directory :

- the logical id of special directory, - see User - Directory constants for the list of supported - values -

Returns :

- a strings with a path to the requested directory. -

Note

This function is available in PyGObject 2.18 and above.

Returns the full path of a special directory using its - logical id.

On Unix this is done using the XDG special user - directories. For compatibility with existing practise, - glib.USER_DIRECTORY_DESKTOP - falls back to $HOME/Desktop when XDG - special user directories have not been set up.

Depending on the platform, the user might be able to - change the path of the special directory without requiring the - session to restart; GLib will not reflect any change once the - special directories are loaded.

glib.main_depth

    def glib.main_depth()

Returns :

the depth of the stack of calls to the main -context.

Note

This function is available in PyGTK 2.8 and above.

The main_depth() function returns the depth -of the stack of calls in the main context. That is, when called from the -toplevel, it gives 0. When called from within a callback from the glib.MainContext.iteration() -method (or the glib.MainLoop.run() -method, etc.) it returns 1. When called from within a callback to a -recursive call to the glib.MainContext.iteration() -method), it returns 2. And so forth.

glib.threads_init

    def glib.threads_init()

Returns :

Note

This function is available in PyGTK 2.4 and above.

The threads_init() function initializes the - the use of Python threading in the glib module. This function is - different than the gtk.gdk.threads_init() - function as that function also initializes the gdk threads.

glib.signal_accumulator_true_handled

    def glib.signal_accumulator_true_handled()

Note

This function is available in PyGTK 2.8 and above.

The signal_accumulator_true_handled() - function is only used as accumulator argument when registering - signals.

glib.filename_display_name

    def glib.filename_display_name(filename)

filename :

a pathname in the file name - encoding

Returns :

an UTF8 rendition of - filename.

Note

This function is available in PyGTK 2.10 and above.

The filename_display_name() function - converts a filename into a valid UTF-8 string. The conversion is not - necessarily reversible, so you should keep the original around and use - the return value of this function only for display purposes. Unlike - g_filename_to_utf8(), the result is guaranteed to be non-None even if - the filename actually isn't in the file name encoding.

If you know the whole pathname of the file you should use the - glib.filename_display_basename() - function, since that allows location-based translation of - filenames.

glib.filename_display_basename

    def glib.filename_display_basename(filename)

filename :

an absolute pathname in the file name - encoding

Returns :

an UTF8 rendition of - filename.

Note

This function is available in PyGTK 2.10 and above.

The filename_display_basename() function - returns the display basename for the particular filename, guaranteed - to be valid UTF-8. The display name might not be identical to the - filename, for instance there might be problems converting it to UTF-8, - and some files can be translated in the display.

You must pass the whole absolute pathname to this functions so - that translation of well known locations can be done.

This function is preferred over the glib.filename_display_name() - function if you know the whole path, as it allows translation.

glib.filename_from_utf8

    def glib.filename_from_utf8(utf8string)

utf8string :

a UTF-8 encoded string.

Returns :

a filename encoded in the GLib filename - encoding.

Note

This function is available in PyGTK 2.10 and above.

The filename_from_utf8() function converts - a string from UTF-8 to the encoding GLib uses for filenames. Note that - on Windows GLib uses UTF-8 for filenames.

diff --git a/docs/html/gobject-class-reference.html b/docs/html/gobject-class-reference.html deleted file mode 100644 index 80d2cce..0000000 --- a/docs/html/gobject-class-reference.html +++ /dev/null @@ -1,2 +0,0 @@ -PyGObject Class Reference

PyGObject Class Reference

Table of Contents

gobject.GObject — the base class
gobject.GBoxed — an object containing an opaque chunk of data
gobject.GPointer — an object containing a completely opaque chunk of - data
gobject.GInterface — an object representing a GInterface
gobject Functions — miscellaneous functions
gobject Constants — the built-in constants of the gobject module
diff --git a/docs/html/gobject-constants.html b/docs/html/gobject-constants.html deleted file mode 100644 index 984db0b..0000000 --- a/docs/html/gobject-constants.html +++ /dev/null @@ -1,63 +0,0 @@ -gobject Constants

gobject Constants

gobject Constants — the built-in constants of the gobject module

Description

GObject Param Flag Constants

The Param Flag constants are a set of bit-flags that specify -certain aspects of parameters that can be configured.

gobject.PARAM_READABLE

The parameter is readable

gobject.PARAM_WRITABLE

The parameter is writable

gobject.PARAM_CONSTRUCT

The parameter will be set upon object - construction

gobject.PARAM_CONSTRUCT_ONLY

The parameter will only be set upon object - construction

gobject.PARAM_LAX_VALIDATION

Upon parameter conversion strict validation is not - required

GObject Signal Flag Constants

The Signal Flag constants are a set of bit-flags that specify a -signal's behavior. The overall signal description outlines how especially -the RUN flags control the stages of a signal -emission.

gobject.SIGNAL_RUN_FIRST

Invoke the object method handler in the first emission - stage.

gobject.SIGNAL_RUN_LAST

Invoke the object method handler in the third emission - stage.

gobject.SIGNAL_RUN_CLEANUP

Invoke the object method handler in the last emission - stage.

gobject.SIGNAL_NO_RECURSE

Signals being emitted for an object while currently - being in emission for this very object will not be emitted - recursively, but instead cause the first emission to be - restarted.

gobject.SIGNAL_DETAILED

This signal supports "::detail" appendices to the - signal name upon handler connections and emissions.

gobject.SIGNAL_ACTION

Action signals are signals that may freely be emitted - on alive objects from user code via the gobject.emit() - method and friends, without the need of being embedded into - extra code that performs pre or post emission adjustments on the - object. They can also be thought of as object methods which can - be called generically by third-party code.

gobject.SIGNAL_NO_HOOKS

No emissions hooks are supported for this - signal.

GObject Spawn Flag Constants

The Spawn Flag constants are a set of bit-flags that can be -passed to the gobject.spawn_async() -function.

gobject.SPAWN_LEAVE_DESCRIPTORS_OPEN

the parent's open file descriptors will be inherited by -the child; otherwise all descriptors except stdin/stdout/stderr will be -closed before calling exec() in the child.

gobject.SPAWN_DO_NOT_REAP_CHILD

the child will not be automatically reaped; you must -call waitpid() or handle SIGCHLD -yourself, or the child will become a zombie.

gobject.SPAWN_SEARCH_PATH

argv[0] need not be an absolute -path, it will be looked for in the user's PATH.

gobject.SPAWN_STDOUT_TO_DEV_NULL

the child's standard output will be discarded, instead -of going to the same location as the parent's standard output.

gobject.SPAWN_STDERR_TO_DEV_NULL

the child's standard error will be discarded.

gobject.SPAWN_CHILD_INHERITS_STDIN

the child will inherit the parent's standard input (by -default, the child's standard input is attached to /dev/null).

gobject.SPAWN_FILE_AND_ARGV_ZERO

the first element of argv is the -file to execute, while the remaining elements are the actual argument vector -to pass to the file. Normally gobject.spawn_async() -uses argv[0] as the file to execute, and passes all -of argv to the child.

GObject Built-in Type Constants

The Built-in Type constants specify the pre-defined types used -by gobject.

gobject.TYPE_INVALID

An invalid type, used as error return value in some - functions.

gobject.TYPE_NONE

A fundamental type indicating no type.

gobject.TYPE_INTERFACE

The fundamental type from which all interfaces are - derived.

gobject.TYPE_CHAR

The fundamental type corresponding to a - character. This maps to a string in Python.

gobject.TYPE_UCHAR

The fundamental type corresponding to an unsigned - character. This maps to a string in Python.

gobject.TYPE_BOOLEAN

The fundamental type corresponding to a True or False - value. This maps to an integer in Python.

gobject.TYPE_INT

The fundamental type corresponding to an - integer. This maps to an integer in Python.

gobject.TYPE_UINT

he fundamental type corresponding to an unsigned - integer. This maps to an integer in Python.

gobject.TYPE_LONG

The fundamental type corresponding to a long - integer. This maps to an integer in Python.

gobject.TYPE_ULONG

The fundamental type corresponding to an unsigned - integer. This maps to an integer in Python.

gobject.TYPE_INT64

The fundamental type corresponding to an long long - integer. This maps to a long integer in Python.

gobject.TYPE_UINT64

The fundamental type corresponding to an unsigned long - long integer. This maps to a long integer in Python.

gobject.TYPE_ENUM

The fundamental type corresponding to an enumeration - type. This maps to an integer in Python.

gobject.TYPE_FLAGS

The fundamental type corresponding to a flag - type. This maps to an integer in Python.

gobject.TYPE_FLOAT

The fundamental type corresponding to a floating point - number. This maps to a float in Python.

gobject.TYPE_DOUBLE

The fundamental type corresponding to a double - floating point number. This maps to a float in Python.

gobject.TYPE_STRING

The fundamental type corresponding to a string.

gobject.TYPE_POINTER

The fundamental type corresponding to a pointer to an - anonymous type. This has no corresponding Python type.

gobject.TYPE_BOXED

The fundamental type corresponding to a boxed object - type.

gobject.TYPE_PARAM

The fundamental type corresponding to a GParamSpec - type.

gobject.TYPE_OBJECT

The fundamental type corresponding to a GObject - type.

gobject.TYPE_PYOBJECT

The fundamental type corresponding to a Python Object - type.

GObject Version Constants

The Version constants specify the version of -GLIB used by PyGTK as a 3-tuple containing the major, -minor and patch release numbers.

gobject.glib_version

A 3-tuple containing (major, minor, patch) release - numbers.
diff --git a/docs/html/gobject-functions.html b/docs/html/gobject-functions.html deleted file mode 100644 index aa4d279..0000000 --- a/docs/html/gobject-functions.html +++ /dev/null @@ -1,134 +0,0 @@ -gobject Functions

gobject Functions

gobject Functions — miscellaneous functions

Synopsis

-    def gobject.type_name(type)
def gobject.type_from_name(type_name)
def gobject.type_parent(type)
def gobject.type_is_a(type, parent_type)
def gobject.type_children(type)
def gobject.type_interfaces(type)
def gobject.type_register(class)
def gobject.signal_new(signal_name, type, flags, return_type, param_types)
def gobject.signal_list_names(type)
def gobject.signal_list_ids(type)
def gobject.signal_lookup(name, type)
def gobject.signal_name(signal_id)
def gobject.signal_query(name, type)
def gobject.signal_query(signal_id)
def gobject.list_properties(type)
def gobject.new(type, ...)
def gobject.signal_accumulator_true_handled()
def gobject.add_emission_hook(type, name, callback, ...)
def gobject.remove_emission_hook(type, name, hook_id)
def gobject._install_metaclass(metaclass) -

Description

These functions are part of the PyGTK gobject -module but are not directly associated with a specific class.

Note

- Many functions that previously were in this namespace got moved to glib namespace instead. They - are still available in gobject for backward compatibility, but - not documented here. If you miss documentation for some function, be sure to - check glib first. -

Functions

gobject.type_name

    def gobject.type_name(type)

type :

a GObject type, type ID or -instance

Returns :

The gobject.type_name() function returns -the unique name that is assigned to the specified -type. type can be a GObject -type, type ID or instance. This function raises a TypeError exception -if type isn't a PyGTK type.

gobject.type_from_name

    def gobject.type_from_name(type_name)

type_name :

a string containing the name of a -type

Returns :

the type ID named -type_name

The gobject.type_from_name() function -returns the type ID of the PyGTK type with the name -specified by type_name. This function raises a -RuntimeError exception if no type matches -type_name.

gobject.type_parent

    def gobject.type_parent(type)

type :

a GObject type, type ID or -instance

Returns :

the parent type ID

The gobject.type_parent() function returns -the direct parent type ID of the specified type. -type can be a GObject type, type ID or instance. If -type has no parent, i.e. is a fundamental type, the -RuntimeError exception is raised.

gobject.type_is_a

    def gobject.type_is_a(type, parent_type)

type :

a GObject type, type ID or -instance

parent_type :

a GObject type, type ID or -instance

Returns :

True if -parent_type is an ancestor of -type

The gobject.type_is_a() function returns -True if the specified type is a -descendant of the type specified by parent_type. This -function also returns True if -parent_type is an interface and -type conforms to it.

gobject.type_children

    def gobject.type_children(type)

type :

a GObject type, type ID or -instance

Returns :

a list of the child types of -type

The gobject.type_children() function -returns a list containing the child types of the specified -type.

gobject.type_interfaces

    def gobject.type_interfaces(type)

type :

a GObject type, type ID or -instance

Returns :

a list of the interface types supported by -type

The gobject.type_interfaces() function -returns a list of the interface types supported by -type. type can be a GObject -type, type ID or instance. This function returns a RuntimeError exception if -type is not a valid type or has no interfaces.

gobject.type_register

    def gobject.type_register(class)

class :

a Python class that is a descendant of gobject.GObject

The gobject.type_register() function -registers the specified Python class as a PyGTK type. -class must be a descendant of gobject.GObject. The function generates a name for the new type.

gobject.signal_new

    def gobject.signal_new(signal_name, type, flags, return_type, param_types)

signal_name :

a string containing the name of the -signal

type :

the object type that the signal is associated -with

flags :

the signal flags

return_type :

the return type of the signal -handler

param_types :

the parameter types passed to the signal -handler

Returns :

a unique integer signal ID

The gobject.signal_new() function registers -a signal with the specified signal_name for the -specified object type. The value of -flags is a combination of:

gobject.SIGNAL_RUN_FIRST

Invoke the object method handler in the first emission -stage.

gobject.SIGNAL_RUN_LAST

Invoke the object method handler in the third emission -stage.

gobject.SIGNAL_RUN_CLEANUP

Invoke the object method handler in the last emission -stage.

gobject.SIGNAL_NO_RECURSE

Signals being emitted for an object while currently -being in emission for this very object will not be emitted recursively, but -instead cause the first emission to be restarted.

gobject.SIGNAL_DETAILED

This signal supports "::detail" appendixes to the -signal name upon handler connections and emissions.

gobject.SIGNAL_ACTION

Action signals are signals that may freely be emitted -on alive objects from user code via gobject.emit()() -and friends, without the need of being embedded into extra code that -performs pre or post emission adjustments on the object. They can also be -thought of as generically callable object methods.

gobject.SIGNAL_NO_HOOKS

No emissions hooks are supported for this -signal.

return_type is the type of the return -value from a signal handler and may be a gobject type, type ID or instance. -The param_types parameter is a list of additional -types that are passed to the signal handler. Each parameter type may be -specified as a gobject type, type ID or instance. For example, to add a -signal to the gtk.Window type called "my-signal" that calls a handler with a -gtk.Button widget and an integer value and a return value that is a -boolean, use:

-  gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
-

gobject.signal_list_names

    def gobject.signal_list_names(type)

type :

a GObject type, type ID or -instance

Returns :

a list of the signal names supported by -type

The gobject.signal_list_names() function -returns a list of the names of the signals that are supported by the -specified GObject type

Note

The type keyword is available in PyGTK 2.6 and above.

gobject.signal_list_ids

    def gobject.signal_list_ids(type)

type :

a GObject type, type ID or -instance

Returns :

a list of the signal ids supported by -type

Note

This method is available in PyGTK 2.6 and above.

The gobject.signal_list_ids() function -returns a list of the integer ids of the signals that are supported by the -GObject specified by type

gobject.signal_lookup

    def gobject.signal_lookup(name, type)

name :

the name of a signal for -type

type :

a GObject type, type ID or -instance

Returns :

the integer id of a signal supported by -type or 0.

Note

This method is available in PyGTK 2.6 and above.

The gobject.signal_lookup() function -returns the id of the signal with the name specified by -name that is supported by the GObject specified -specified bytype. 0 is returned if the signal is not -found.

gobject.signal_name

    def gobject.signal_name(signal_id)

signal_id :

an integer signal id

Returns :

the name of the signal or -None.

Note

This method is available in PyGTK 2.6 and above.

The gobject.signal_name() function returns -the name of the signal that has the signal id specified by -id.

gobject.signal_query

    def gobject.signal_query(name, type)

name :

the name of a signal for -type

type :

a GObject type, type ID or -instance

Returns :

a 6-tuple containing signal information or -None

Note

This method is available in PyGTK 2.6 and above.

The gobject.signal_query() function returns -a 6-tuple containing information about the signal with the name specified by -name that is supported by the GObject specified by -type. If the signal is not found -None is returned.

The signal information 6-tuple contains:

  • the integer signal id
  • the signal name
  • the GType that the signal is registered for
  • the signal flags (see the GObject Signal Flag Constants)
  • the GType of the return from the signal callback -function
  • a tuple containing the GTypes of the parameters that are -passed to the signal callback function. Note that these may not correspond -exactly to the PyGTK signal callback parameters.

gobject.signal_query

    def gobject.signal_query(signal_id)

signal_id :

the integer id of a signal

Returns :

a 6-tuple containing signal information or -None

Note

This method is available in PyGTK 2.6 and above.

The gobject.signal_query() function returns -a 6-tuple containing information about the signal with the id specified by -signal_id. If the signal is not found -None is returned.

The signal information 6-tuple contains:

  • the integer signal id
  • the signal name
  • the GType that the signal is registered for
  • the signal flags (see the GObject Signal Flag Constants)
  • the GType of the return from the signal callback -function
  • a tuple containing the GTypes of the parameters that are -passed to the signal callback function. Note that these may not correspond -exactly to the PyGTK signal callback parameters.

gobject.list_properties

    def gobject.list_properties(type)

type :

a GObject type, type ID or -instance

Returns :

a list of the properties (as GParam objects) -supported by type

The gobject.list_properties() function -returns a list of the properties (as GParam objects) supported by -type.

gobject.new

    def gobject.new(type, ...)

type :

a GObject type, type ID or -instance

... :

zero or more property-value -pairs

Returns :

a new object if the specified -type

The gobject.new() function returns a new -object of the specified type. type must specify a -type that is a descendant of gobject.GObject. A -TypeError exception is raised if type specifies an -abstract class or a type that is not a descendant of gobject.GObject. A set -of property-value pairs may be specified to set the value of the object's -properties.

gobject.signal_accumulator_true_handled

    def gobject.signal_accumulator_true_handled()

Note

This function is available in PyGTK 2.8 and above.

The signal_accumulator_true_handled() - function is only used as accumulator argument when registering - signals.

gobject.add_emission_hook

    def gobject.add_emission_hook(type, name, callback, ...)

type :

a Python GObject instance or - type

name :

a signal name

callback :

a function

... :

zero or more extra arguments that will be - passed to callback.

Returns :

the hook id, for later use with gobject.signal_remove_emission_hook().

Note

This function is available in PyGTK 2.8 and above.

The add_emission_hook() function adds an - emission hook for the signal specified by name, - which will get called for any emission of that signal, independent of - the instance. This is possible only for signals which don't have the - gobject.SIGNAL_NO_HOOKS flag set.

gobject.remove_emission_hook

    def gobject.remove_emission_hook(type, name, hook_id)

type :

a Python GObject instance or - type

name :

a signal name

hook_id :

the id of the emission hook as returned by the - gobject.add_emission_hook()) - function.

Returns :

Note

This function is available in PyGTK 2.8 and above.

The remove_emission_hook() function deletes - an emission hook.

gobject._install_metaclass

    def gobject._install_metaclass(metaclass)

metaclass :

Note

This function is available in PyGTK 2.10 and above.

The _install_metaclass() function installs - the metaclass specified by metaclass.

diff --git a/docs/html/index.html b/docs/html/index.html deleted file mode 100644 index 77417f8..0000000 --- a/docs/html/index.html +++ /dev/null @@ -1,6 +0,0 @@ -PyGObject Reference Manual

PyGObject Reference Manual

for PyGObject version 2.90.3

2011-08-31 -

Abstract

This reference describes the classes of the python gobject -module.


Table of Contents

Introduction
Reference Page Format
PyGlibClass Reference
glib.MainContext — an object representing a set of event sources to be handled -in a glib.MainLoop.
glib.MainLoop — an object representing the main event loop of a PyGTK - application.
glib Functions — miscellaneous functions
glib Constants — the built-in constants of the glib module
PyGObject Class Reference
gobject.GObject — the base class
gobject.GBoxed — an object containing an opaque chunk of data
gobject.GPointer — an object containing a completely opaque chunk of - data
gobject.GInterface — an object representing a GInterface
gobject Functions — miscellaneous functions
gobject Constants — the built-in constants of the gobject module
diff --git a/docs/html/index.sgml b/docs/html/index.sgml deleted file mode 100644 index 93c0942..0000000 --- a/docs/html/index.sgml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/html/pygobject-introduction.html b/docs/html/pygobject-introduction.html deleted file mode 100644 index bdb81c0..0000000 --- a/docs/html/pygobject-introduction.html +++ /dev/null @@ -1,83 +0,0 @@ -Introduction

Introduction

Table of Contents

Reference Page Format

This document describes many of the PyGObject - version 2.12 classes and their methods and associated - functions. Deprecated classes, functions and methods have been - specifically left out of this reference though classes that have become - deprecated since PyGObject 2.0 have been left in but annotated with a - deprecation warning. This document attempts to document as much of the - PyGObject API as possible but there - are undoubtedly errors and omissions. If you discover any of these please - file a bug report at bugzilla.gnome.org for the - pygobject project. Specific areas that have not been - documented include:

  • The GParamSpec class

This reference describes the API for PyGObject as - of version 2.11.0+ and assumes that the additional API changes for version - 2.12 will not be significant. There will undoubtedly be changes that are - not reflected in this reference. The differences in the API between - version 2.0 and previous versions are denoted in this reference with a - Note that describes the availability of the object, constructor, method or - function. Any of these that do not have a notation can be assumed to be - available in all versions of PyGObject from 2.0 and up. The source code - must be consulted if this reference and your version of - PyGObject seem to differ. You are encouraged to use the - latest version of PyGObject that is available. See the - PyGTK - homepage for more information and more resources on how to use - PyGObject as well as help in its development.

The Reference contains a chapter for each - PyGObject module containing the class descriptions. The - class descriptions are arranged alphabetically within the - chapters. Currently there is one module chapter:

The gobject module

The classes that are included in the -gobject module of PyGObject and are -accessed similar to: gobject.GObject. These classes are the base object -classes that the gtk and gtk.gdk -module classes are built on.

Reference Page Format

Each PyGObject class is described in a reference -page that has a number of sections in a fixed format. Each reference page -will have a subset of the following sections:

Name

The name and a one-line description of the -class.

Synopsis

A synopsis of the class and its methods and -optionally a list of associated functions.

Ancestry

The list of the parent classes of the class. This -section may not be present in all class descriptions.

Properties

A list of the properties (internal state) -supported by the class. This section may not be present in all classes. The -property descriptions include the name, the access operations (e.g. Read, -Write), and a brief description. Properties are accessed using the gobject.set_property() -and gobject.get_property() -methods that are available to every PyGObject object. This -section may not be present in all class descriptions.

Attributes

A set of internal object state data accessible as Python - attributes (e.g. object.attr). The attribute descriptions include - a name by which the attribute data is accessed, the access mode - (e.g. Read, Write), and a brief description of the attribute. Most - PyGObject classes do not support attributes so - this section is not present in most class descriptions.

Signal Prototypes

A list of the signals supported by the class including - the signal name and a synopsis of the signal handler function - prototype. This section may not be present in all class - descriptions.

Description

A description of the class and possibly some of - the methods supported by the class.

Constructor

The description of the class object constructor including - the synopsis with brief parameter descriptions and a description - of th use of the constructor. There may be more than one - constructor description if the constructor supports different - parameter lists. This section may not be present in all class - descriptions.

Methods

A list of methods supported by the class. Each method - description includes: a synopsis of the method and its parameters - as well as a brief description of each parameter and return value - (if any); and, a description of the use of the method.

Functions

A list of related functions. Each function description - includes a synopsis of the function and its parameters and return - value (if any), and a description of the use of the - function.

Signals

A list of signals including a synopsis of the signal - handler prototype function with its parameters and return value - (if any). The signal emission conditions are briefly - described. This section is not present in all class descriptions; - specifically, the gtk.gdk classes do not - usually support signals.

The function and method synopsis parameters are displayed in - bold to denote Python keyword - parameters. Also if the parameter is optional its default value will be - displayed. For example the gobject.signal_lookup() - function synopsis is:

-    def gobject.signal_lookup(name, type)
-

The parameters name and - type are keyword parameters that can be specified - in a call either by position or keyword (in which case position is not - important). The following calls have the same result:

-  id = gobject.signal_lookup("clicked", gtk.Button)
-  id = gobject.signal_lookup("clicked", type=gtk.Button)
-  id = gobject.signal_lookup(name="clicked", type=gtk.Button)
-  id = gobject.signal_lookup(type=gtk.Button, name="clicked")
-

Parameters that are not keyword parameters are displayed in -italic and must be specified positionally but may also -be optional.

diff --git a/docs/html/pygobject.devhelp b/docs/html/pygobject.devhelp deleted file mode 100644 index 7a030e8..0000000 --- a/docs/html/pygobject.devhelp +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/reference/entities.docbook.in b/docs/reference/entities.docbook.in deleted file mode 100644 index be788f8..0000000 --- a/docs/reference/entities.docbook.in +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/reference/pyglib-classes.xml b/docs/reference/pyglib-classes.xml deleted file mode 100644 index ecc4e5b..0000000 --- a/docs/reference/pyglib-classes.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -PyGlibClass Reference - - - - - - - - diff --git a/docs/reference/pyglib-constants.xml b/docs/reference/pyglib-constants.xml deleted file mode 100644 index 0f1bf8d..0000000 --- a/docs/reference/pyglib-constants.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - glib Constants - the built-in constants of the glib module - - - - Synopsis - - - - - - - - - - - - - Description - - - Glib IO Condition Constants - - The IO Condition constants are a set of bit-flags that specify a -condition to watch for on an event source. - - - - glib.IO_IN - - There is data to read - - - - glib.IO_OUT - - Data can be written (without blocking). - - - - glib.IO_PRI - - There is urgent data to read. - - - - glib.IO_ERR - - Error condition. - - - - glib.IO_HUP - - Hung up (the connection has been broken, usually for - pipes and sockets). - - - - glib.IO_NVAL - - Invalid request. The file descriptor is not - open. - - - - - - - - Glib Priority Constants - - The Priority constants specify - - - - glib.PRIORITY_HIGH - - Use this for high priority event sources. - - - - glib.PRIORITY_DEFAULT - - Use this for default priority event sources. This - priority is used when adding timeout functions with the glib.timeout_add() - function. This priority is also used for events from the X - server. - - - - glib.PRIORITY_HIGH_IDLE - - Use this for high priority idle functions. For example, - glib.PRIORITY_HIGH_IDLE + 10 is used for resizing operations; - and, glib.PRIORITY_HIGH_IDLE + 20, for redrawing - operations. (This is done to ensure that any pending resizes are - processed before any pending redraws, so that widgets are not - redrawn twice unnecessarily.) - - - - glib.PRIORITY_DEFAULT_IDLE - - Use this for default priority idle functions. This - priority is used when adding idle functions with the glib.idle_add() - function. - - - - glib.PRIORITY_LOW - - Use this for very low priority background - tasks. - - - - - - - - Glib Spawn Flag Constants - - The Spawn Flag constants are a set of bit-flags that can be -passed to the glib.spawn_async() -function. - - - - glib.SPAWN_LEAVE_DESCRIPTORS_OPEN - - the parent's open file descriptors will be inherited by -the child; otherwise all descriptors except stdin/stdout/stderr will be -closed before calling exec() in the child. - - - - glib.SPAWN_DO_NOT_REAP_CHILD - - the child will not be automatically reaped; you must -call waitpid() or handle SIGCHLD -yourself, or the child will become a zombie. - - - - glib.SPAWN_SEARCH_PATH - - argv[0] need not be an absolute -path, it will be looked for in the user's PATH. - - - - glib.SPAWN_STDOUT_TO_DEV_NULL - - the child's standard output will be discarded, instead -of going to the same location as the parent's standard output. - - - - glib.SPAWN_STDERR_TO_DEV_NULL - - the child's standard error will be discarded. - - - - glib.SPAWN_CHILD_INHERITS_STDIN - - the child will inherit the parent's standard input (by -default, the child's standard input is attached to /dev/null). - - - - glib.SPAWN_FILE_AND_ARGV_ZERO - - the first element of argv is the -file to execute, while the remaining elements are the actual argument vector -to pass to the file. Normally glib.spawn_async() -uses argv[0] as the file to execute, and passes all -of argv to the child. - - - - - - - - Glib User Directory Constants - - The User Directory constants are integer values that are currently used only as arguments to - glib.get_user_special_dir() - function. See function documentation for details. - - - - glib.USER_DIRECTORY_DESKTOP - - the user's Desktop directory - - - - glib.USER_DIRECTORY_DOCUMENTS - - the user's Documents directory - - - - glib.USER_DIRECTORY_DOWNLOAD - - the user's Downloads directory - - - - glib.USER_DIRECTORY_MUSIC - - the user's Music directory - - - - glib.USER_DIRECTORY_PICTURES - - the user's Pictures directory - - - - glib.USER_DIRECTORY_PUBLIC_SHARE - - the user's shared directory - - - - glib.USER_DIRECTORY_TEMPLATES - - the user's Templates directory - - - - glib.USER_DIRECTORY_VIDEOS - - the user's Movies directory - - - - - - - Glib Version Constants - The Version constants specify the version of -Glib used by PyGObject as a 3-tuple containing the major, -minor and patch release numbers. - - - - glib.glib_version - - A 3-tuple containing (major, minor, patch) release - numbers of glib. - - - - glib.pyglib_version - - A 3-tuple containing (major, minor, patch) release - numbers of the python bindings. - - - - - - - - - diff --git a/docs/reference/pyglib-functions.xml b/docs/reference/pyglib-functions.xml deleted file mode 100644 index 3e11251..0000000 --- a/docs/reference/pyglib-functions.xml +++ /dev/null @@ -1,1047 +0,0 @@ - - - - - - glib Functions - miscellaneous functions - - - - Synopsis - - - - glib.idle_add - callback - ... - - glib.timeout_add - interval - callback - ... - - glib.timeout_add_seconds - interval - callback - ... - - glib.io_add_watch - fd - condition - callback - ... - - glib.source_remove - tag - - glib.main_context_default - - - glib.markup_escape_text - text - - glib.child_watch_add - pid - function - dataNone - priorityglib.PRIORITY_DEFAULT - - glib.spawn_async - argv - envpNone - working_directoryNone - flags0 - child_setupNone - user_dataNone - standard_inputNone - standard_outputNone - standard_errorNone - - glib.get_current_time - - glib.get_user_cache_dir - - glib.get_user_config_dir - - glib.get_user_data_dir - - glib.get_user_special_dir - directory - - glib.main_depth - - glib.threads_init - - glib.filename_display_name - filename - - glib.filename_display_basename - filename - - glib.filename_from_utf8 - utf8string - - - - - - Description - - These functions are part of the PyGObject glib -module but are not directly associated with a specific class. - - - - - Functions - - - glib.idle_add - - - glib.idle_add - callback - ... - - - - callback : - a function to call when -PyGTK is idle - - - ... : - optionals arguments to be passed to -callback - - - Returns : - an integer ID - - - - The glib.idle_add() function adds a -function (specified by callback) to be called -whenever there are no higher priority events pending to the default main -loop. The function is given the default idle priority, -glib.PRIORITY_DEFAULT_IDLE. Additional arguments to -pass to callback can be specified after -callback. The idle priority can be specified as a -keyword-value pair with the keyword "priority". If -callback returns False it is -automatically removed from the list of event sources and will not be called -again. - - - - - glib.timeout_add - - - glib.timeout_add - interval - callback - ... - - - - interval : - the time between calls to the function, in -milliseconds - - - callback : - the function to call - - - ... : - zero or more arguments that will be passed to -callback - - - Returns : - an integer ID of the event -source - - - - The glib.timeout_add() function sets a -function (specified by callback) to be called at -regular intervals (specified by interval, with the -default priority, glib.PRIORITY_DEFAULT. Additional -arguments to pass to callback can be specified after -callback. The idle priority may be specified as a -keyword-value pair with the keyword "priority". - - The function is called repeatedly until it returns -False, at which point the timeout is automatically -destroyed and the function will not be called again. The first call to the -function will be at the end of the first interval. Note that timeout -functions may be delayed, due to the processing of other event sources. Thus -they should not be relied on for precise timing. After each call to the -timeout function, the time of the next timeout is recalculated based on the -current time and the given interval (it does not try to 'catch up' time lost -in delays). - - - - - glib.timeout_add_seconds - - - glib.timeout_add_seconds - interval - callback - ... - - - - interval : - the time between calls to the function, in -seconds - - - callback : - the function to call - - - ... : - zero or more arguments that will be passed to -callback - - - Returns : - an integer ID of the event -source - - - - The glib.timeout_add_seconds() is similar to - glib.timeout_add() except - that interval must be specified in seconds, not - milliseconds, and the function should cause less CPU wakeups, which is important - for laptops' batteries. - - Unlike glib.timeout_add(), this function operates at - whole second granularity. The initial starting point of the timer is determined - by the implementation and the implementation is expected to group multiple timers - together so that they fire all at the same time. To allow this grouping, the - interval to the first timer is rounded and can deviate up to one second from the - specified interval. Subsequent timer iterations will generally run at the - specified interval. - - Note that timeout functions may be delayed, due to the processing of other - event sources. Thus they should not be relied on for precise timing. After each - call to the timeout function, the time of the next timeout is recalculated based - on the current time and the given interval. - - The grouping of timers to fire at the same time results in a more power and - CPU efficient behavior so if your timer is in multiples of seconds and you don't - require the first timer exactly one second from now, the use of - glib.timeout_add_seconds() is preferred - over glib.timeout_add(). - - - - - glib.io_add_watch - - - glib.io_add_watch - fd - condition - callback - ... - - - - fd : - a Python file object or an integer file -descriptor ID - - - condition : - a condition mask - - - callback : - a function to call - - - ... : - additional arguments to pass to -callback - - - Returns : - an integer ID of the event source - - - - The glib.io_add_watch() function -arranges for the file (specified by fd) to be -monitored by the main loop for the specified -condition. fd may be a Python -file object or an integer file descriptor. The value of condition is a -combination of: - - - - glib.IO_IN - - There is data to read. - - - - glib.IO_OUT - - Data can be written (without blocking). - - - - glib.IO_PRI - - There is urgent data to read. - - - - glib.IO_ERR - - Error condition. - - - - glib.IO_HUP - - Hung up (the connection has been broken, usually for -pipes and sockets). - - - - - Additional arguments to pass to callback -can be specified after callback. The idle priority -may be specified as a keyword-value pair with the keyword "priority". The -signature of the callback function is: - - - def callback(source, cb_condition, ...) - - - where source is -fd, the file descriptor; -cb_condition is the condition that triggered the -signal; and, ... are the zero or more arguments that -were passed to the glib.io_add_watch() -function. - - If the callback function returns False it -will be automatically removed from the list of event sources and will not be -called again. If it returns True it will be called again -when the condition is matched. - - - - - glib.source_remove - - - glib.source_remove - tag - - - - tag : - an integer ID - - - Returns : - True if the event source was -removed - - - - The glib.source_remove() function -removes the event source specified by tag (as returned by the glib.idle_add(), -glib.timeout_add() -and glib.io_add_watch() -functions) - - - - - glib.main_context_default - - - glib.main_context_default - - - - - Returns : - the default glib.MainContext -object - - - - The glib.main_context_default() function -returns the default glib.MainContext object. - - - - - glib.markup_escape_text - - - glib.markup_escape_text - text - - - - text : - the UTF-8 string to be -escaped - - - Returns : - the escaped text - - - - - This function is available in PyGTK 2.8 and above. - - - The glib.markup_escape_text() function -escapes the string specified by text so that the -markup parser will parse it verbatim. Less than, greater than, ampersand, -etc. are replaced with the corresponding entities. This function would -typically be used when writing out a file to be parsed with the markup -parser. - - Note that this function doesn't protect whitespace and line -endings from being processed according to the XML rules for normalization of -line endings and attribute values. - - - - - glib.child_watch_add - - - glib.child_watch_add - pid - function - dataNone - priorityglib.PRIORITY_DEFAULT - - - - pid : - process id of a child process to watch - - function : - the function to call - - - data : - the optional data to pass to -function - - - priority : - the priority of the idle source - one of the - - - - Returns : - the id of event source. - - - - This function is available in PyGTK 2.6 and above. - - - The glib.child_watch_add() function sets -the function specified by function to be called with -the user data specified by data when the child -indicated by pid exits. The signature for the -callback is: - - -def callback(pid, condition, user_data) - - - where pid is is the child process id, -condition is the status information about the child -process and user_data is data -PyGTK supports only a single callback per process id. - - - - - glib.spawn_async - - - glib.spawn_async - argv - envpNone - working_directoryNone - flags0 - child_setupNone - user_dataNone - standard_inputNone - standard_outputNone - standard_errorNone - - - - argv : - a sequence of strings containing the arguments -of the child process - - - envp : - the child's environment or -None to inherit the parent's -environment. - - - working_directory : - the child's current working directory, or -None to inherit parent's - - - flags : - flags from the . - - - child_setup : - a function to run in the child just before -calling exec() - - - user_data : - the user data for the -child_setup function - - - standard_input : - if True return the file -descriptor for the child's stdin - - - standard_output : - if True return the file -descriptor for the child's stdout - - - standard_error : - if True return the file -descriptor for the child's stderr - - - Returns : - a 4-tuple containing the child's process id and -the stdin, stdout and stderr file descriptor integers. - - - - This function is available in PyGTK 2.6 and above. - - - The glib.spawn_async() function executes -a child program asynchronously (your program will not block waiting for the -child to exit). The child program is specified by the only argument that -must be provided, argv. argv -should be a sequence of strings, to be passed as the argument vector for the -child. The first string in argv is of course the name -of the program to execute. By default, the name of the program must be a -full path; the PATH shell variable will only be searched if -you pass the glib.SPAWN_SEARCH_PATH flag in -flags. The function returns a 4-tuple containing the -child's process id and the file descriptors for the child's stdin, stdout -and stderr. The stdin, stdout and stderr file descriptors are returned only -ofthe corresponding standard_input, -standard_output or -standard_error params are -True. - - On Windows, the low-level child process creation API -(CreateProcess()) doesn't use argument vectors, but a -command line. The C runtime library's spawn*() family -of functions (which glib.spawn_async() -eventually calls) paste the argument vector elements into a command line, -and the C runtime startup code does a corresponding reconstruction of an -argument vector from the command line, to be passed to -main(). Complications arise when you have argument -vector elements that contain spaces of double quotes. The -spawn*() functions don't do any quoting or escaping, -but on the other hand the startup code does do unquoting and unescaping in -order to enable receiving arguments with embedded spaces or double -quotes. To work around this asymmetry, the glib.spawn_async() -function will do quoting and escaping on argument vector elements that need -it before calling the C runtime spawn() -function. - - envp is a sequence of strings, where each - string has the form KEY=VALUE. This will become the - child's environment. If envp is - None or not specified, the child inherits its - parent's environment. - - flags should be the bitwise -OR of the you want to affect the -function's behaviour. The glib.SPAWN_DO_NOT_REAP_CHILD -flag means that the child will not automatically be reaped; you must use a -GChildWatch source to be notified about the death of the child -process. Eventually you must call g_spawn_close_pid() on the child_pid, in -order to free resources which may be associated with the child process. (On -Unix, using a GChildWatch source is equivalent to calling -waitpid() or handling the SIGCHLD -signal manually. On Windows, calling g_spawn_close_pid() is equivalent to -calling CloseHandle() on the process handle -returned). - - glib.SPAWN_LEAVE_DESCRIPTORS_OPEN means -that the parent's open file descriptors will be inherited by the child; -otherwise all descriptors except stdin/stdout/stderr will be closed before -calling exec() in the -child. glib.SPAWN_SEARCH_PATH means that -argv[0] need not be an absolute path, it will be -looked for in the user's -PATH. glib.SPAWN_STDOUT_TO_DEV_NULL -means that the child's standard output will be discarded, instead of going -to the same location as the parent's standard output. If you use this flag, -standard_output must be -None. glib.SPAWN_STDERR_TO_DEV_NULL -means that the child's standard error will be discarded, instead of going to -the same location as the parent's standard error. If you use this flag, -standard_error must be -None. glib.SPAWN_CHILD_INHERITS_STDIN -means that the child will inherit the parent's standard input (by default, -the child's standard input is attached to -/dev/null). If you use this flag, -standard_input must be -None. glib.SPAWN_FILE_AND_ARGV_ZERO -means that the first element of argv is the file to -execute, while the remaining elements are the actual argument vector to pass -to the file. Normally the glib.spawn_async() -function uses argv[0] as the file to execute, and -passes all of argv to the child. - - child_setup and -user_data are a function and user data. On POSIX -platforms, the function is called in the child after GLib has performed all -the setup it plans to perform (including creating pipes, closing file -descriptors, etc.) but before calling exec(). That is, -child_setup is called just before calling -exec() in the child. Obviously actions taken in this -function will only affect the child, not the parent. On Windows, there is no -separate fork() and exec() -functionality. Child processes are created and run right away with one API -call, -CreateProcess(). child_setup is -called in the parent process just before creating the child process. You -should carefully consider what you do in child_setup -if you intend your software to be portable to Windows. - - The returned child process id can be used to send signals to the -child, or to wait for the child if you specified the -glib.SPAWN_DO_NOT_REAP_CHILD flag. On Windows, child -pid will be returned only if you specified the -glib.SPAWN_DO_NOT_REAP_CHILD flag. - - The caller of the glib.spawn_async() -must close any returned file descriptors when they are no longer in -use. - - If standard_input is -None, the child's standard input is attached to -/dev/null unless -glib.SPAWN_CHILD_INHERITS_STDIN is set. - - If standard_error is -None, the child's standard error goes to the same -location as the parent's standard error unless -glib.SPAWN_STDERR_TO_DEV_NULL is set. - - If standard_output is -None, the child's standard output goes to the same -location as the parent's standard output unless -glib.SPAWN_STDOUT_TO_DEV_NULL is set. - - If an error occurs, the glib.GError exception will be -raised. - - - - - glib.get_current_time - - - glib.get_current_time - - - - Returns : - the current time as the number of seconds and -microseconds from the epoch. - - - - This function is available in PyGTK 2.8 and above. - - - The glib.get_current_time() function -reurns the current time of day as the number of seconds and microseconds -from the epoch. - - - - - glib.get_user_cache_dir - - - glib.get_user_cache_dir - - - - Returns : - - - a strings with a path to user's cache directory. - - - - - - This function is available in PyGObject 2.18 and above. - - - Returns a base directory in which to store non-essential, - cached data specific to particular user. - - On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification. - - - - glib.get_user_config_dir - - - glib.get_user_config_dir - - - - Returns : - - - a strings with a path to user's configuration directory. - - - - - - This function is available in PyGObject 2.18 and above. - - - Returns a base directory in which to store user-specific - application configuration information such as user preferences - and settings. - - On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification. - - - - glib.get_user_data_dir - - - glib.get_user_data_dir - - - - Returns : - - - a strings with a path to user's data directory. - - - - - - This function is available in PyGObject 2.18 and above. - - - Returns a base directory in which to access application - data such as icons that is customized for a particular - user - - On UNIX platforms this is determined using the mechanisms - described in the - XDG - Base Directory Specification. - - - - glib.get_user_special_dir - - - glib.get_user_special_dir - directory - - - - directory : - - - the logical id of special directory, - see User - Directory constants for the list of supported - values - - - - - Returns : - - - a strings with a path to the requested directory. - - - - - - This function is available in PyGObject 2.18 and above. - - - Returns the full path of a special directory using its - logical id. - - On Unix this is done using the XDG special user - directories. For compatibility with existing practise, - glib.USER_DIRECTORY_DESKTOP - falls back to $HOME/Desktop when XDG - special user directories have not been set up. - - Depending on the platform, the user might be able to - change the path of the special directory without requiring the - session to restart; GLib will not reflect any change once the - special directories are loaded. - - - - glib.main_depth - - - glib.main_depth - - - - Returns : - the depth of the stack of calls to the main -context. - - - - This function is available in PyGTK 2.8 and above. - - - The main_depth() function returns the depth -of the stack of calls in the main context. That is, when called from the -toplevel, it gives 0. When called from within a callback from the glib.MainContext.iteration() -method (or the glib.MainLoop.run() -method, etc.) it returns 1. When called from within a callback to a -recursive call to the glib.MainContext.iteration() -method), it returns 2. And so forth. - - - - - glib.threads_init - - - glib.threads_init - - - - - Returns : - - - - - This function is available in PyGTK 2.4 and above. - - - The threads_init() function initializes the - the use of Python threading in the glib module. This function is - different than the gtk.gdk.threads_init() - function as that function also initializes the gdk threads. - - - - - glib.signal_accumulator_true_handled - - - glib.signal_accumulator_true_handled - - - - This function is available in PyGTK 2.8 and above. - - - The signal_accumulator_true_handled() - function is only used as accumulator argument when registering - signals. - - - - - glib.filename_display_name - - - glib.filename_display_name - filename - - - - filename : - a pathname in the file name - encoding - - - Returns : - an UTF8 rendition of - filename. - - - - This function is available in PyGTK 2.10 and above. - - - The filename_display_name() function - converts a filename into a valid UTF-8 string. The conversion is not - necessarily reversible, so you should keep the original around and use - the return value of this function only for display purposes. Unlike - g_filename_to_utf8(), the result is guaranteed to be non-None even if - the filename actually isn't in the file name encoding. - - If you know the whole pathname of the file you should use the - glib.filename_display_basename() - function, since that allows location-based translation of - filenames. - - - - - glib.filename_display_basename - - - glib.filename_display_basename - filename - - - - filename : - an absolute pathname in the file name - encoding - - - Returns : - an UTF8 rendition of - filename. - - - - This function is available in PyGTK 2.10 and above. - - - The filename_display_basename() function - returns the display basename for the particular filename, guaranteed - to be valid UTF-8. The display name might not be identical to the - filename, for instance there might be problems converting it to UTF-8, - and some files can be translated in the display. - - You must pass the whole absolute pathname to this functions so - that translation of well known locations can be done. - - This function is preferred over the glib.filename_display_name() - function if you know the whole path, as it allows translation. - - - - - glib.filename_from_utf8 - - - glib.filename_from_utf8 - utf8string - - - - utf8string : - a UTF-8 encoded string. - - - Returns : - a filename encoded in the GLib filename - encoding. - - - - This function is available in PyGTK 2.10 and above. - - - The filename_from_utf8() function converts - a string from UTF-8 to the encoding GLib uses for filenames. Note that - on Windows GLib uses UTF-8 for filenames. - - - - - - diff --git a/docs/reference/pyglib-maincontext.xml b/docs/reference/pyglib-maincontext.xml deleted file mode 100644 index ee1e985..0000000 --- a/docs/reference/pyglib-maincontext.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - glib.MainContext - - an object representing a set of event sources to be handled -in a glib.MainLoop. - - - - Synopsis - - - glib.MainContext - - glib.MainContext - - - iteration - may_block - - - pending - - - - - - - Ancestry - -+-- glib.MainContext - - - - - - Description - - A glib.MainContext -represents a set of event sources that can be run in a single thread. File -descriptors (plain files, pipes or sockets) and timeouts are the standard -event sources for GTK and PyGTK though -others can be added. Each event source is assigned a priority. The default -priority, glib.PRIORITY_DEFAULT, is 0. Values less -than 0 denote higher priorities. Values greater than 0 denote lower -priorities. Events from high priority sources are always processed before -events from lower priority sources. Single iterations of a glib.MainContext -can be run with the iteration() -method. - - - - - Constructor - - - glib.MainContext - - - - Returns : - a new glib.MainContext - object. - - - - Creates a new glib.MainContext -object. - - - - - Methods - - - glib.MainContext.iteration - - - iteration - - - - may_block : - if True the call may block - waiting for an event. - - - Returns : - True if events were - dispatched. - - - - The iteration() method runs a single -iteration. This involves: - - - - checking to see if any associated event sources are ready -to be processed; - - - then if no events sources are ready and -may_block is True, waiting for a -source to become ready; - - - and finally, dispatching the highest priority events -sources that are ready - - - - Note that even when may_block is -True, it is still possible for -iteration() to return False, -since the the wait may be interrupted for other reasons than an event source -becoming ready. - - - - - glib.MainContext.pending - - - pending - - - - Returns : - True if events are - pending. - - - - The pending() method checks if any -associated sources have pending events. - - - - - - diff --git a/docs/reference/pyglib-mainloop.xml b/docs/reference/pyglib-mainloop.xml deleted file mode 100644 index 913e743..0000000 --- a/docs/reference/pyglib-mainloop.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - glib.MainLoop - - an object representing the main event loop of a PyGTK - application. - - - - Synopsis - - - glib.MainLoop - - glib.MainLoop - contextNone - is_running0 - - - get_context - - - is_running - - - quit - - - run - - - - - - - Ancestry - -+-- glib.MainLoop - - - - - - Description - - glib.MainLoop -represents a main event loop. A glib.MainLoop -is created with the glib.MainLoop() -constructor. After adding the initial event sources, the run() -method is called. This continuously checks for new events from each of the -event sources and dispatches them. Finally, the processing of an event from -one of the sources leads to a call to the quit() -method to exit the main loop, and the run() -method returns. - - It is possible to create new instances of glib.MainLoop -recursively. This is often used in PyGTK applications -when showing modal dialog boxes. Note that event sources are associated with -a particular glib.MainContext, -and will be checked and dispatched for all main loops associated with that -glib.MainContext. - - PyGTK contains wrappers of some of these -functions, e.g. the gtk.main(), gtk.main_quit() -and gtk.events_pending() -functions. - - - - - Constructor - - - glib.MainLoop - contextNone - is_runningNone - - - - context : - a glib.MainContext - or None to use the default - context. - - - is_running : - if True indicates that the - loop is running. This is not very important since calling the run() - method will set this to True - anyway. - - - Returns : - a new glib.MainLoop - object. - - - - Creates a new glib.MainLoop -object. - - - - - Methods - - - glib.MainLoop.get_context - - - get_context - - - - Returns : - the glib.MainContext - the mainloop is associated with - - - - The get_context() method returns the -glib.MainContext -that the mainloop was created with. - - - - - glib.MainLoop.is_running - - - is_running - - - - Returns : - True if the mainloop is - currently being run. - - - - The is_running() method checks to see -if the mainloop is currently being run via the run() -method. - - - - - glib.MainLoop.quit - - - quit - - - The quit() method stops the mainloop -from running. Any subsequent calls to the run() -method will return immediately. - - - - - glib.MainLoop.run - - - run - - - The run() method runs a mainloop until -the quit() -method is called. If this is called for the thread of the loop's glib.MainContext, -it will process events from the loop, otherwise it will simply wait. - - - - - - diff --git a/docs/reference/pygobject-classes.xml b/docs/reference/pygobject-classes.xml deleted file mode 100644 index 17f925c..0000000 --- a/docs/reference/pygobject-classes.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - -PyGObject Class Reference - - - - - - - - - - diff --git a/docs/reference/pygobject-constants.xml b/docs/reference/pygobject-constants.xml deleted file mode 100644 index a8f9711..0000000 --- a/docs/reference/pygobject-constants.xml +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - gobject Constants - the built-in constants of the gobject module - - - - Synopsis - - - - - - - - - - - - Description - - - GObject Param Flag Constants - - The Param Flag constants are a set of bit-flags that specify -certain aspects of parameters that can be configured. - - - - gobject.PARAM_READABLE - - The parameter is readable - - - - gobject.PARAM_WRITABLE - - The parameter is writable - - - - gobject.PARAM_CONSTRUCT - - The parameter will be set upon object - construction - - - - gobject.PARAM_CONSTRUCT_ONLY - - The parameter will only be set upon object - construction - - - - gobject.PARAM_LAX_VALIDATION - - Upon parameter conversion strict validation is not - required - - - - - - - - GObject Signal Flag Constants - - The Signal Flag constants are a set of bit-flags that specify a -signal's behavior. The overall signal description outlines how especially -the RUN flags control the stages of a signal -emission. - - - - gobject.SIGNAL_RUN_FIRST - - Invoke the object method handler in the first emission - stage. - - - - gobject.SIGNAL_RUN_LAST - - Invoke the object method handler in the third emission - stage. - - - - gobject.SIGNAL_RUN_CLEANUP - - Invoke the object method handler in the last emission - stage. - - - - gobject.SIGNAL_NO_RECURSE - - Signals being emitted for an object while currently - being in emission for this very object will not be emitted - recursively, but instead cause the first emission to be - restarted. - - - - gobject.SIGNAL_DETAILED - - This signal supports "::detail" appendices to the - signal name upon handler connections and emissions. - - - - gobject.SIGNAL_ACTION - - Action signals are signals that may freely be emitted - on alive objects from user code via the gobject.emit() - method and friends, without the need of being embedded into - extra code that performs pre or post emission adjustments on the - object. They can also be thought of as object methods which can - be called generically by third-party code. - - - - gobject.SIGNAL_NO_HOOKS - - No emissions hooks are supported for this - signal. - - - - - - - - GObject Spawn Flag Constants - - The Spawn Flag constants are a set of bit-flags that can be -passed to the gobject.spawn_async() -function. - - - - gobject.SPAWN_LEAVE_DESCRIPTORS_OPEN - - the parent's open file descriptors will be inherited by -the child; otherwise all descriptors except stdin/stdout/stderr will be -closed before calling exec() in the child. - - - - gobject.SPAWN_DO_NOT_REAP_CHILD - - the child will not be automatically reaped; you must -call waitpid() or handle SIGCHLD -yourself, or the child will become a zombie. - - - - gobject.SPAWN_SEARCH_PATH - - argv[0] need not be an absolute -path, it will be looked for in the user's PATH. - - - - gobject.SPAWN_STDOUT_TO_DEV_NULL - - the child's standard output will be discarded, instead -of going to the same location as the parent's standard output. - - - - gobject.SPAWN_STDERR_TO_DEV_NULL - - the child's standard error will be discarded. - - - - gobject.SPAWN_CHILD_INHERITS_STDIN - - the child will inherit the parent's standard input (by -default, the child's standard input is attached to /dev/null). - - - - gobject.SPAWN_FILE_AND_ARGV_ZERO - - the first element of argv is the -file to execute, while the remaining elements are the actual argument vector -to pass to the file. Normally gobject.spawn_async() -uses argv[0] as the file to execute, and passes all -of argv to the child. - - - - - - - - GObject Built-in Type Constants - - The Built-in Type constants specify the pre-defined types used -by gobject. - - - - gobject.TYPE_INVALID - - An invalid type, used as error return value in some - functions. - - - - gobject.TYPE_NONE - - A fundamental type indicating no type. - - - - gobject.TYPE_INTERFACE - - The fundamental type from which all interfaces are - derived. - - - - gobject.TYPE_CHAR - - The fundamental type corresponding to a - character. This maps to a string in Python. - - - - gobject.TYPE_UCHAR - - The fundamental type corresponding to an unsigned - character. This maps to a string in Python. - - - - gobject.TYPE_BOOLEAN - - The fundamental type corresponding to a True or False - value. This maps to an integer in Python. - - - - gobject.TYPE_INT - - The fundamental type corresponding to an - integer. This maps to an integer in Python. - - - - gobject.TYPE_UINT - - he fundamental type corresponding to an unsigned - integer. This maps to an integer in Python. - - - - gobject.TYPE_LONG - - The fundamental type corresponding to a long - integer. This maps to an integer in Python. - - - - gobject.TYPE_ULONG - - The fundamental type corresponding to an unsigned - integer. This maps to an integer in Python. - - - - gobject.TYPE_INT64 - - The fundamental type corresponding to an long long - integer. This maps to a long integer in Python. - - - - gobject.TYPE_UINT64 - - The fundamental type corresponding to an unsigned long - long integer. This maps to a long integer in Python. - - - - gobject.TYPE_ENUM - - The fundamental type corresponding to an enumeration - type. This maps to an integer in Python. - - - - gobject.TYPE_FLAGS - - The fundamental type corresponding to a flag - type. This maps to an integer in Python. - - - - gobject.TYPE_FLOAT - - The fundamental type corresponding to a floating point - number. This maps to a float in Python. - - - - gobject.TYPE_DOUBLE - - The fundamental type corresponding to a double - floating point number. This maps to a float in Python. - - - - gobject.TYPE_STRING - - The fundamental type corresponding to a string. - - - - gobject.TYPE_POINTER - - The fundamental type corresponding to a pointer to an - anonymous type. This has no corresponding Python type. - - - - gobject.TYPE_BOXED - - The fundamental type corresponding to a boxed object - type. - - - - gobject.TYPE_PARAM - - The fundamental type corresponding to a GParamSpec - type. - - - - gobject.TYPE_OBJECT - - The fundamental type corresponding to a GObject - type. - - - - gobject.TYPE_PYOBJECT - - The fundamental type corresponding to a Python Object - type. - - - - - - - - GObject Version Constants - - The Version constants specify the version of -GLIB used by PyGTK as a 3-tuple containing the major, -minor and patch release numbers. - - - - gobject.glib_version - - A 3-tuple containing (major, minor, patch) release - numbers. - - - - - - - - - diff --git a/docs/reference/pygobject-functions.xml b/docs/reference/pygobject-functions.xml deleted file mode 100644 index 1f50fbe..0000000 --- a/docs/reference/pygobject-functions.xml +++ /dev/null @@ -1,889 +0,0 @@ - - - - - - gobject Functions - miscellaneous functions - - - - Synopsis - - - - gobject.type_name - type - - gobject.type_from_name - type_name - - gobject.type_parent - type - - gobject.type_is_a - type - parent_type - - gobject.type_children - type - - gobject.type_interfaces - type - - gobject.type_register - class - - gobject.signal_new - signal_name - type - flags - return_type - param_types - - gobject.signal_list_names - type - - gobject.signal_list_ids - type - - gobject.signal_lookup - name - type - - gobject.signal_name - signal_id - - gobject.signal_query - name - type - - gobject.signal_query - signal_id - - gobject.list_properties - type - - gobject.new - type - ... - - gobject.signal_accumulator_true_handled - - gobject.add_emission_hook - type - name - callback - ... - - gobject.remove_emission_hook - type - name - hook_id - - gobject._install_metaclass - metaclass - - - - - - - Description - - These functions are part of the PyGTK gobject -module but are not directly associated with a specific class. - - - - Many functions that previously were in this namespace got moved to glib namespace instead. They - are still available in gobject for backward compatibility, but - not documented here. If you miss documentation for some function, be sure to - check glib first. - - - - - - - Functions - - - gobject.type_name - - - gobject.type_name - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - - - - - The gobject.type_name() function returns -the unique name that is assigned to the specified -type. type can be a GObject -type, type ID or instance. This function raises a TypeError exception -if type isn't a PyGTK type. - - - - - gobject.type_from_name - - - gobject.type_from_name - type_name - - - - type_name : - a string containing the name of a -type - - - Returns : - the type ID named -type_name - - - - The gobject.type_from_name() function -returns the type ID of the PyGTK type with the name -specified by type_name. This function raises a -RuntimeError exception if no type matches -type_name. - - - - - gobject.type_parent - - - gobject.type_parent - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - the parent type ID - - - - The gobject.type_parent() function returns -the direct parent type ID of the specified type. -type can be a GObject type, type ID or instance. If -type has no parent, i.e. is a fundamental type, the -RuntimeError exception is raised. - - - - - gobject.type_is_a - - - gobject.type_is_a - type - parent_type - - - - type : - a GObject type, type ID or -instance - - - parent_type : - a GObject type, type ID or -instance - - - Returns : - True if -parent_type is an ancestor of -type - - - - The gobject.type_is_a() function returns -True if the specified type is a -descendant of the type specified by parent_type. This -function also returns True if -parent_type is an interface and -type conforms to it. - - - - - gobject.type_children - - - gobject.type_children - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - a list of the child types of -type - - - - The gobject.type_children() function -returns a list containing the child types of the specified -type. - - - - - gobject.type_interfaces - - - gobject.type_interfaces - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - a list of the interface types supported by -type - - - - The gobject.type_interfaces() function -returns a list of the interface types supported by -type. type can be a GObject -type, type ID or instance. This function returns a RuntimeError exception if -type is not a valid type or has no interfaces. - - - - - gobject.type_register - - - gobject.type_register - class - - - - class : - a Python class that is a descendant of gobject.GObject - - - - The gobject.type_register() function -registers the specified Python class as a PyGTK type. -class must be a descendant of gobject.GObject. The function generates a name for the new type. - - - - - gobject.signal_new - - - gobject.signal_new - signal_name - type - flags - return_type - param_types - - - - signal_name : - a string containing the name of the -signal - - - type : - the object type that the signal is associated -with - - - flags : - the signal flags - - - return_type : - the return type of the signal -handler - - - param_types : - the parameter types passed to the signal -handler - - - Returns : - a unique integer signal ID - - - - The gobject.signal_new() function registers -a signal with the specified signal_name for the -specified object type. The value of -flags is a combination of: - - - - gobject.SIGNAL_RUN_FIRST - - Invoke the object method handler in the first emission -stage. - - - - gobject.SIGNAL_RUN_LAST - - Invoke the object method handler in the third emission -stage. - - - - gobject.SIGNAL_RUN_CLEANUP - - Invoke the object method handler in the last emission -stage. - - - - gobject.SIGNAL_NO_RECURSE - - Signals being emitted for an object while currently -being in emission for this very object will not be emitted recursively, but -instead cause the first emission to be restarted. - - - - gobject.SIGNAL_DETAILED - - This signal supports "::detail" appendixes to the -signal name upon handler connections and emissions. - - - - gobject.SIGNAL_ACTION - - Action signals are signals that may freely be emitted -on alive objects from user code via gobject.emit()() -and friends, without the need of being embedded into extra code that -performs pre or post emission adjustments on the object. They can also be -thought of as generically callable object methods. - - - - gobject.SIGNAL_NO_HOOKS - - No emissions hooks are supported for this -signal. - - - - - return_type is the type of the return -value from a signal handler and may be a gobject type, type ID or instance. -The param_types parameter is a list of additional -types that are passed to the signal handler. Each parameter type may be -specified as a gobject type, type ID or instance. For example, to add a -signal to the gtk.Window type called "my-signal" that calls a handler with a -gtk.Button widget and an integer value and a return value that is a -boolean, use: - - - gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT)) - - - - - - gobject.signal_list_names - - - gobject.signal_list_names - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - a list of the signal names supported by -type - - - - The gobject.signal_list_names() function -returns a list of the names of the signals that are supported by the -specified GObject type - - - The type keyword is available in PyGTK 2.6 and above. - - - - - - gobject.signal_list_ids - - - gobject.signal_list_ids - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - a list of the signal ids supported by -type - - - - - This method is available in PyGTK 2.6 and above. - - - The gobject.signal_list_ids() function -returns a list of the integer ids of the signals that are supported by the -GObject specified by type - - - - - gobject.signal_lookup - - - gobject.signal_lookup - name - type - - - - name : - the name of a signal for -type - - - type : - a GObject type, type ID or -instance - - - Returns : - the integer id of a signal supported by -type or 0. - - - - - This method is available in PyGTK 2.6 and above. - - - The gobject.signal_lookup() function -returns the id of the signal with the name specified by -name that is supported by the GObject specified -specified bytype. 0 is returned if the signal is not -found. - - - - - gobject.signal_name - - - gobject.signal_name - signal_id - - - - signal_id : - an integer signal id - - - Returns : - the name of the signal or -None. - - - - - This method is available in PyGTK 2.6 and above. - - - The gobject.signal_name() function returns -the name of the signal that has the signal id specified by -id. - - - - - gobject.signal_query - - - gobject.signal_query - name - type - - - - name : - the name of a signal for -type - - - type : - a GObject type, type ID or -instance - - - Returns : - a 6-tuple containing signal information or -None - - - - - This method is available in PyGTK 2.6 and above. - - - The gobject.signal_query() function returns -a 6-tuple containing information about the signal with the name specified by -name that is supported by the GObject specified by -type. If the signal is not found -None is returned. - - The signal information 6-tuple contains: - - - - the integer signal id - - - the signal name - - - the GType that the signal is registered for - - - the signal flags (see the ) - - - the GType of the return from the signal callback -function - - - a tuple containing the GTypes of the parameters that are -passed to the signal callback function. Note that these may not correspond -exactly to the PyGTK signal callback parameters. - - - - - - - gobject.signal_query - - - gobject.signal_query - signal_id - - - - signal_id : - the integer id of a signal - - - Returns : - a 6-tuple containing signal information or -None - - - - - This method is available in PyGTK 2.6 and above. - - - The gobject.signal_query() function returns -a 6-tuple containing information about the signal with the id specified by -signal_id. If the signal is not found -None is returned. - - The signal information 6-tuple contains: - - - - the integer signal id - - - the signal name - - - the GType that the signal is registered for - - - the signal flags (see the ) - - - the GType of the return from the signal callback -function - - - a tuple containing the GTypes of the parameters that are -passed to the signal callback function. Note that these may not correspond -exactly to the PyGTK signal callback parameters. - - - - - - - gobject.list_properties - - - gobject.list_properties - type - - - - type : - a GObject type, type ID or -instance - - - Returns : - a list of the properties (as GParam objects) -supported by type - - - - The gobject.list_properties() function -returns a list of the properties (as GParam objects) supported by -type. - - - - - gobject.new - - - gobject.new - type - ... - - - - type : - a GObject type, type ID or -instance - - - ... : - zero or more property-value -pairs - - - Returns : - a new object if the specified -type - - - - The gobject.new() function returns a new -object of the specified type. type must specify a -type that is a descendant of gobject.GObject. A -TypeError exception is raised if type specifies an -abstract class or a type that is not a descendant of gobject.GObject. A set -of property-value pairs may be specified to set the value of the object's -properties. - - - - - gobject.signal_accumulator_true_handled - - - gobject.signal_accumulator_true_handled - - - - This function is available in PyGTK 2.8 and above. - - - The signal_accumulator_true_handled() - function is only used as accumulator argument when registering - signals. - - - - - gobject.add_emission_hook - - - gobject.add_emission_hook - type - name - callback - ... - - - - type : - a Python GObject instance or - type - - - name : - a signal name - - - callback : - a function - - - ... : - zero or more extra arguments that will be - passed to callback. - - - Returns : - the hook id, for later use with gobject.signal_remove_emission_hook(). - - - - This function is available in PyGTK 2.8 and above. - - - The add_emission_hook() function adds an - emission hook for the signal specified by name, - which will get called for any emission of that signal, independent of - the instance. This is possible only for signals which don't have the - gobject.SIGNAL_NO_HOOKS flag set. - - - - - gobject.remove_emission_hook - - - gobject.remove_emission_hook - type - name - hook_id - - - - type : - a Python GObject instance or - type - - - name : - a signal name - - - hook_id : - the id of the emission hook as returned by the - gobject.add_emission_hook()) - function. - - - Returns : - - - - - This function is available in PyGTK 2.8 and above. - - - The remove_emission_hook() function deletes - an emission hook. - - - - - gobject._install_metaclass - - - gobject._install_metaclass - metaclass - - - - metaclass : - - - - - This function is available in PyGTK 2.10 and above. - - - The _install_metaclass() function installs - the metaclass specified by metaclass. - - - - - - diff --git a/docs/reference/pygobject-gboxed.xml b/docs/reference/pygobject-gboxed.xml deleted file mode 100644 index f7f2438..0000000 --- a/docs/reference/pygobject-gboxed.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - gobject.GBoxed - an object containing an opaque chunk of data - - - - Synopsis - - - gobject.GBoxed - - copy - - - - - - - Ancestry - -+-- gobject.GBoxed - - - - - - Description - - gobject.GBoxed -is an abstract base class that encapsulates an opaque chunk of data to -provide an object-oriented interface and a type that is registered with the -GLIB type system. A boxed type is registered with -functions that provide for the copying and freeing of the underlying data -structure - this allows PyGTK to encapsulate these as Python objects. - - - - - Methods - - - gobject.GBoxed.copy - - - copy - - - - Returns : - a copy of the gobject.GBoxed - object - - - - The copy() method makes and returns a copy of the boxed object. - - - - - - diff --git a/docs/reference/pygobject-ginterface.xml b/docs/reference/pygobject-ginterface.xml deleted file mode 100644 index 1b29ddf..0000000 --- a/docs/reference/pygobject-ginterface.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - gobject.GInterface - - an object representing a GInterface - - - - Synopsis - - - gobject.GInterface - - - - - - Ancestry - -+-- gobject.GInterface - - - - - - Description - - gobject.GInterface -is an abstract base class that encapsulates a GInterface. - - - - diff --git a/docs/reference/pygobject-gpointer.xml b/docs/reference/pygobject-gpointer.xml deleted file mode 100644 index da16954..0000000 --- a/docs/reference/pygobject-gpointer.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - gobject.GPointer - - an object containing a completely opaque chunk of - data - - - - Synopsis - - - gobject.GPointer - - - - - - Ancestry - -+-- gobject.GPointer - - - - - - Description - - gobject.GPointer -is an abstract base class that encapsulates an opaque chunk of data and -registers it with the GLIB type system. A pointer type -has no methods and generic ways of copying and freeing the data. It -shouldn't be used in PyGTK. - - - - diff --git a/docs/reference/pygobject-introduction.xml b/docs/reference/pygobject-introduction.xml deleted file mode 100644 index fb3e6f2..0000000 --- a/docs/reference/pygobject-introduction.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - Introduction - - This document describes many of the PyGObject - version 2.12 classes and their methods and associated - functions. Deprecated classes, functions and methods have been - specifically left out of this reference though classes that have become - deprecated since PyGObject 2.0 have been left in but annotated with a - deprecation warning. This document attempts to document as much of the - PyGObject API as possible but there - are undoubtedly errors and omissions. If you discover any of these please - file a bug report at bugzilla.gnome.org for the - pygobject project. Specific areas that have not been - documented include: - - - - The GParamSpec class - - - - This reference describes the API for PyGObject as - of version 2.11.0+ and assumes that the additional API changes for version - 2.12 will not be significant. There will undoubtedly be changes that are - not reflected in this reference. The differences in the API between - version 2.0 and previous versions are denoted in this reference with a - Note that describes the availability of the object, constructor, method or - function. Any of these that do not have a notation can be assumed to be - available in all versions of PyGObject from 2.0 and up. The source code - must be consulted if this reference and your version of - PyGObject seem to differ. You are encouraged to use the - latest version of PyGObject that is available. See the - PyGTK - homepage for more information and more resources on how to use - PyGObject as well as help in its development. - - The Reference contains a chapter for each - PyGObject module containing the class descriptions. The - class descriptions are arranged alphabetically within the - chapters. Currently there is one module chapter: - - - - The gobject module - The classes that are included in the -gobject module of PyGObject and are -accessed similar to: gobject.GObject. These classes are the base object -classes that the gtk and gtk.gdk -module classes are built on. - - - - - - - - Reference Page Format - - Each PyGObject class is described in a reference -page that has a number of sections in a fixed format. Each reference page -will have a subset of the following sections: - - - - Name - - The name and a one-line description of the -class. - - - - Synopsis - - A synopsis of the class and its methods and -optionally a list of associated functions. - - - - Ancestry - - The list of the parent classes of the class. This -section may not be present in all class descriptions. - - - - Properties - - A list of the properties (internal state) -supported by the class. This section may not be present in all classes. The -property descriptions include the name, the access operations (e.g. Read, -Write), and a brief description. Properties are accessed using the gobject.set_property() -and gobject.get_property() -methods that are available to every PyGObject object. This -section may not be present in all class descriptions. - - - - Attributes - - A set of internal object state data accessible as Python - attributes (e.g. object.attr). The attribute descriptions include - a name by which the attribute data is accessed, the access mode - (e.g. Read, Write), and a brief description of the attribute. Most - PyGObject classes do not support attributes so - this section is not present in most class descriptions. - - - - Signal Prototypes - - A list of the signals supported by the class including - the signal name and a synopsis of the signal handler function - prototype. This section may not be present in all class - descriptions. - - - - Description - A description of the class and possibly some of - the methods supported by the class. - - - - Constructor - - The description of the class object constructor including - the synopsis with brief parameter descriptions and a description - of th use of the constructor. There may be more than one - constructor description if the constructor supports different - parameter lists. This section may not be present in all class - descriptions. - - - - Methods - - A list of methods supported by the class. Each method - description includes: a synopsis of the method and its parameters - as well as a brief description of each parameter and return value - (if any); and, a description of the use of the method. - - - - Functions - - A list of related functions. Each function description - includes a synopsis of the function and its parameters and return - value (if any), and a description of the use of the - function. - - - - Signals - - A list of signals including a synopsis of the signal - handler prototype function with its parameters and return value - (if any). The signal emission conditions are briefly - described. This section is not present in all class descriptions; - specifically, the gtk.gdk classes do not - usually support signals. - - - - - The function and method synopsis parameters are displayed in - bold to denote Python keyword - parameters. Also if the parameter is optional its default value will be - displayed. For example the gobject.signal_lookup() - function synopsis is: - - - - gobject.signal_lookup - name - type - - - - The parameters name and - type are keyword parameters that can be specified - in a call either by position or keyword (in which case position is not - important). The following calls have the same result: - - - id = gobject.signal_lookup("clicked", gtk.Button) - id = gobject.signal_lookup("clicked", type=gtk.Button) - id = gobject.signal_lookup(name="clicked", type=gtk.Button) - id = gobject.signal_lookup(type=gtk.Button, name="clicked") - - - Parameters that are not keyword parameters are displayed in -italic and must be specified positionally but may also -be optional. - - - - diff --git a/docs/reference/pygobject-ref.xml b/docs/reference/pygobject-ref.xml deleted file mode 100644 index ee90a55..0000000 --- a/docs/reference/pygobject-ref.xml +++ /dev/null @@ -1,34 +0,0 @@ - - -%entities; - -]> - - - - &builddate; - PyGObject Reference Manual - for version &version; - for PyGObject version &version; - - This reference describes the classes of the python gobject -module. - - - - - - - - - - - - - diff --git a/docs/reference/pygobject.xml b/docs/reference/pygobject.xml deleted file mode 100644 index 42cd37b..0000000 --- a/docs/reference/pygobject.xml +++ /dev/null @@ -1,1016 +0,0 @@ - - - - - gobject.GObject - 3 - PyGTK Docs - - - - gobject.GObject - the base class - - - - Synopsis - - - gobject.GObject - - get_property - property_name - - - get_properties - first_property_name - ... - - - set_property - property_name - value - - - set_properties - property_name - value - ... - - - freeze_notify - - - notify - property_name - - - thaw_notify - - - get_data - key - - - set_data - key - data - - - connect - detailed_signal - handler - - - connect_after - detailed_signal - handler - - - connect_object - detailed_signal - handler - - - connect_object_after - detailed_signal - handler - - - disconnect - handler_id - - - handler_disconnect - handler_id - - - handler_is_connected - handler_id - - - handler_block - handler_id - - - handler_unblock - handler_id - - - handler_block_by_func - callable - - - handler_unblock_by_func - callable - - - emit - detailed_signal - - - stop_emission - detailed_signal - - - emit_stop_by_name - detailed_signal - - - chain - - - - - - - Ancestry - -+-- gobject.GObject - - - - - - Attributes - -
- - - - - - - - - - "props" - Read/Write - - This attribute gives full access to GObject properties as - simple attributes. It can be used to iterate over all the object - properties, and can be used both on class or instance objects. - Examples: - -button = Button() -button_label = button.props.label -button.props.label = 'Click on this fancy button' -for pspec in button.props: - print pspec - print button.get_property(pspec.name) -label_pspec = Button.props.label -button_label = button.get_property(label_pspec.name) - - - - - "__doc__" - Read - The documentation for the object type. Uses - "__gdoc__" if no specific documentation set. - - - "__gdoc__" - Read - The generated documentation for the underlying GObject - type. - - - "__gtype__" - Read - The underlying GObject type. - - - "__grefcount__" - Read - The reference count for the underlying GObject. - - - - - -
- -
- - - gobject.GObject Signal Prototypes - - - - - "notify" - - callback - gobject - property_spec - user_param1 - ... - - - - - - - - - Description - The gobject.GObject - class is the base class providing the common attributes and methods for - the PyGTK classes. The gobject.GObject - class is not a user interface widget class. - - The gobject.GObject - class provides the signal management methods, the object property access - methods and the object data management methods. - - - - - Methods - - - gobject.GObject.get_property - - - get_property - property_name - - - - property_name : - a string containing the property name for the -GObject - - - Returns : - a Python object containing the value of the -property - - - - The get_property() method returns the -value of the property specified by property_name or -None if there is no value associated with the property. - The TypeError exception is raised -if the property name is not registered with the object class. - - - - - gobject.GObject.get_properties - - - get_properties - first_property_name - ... - - - - first_property_name : - a string containing the first property name for the -GObject - - - ... : - additional property names - - - - Returns : - a tuple containing the property values -requested - - - - The get_properties() method returns a tuple containing -the values of the properties requested, or -None if there is no value associated with the property. - The TypeError exception is raised -if the property name is not registered with the object class. - - - - - gobject.GObject.set_property - - - set_property - property_name - value - - - - property_name : - a string containing the property -name - - - value : - a Python object containing the property value -to be set - - - - The set_property() method sets the -property specified by property_name to the specified -value. - The TypeError exception is raised -if the property name is not registered with the object class or if the value -specified could not be converted to the property type. - - - - - gobject.GObject.set_properties - - - set_properties - property_name - value - ... - - - - property_name : - the property name - - - value : - a Python object containing the property value -to be set - - - ... : - additional property name and value -kwargs - - - - The set_properties() method sets the -property specified by property_name to the specified -value, followed by pairs of property name -and value as keyword arguments. - The TypeError exception is raised -if the property name is not registered with the object class or if the value -specified could not be converted to the property type. - - - - - gobject.GObject.freeze_notify - - - freeze_notify - - - - The freeze_notify() method freezes the -object's property-changed notification queue so that "notify" signals are -blocked until the thaw_notify() method is -called. - - - - - gobject.GObject.notify - - - notify - property_name - - - - property_name : - a string containing a property -name - - - - The notify() method causes the "notify" -signal for the property specified by property_name to -be emitted. - - - - - gobject.GObject.thaw_notify - - - thaw_notify - - - - The thaw_notify() method thaws the -object's property-changed notification queue so that "notify" signals are -emitted. - - - - - gobject.GObject.get_data - - - get_data - key - - - - key : - a string used as the key - - - Returns : - a Python object containing the associated -data - - - - The get_data() method returns the -Python object associated with the specified key or -None if there is no data associated with the key or -if there is no key associated with the object. - - - - - gobject.GObject.set_data - - - set_data - key - data - - - - key : - a string used as a key - - - data : - a Python object that is the value to be -associated with the key - - - - The set_data() method associates the -specified Python object (data) with -key. - - - - - gobject.GObject.connect - - - connect - detailed_signal - handler - ... - - - - detailed_signal : - a string containing the signal -name - - - handler : - a Python function or method -object. - - - ... : - additional optional -parameters - - - Returns : - an integer identifier - - - - The connect() method adds a function or -method (handler)to the end of the list of signal -handlers for the named detailed_signal but before the -default class signal handler. An optional set of parameters may be specified -after the handler parameter. These will all be passed -to the signal handler when invoked. - For example if a function handler was connected to a signal -using: - - handler_id = object.connect("signal_name", handler, arg1, arg2, arg3) - - The handler should be defined as: - - def handler(object, arg1, arg2, arg3): - - A method handler connected to a signal using: - - handler_id = object.connect("signal_name", self.handler, arg1, arg2) - - requires an additional argument when defined: - - def handler(self, object, arg1, arg2) - - A TypeError exception is raised -if detailed_signal identifies a signal name that is -not associated with the object. - - - - - gobject.GObject.connect_after - - - connect_after - detailed_signal - handler - ... - - - - detailed_signal : - a string containing the signal -name - - - handler : - a Python function or method -object - - - ... : - additional optional -parameters - - - Returns : - an integer handler -identifier - - - - The connect_after() method is similar -to the connect() method except that the -handler is added to the signal handler list after the -default class signal handler. Otherwise the details of -handler definition and invocation are the -same. - - - - - gobject.GObject.connect_object - - - connect_object - detailed_signal - handler - gobject - - - - detailed_signal : - a string containing the signal -name - - - handler : - a Python function or method -object - - - gobject : - a GObject - - - Returns : - an integer handler -identifier - - - - The connect_object() method is the same -as the connect() method except that the -handler is invoked with the specified -gobject in place of the object invoking the -connect_object() method. For example, a call with a -function handler: - - handler_id = object("signal_name", handler, gobject) - - will cause the handler to be invoked -as: - - handler(gobject) - - Likewise a method handler will be invoked as: - - self.handler(gobject) - - This can be helpful in invoking PyGTK widget methods that -require no arguments except the widget itself (e.g. -widget.destroy()) by using the class method as the -handler. For example, a Button "clicked" signal can be set up to invoke the -Window destroy() method as: - - - handler_id = button.connect_object("clicked", Window.destroy, window) - - - When the button is clicked the handler is invoked as: - - - Window.destroy(window) - - - which is the same as: - - - window.destroy() - - - Additional arguments may be passed to the handler as with the -connect() method handler invocations. - - - - - gobject.GObject.connect_object_after - - - connect_object_after - detailed_signal - handler - - - - detailed_signal : - a string containing the signal -name - - - handler : - a Python function or method -object - - - gobject : - a GObject - - - Returns : - an integer handler -identifier - - - - The connect_object_after() method is -similar to the connect_object() method except that -the handler is added to the signal handler list after -the default class signal handler. Otherwise the details of -handler definition and invocation are the -same. - - - - - gobject.GObject.disconnect - - - disconnect - handler_id - - - - handler_id : - an integer handler -identifier - - - - The disconnect() method removes the -signal handler with the specified handler_id from the -list of signal handlers for the object. - - - - - gobject.GObject.handler_disconnect - - - handler_disconnect - handler_id - - - - handler_id : - an integer handler -identifier - - - - The handler_disconnect() method removes -the signal handler with the specified handler_id from -the list of signal handlers for the object. - - - - - gobject.GObject.handler_is_connected - - - handler_is_connected - handler_id - - - - handler_id : - an integer handler -identifier - - - Returns : - True if the signal handler -is connected to the object. - - - - The handler_is_connected() method -returns True if the signal handler with the specified -handler_id is connected to the object. - - - - - gobject.GObject.handler_block - - - handler_block - handler_id - - - - handler_id : - an integer handler -identifier - - - - The handler_block() method blocks the -signal handler with the specified handler_id from -being invoked until it is unblocked. - - - - - gobject.GObject.handler_unblock - - - handler_unblock - handler_id - - - - handler_id : - an integer handler -identifier - - - - - - - gobject.GObject.handler_block_by_func - - - handler_block_by_func - callable - - - - callable : - a callable python object - - - - The handler_block_by_func() method blocks the -all signal handler connected to a specific callable from -being invoked until the callable is unblocked. - - - - - gobject.GObject.handler_unblock_by_func - - - handler_unblock_by_func - callback - - - - callable : - a callable python object - - - - The handler_unblock_by_func() method unblocks -all signal handler connected to a specified callable -thereby allowing it to be invoked when the associated signals are -emitted. - - - - - gobject.GObject.emit - - - emit - detailed_signal - ... - - - - detailed_signal : - a string containing the signal -name - - - ... : - additional parameters - - - Returns : - a PyObject* - - - The emit() method causes the object to -emit the signal specified by detailed_signal. The -additional parameters must match the number and type of the required signal -handler parameters. In most cases no additional parameters are needed. for -example: - - button.emit("clicked") - - is all that is required to emit the "clicked" signal for a -button. The most common case requiring additional parameters occurs when -emitting an event signal; for example: - - button.emit("button_press_event", event) - - - - - - gobject.GObject.stop_emission - - - stop_emission - detailed_signal - - - - detailed_signal : - a string containing the signal -name - - - - The stop_emission() method stops the -current emission of the signal specified by -detailed_signal. Any signal handlers in the list -still to be run will not be invoked. - - - - - gobject.GObject.emit_stop_by_name - - - emit_stop_by_name - detailed_signal - - - - detailed_signal : - a string containing the signal -name - - - - The emit_stop_by_name() method stops -the current emission of the signal specified by -detailed_signal. Any signal handlers in the list -still to be run will not be invoked. - - - - - gobject.GObject.chain - - - chain - ... - - - - ... : - additional parameters - - - Returns : - a Python object - - - - The chain() method does something. - - - - - - - Signals - - - The GObject "notify" Signal - - - callback - gobject - property_spec - user_param1 - ... - - - - - gobject : - the gobject that received the -signal - - - property_spec : - the gobject.GParamSpec of the property that was -changed - - - user_param1 : - the first user parameter (if any) specified -with the connect() -method - - - ... : - additional user parameters (if -any) - - - - The "notify" signal is emitted on a gobject when one of its -properties has been changed. Note that getting this signal doesn't guarantee -that the value of the property has actually changed, it may also be emitted -when the setter for the property is called to reinstate the previous -value. For example to be notified of the change of the title of a gtk.Window you could -connect to the "notify" signal similar to: - - - window.connect("notify::title", callback) - - - - - - -
diff --git a/docs/style.css b/docs/style.css deleted file mode 100644 index 59abc74..0000000 --- a/docs/style.css +++ /dev/null @@ -1,10 +0,0 @@ -.programlisting { -font: monospace; -background-color: #E0E0E0; -padding: 5; -} - -pre.synopsis { -background-color: #E0E0E0; -padding: 5; -} diff --git a/docs/xsl/common.xsl b/docs/xsl/common.xsl deleted file mode 100644 index 606313f..0000000 --- a/docs/xsl/common.xsl +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/docs/xsl/devhelp.xsl b/docs/xsl/devhelp.xsl deleted file mode 100644 index ce27739..0000000 --- a/docs/xsl/devhelp.xsl +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - book - - - .devhelp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - diff --git a/docs/xsl/fixxref.py b/docs/xsl/fixxref.py deleted file mode 100644 index f3287b3..0000000 --- a/docs/xsl/fixxref.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- - -import getopt -import os -import re -import sys - -anchors = {} -anchor_pat = re.compile(r'''^\s*''', - re.MULTILINE | re.VERBOSE) -link_pat = re.compile(r'''(.*?) - ''', re.DOTALL | re.VERBOSE) -def scan_index_dir(idir): - for root, dirs, files in os.walk(idir): - if 'index.sgml' in files: - scan_index_file(os.path.join(root, 'index.sgml')) - return - -def scan_index_file(ifile): - buf = open(ifile).read() - for id, href in anchor_pat.findall(buf): - anchors[id] = href - -def fix_xrefs(hdir): - for f in os.listdir(hdir): - if os.path.splitext(f)[1] == '.html': - fix_html_file(os.path.join(hdir, f)) - -def link_subst(m): - id, text = m.groups() - if anchors.has_key(id): - return '' + text + '' - return text - -def fix_html_file(hfile): - buf = open(hfile).read() - buf = link_pat.sub(link_subst, buf) - open(hfile, 'w').write(buf) - -def usage(e=None): - if e: - sys.stderr.write('fixxref.py: %s\n' % e) - sys.stderr.write('usage: fixxref.py [-i index-dir] html-dir\n') - sys.exit(1) - -if __name__ == '__main__': - try: - opts, args = getopt.getopt(sys.argv[1:], "i:h:", - ["index-dir=", "html-dir="]) - except getopt.error, e: - usage(e) - - index_dirs = [] - for opt, arg in opts: - if opt in ('-i', '--index-dir'): - index_dirs.append(arg) - - if len(args) != 1: - usage() - - for idir in index_dirs: - scan_index_dir(idir) - - html_dir = args[0] - fix_xrefs(html_dir) diff --git a/docs/xsl/fixxref.py.in b/docs/xsl/fixxref.py.in deleted file mode 100644 index f3287b3..0000000 --- a/docs/xsl/fixxref.py.in +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python; py-indent-offset: 4 -*- - -import getopt -import os -import re -import sys - -anchors = {} -anchor_pat = re.compile(r'''^\s*''', - re.MULTILINE | re.VERBOSE) -link_pat = re.compile(r'''(.*?) - ''', re.DOTALL | re.VERBOSE) -def scan_index_dir(idir): - for root, dirs, files in os.walk(idir): - if 'index.sgml' in files: - scan_index_file(os.path.join(root, 'index.sgml')) - return - -def scan_index_file(ifile): - buf = open(ifile).read() - for id, href in anchor_pat.findall(buf): - anchors[id] = href - -def fix_xrefs(hdir): - for f in os.listdir(hdir): - if os.path.splitext(f)[1] == '.html': - fix_html_file(os.path.join(hdir, f)) - -def link_subst(m): - id, text = m.groups() - if anchors.has_key(id): - return '' + text + '' - return text - -def fix_html_file(hfile): - buf = open(hfile).read() - buf = link_pat.sub(link_subst, buf) - open(hfile, 'w').write(buf) - -def usage(e=None): - if e: - sys.stderr.write('fixxref.py: %s\n' % e) - sys.stderr.write('usage: fixxref.py [-i index-dir] html-dir\n') - sys.exit(1) - -if __name__ == '__main__': - try: - opts, args = getopt.getopt(sys.argv[1:], "i:h:", - ["index-dir=", "html-dir="]) - except getopt.error, e: - usage(e) - - index_dirs = [] - for opt, arg in opts: - if opt in ('-i', '--index-dir'): - index_dirs.append(arg) - - if len(args) != 1: - usage() - - for idir in index_dirs: - scan_index_dir(idir) - - html_dir = args[0] - fix_xrefs(html_dir) diff --git a/docs/xsl/html.xsl b/docs/xsl/html.xsl deleted file mode 100644 index d8fea78..0000000 --- a/docs/xsl/html.xsl +++ /dev/null @@ -1,285 +0,0 @@ - - - -]> - - - -style.css - - - - - - - - -
- - - - - - - - - - - - - - - - - -
  - -  
- -- - -  
-
- - - - - -
- -
-
- -
- -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
-      class 
-      
-      
-        (
-                )
-      
-      :&RE;
-
-      
-    
-
- - - - - - - - , - - - - - - - - - -   - - - - - - , - - - - - - - - - , - - - - - - - - - , - - - - - - - - -      - - - - - - - - -   - - - - - - -   - - - - - - = - - - - - - - void  - - - - - - - - - - - - , - - - - - - - - - - def - - ( - - ) - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
diff --git a/docs/xsl/pdf-style.xsl b/docs/xsl/pdf-style.xsl deleted file mode 100644 index d4a8e02..0000000 --- a/docs/xsl/pdf-style.xsl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/docs/xsl/pdf.xsl b/docs/xsl/pdf.xsl deleted file mode 100644 index 013bfd0..0000000 --- a/docs/xsl/pdf.xsl +++ /dev/null @@ -1,259 +0,0 @@ - - - -]> - - - -0.5in - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - class - - - ( - - ) - -  : - - - - - &RE; - - - - - - - - - , - - - - - - -   - - - - - , - - - - - - - , - - - - - - - , - - - - - - -      - - - - - - - -   - - - - -   - - - - = - - - - - void  - - - - - - - - - , - - - - - - - - def - - ( - - ) - - - - - - - - - ( - - ) - - - - - - - - - - - - - diff --git a/docs/xsl/ref-html-style.xsl b/docs/xsl/ref-html-style.xsl deleted file mode 100644 index a152077..0000000 --- a/docs/xsl/ref-html-style.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - <ANCHOR id=" - - " href=" - - - / - - - "> - - - - - - - - - - - - - - - - - - - diff --git a/dsextras.py b/dsextras.py deleted file mode 100644 index b2c9e90..0000000 --- a/dsextras.py +++ /dev/null @@ -1,509 +0,0 @@ -# -*- coding: utf-8 -*- -# -# dsextras.py - Extra classes and utilities for distutils, -# adding pkg-config support - - -import os -import sys -import fnmatch -import re -import string - -from distutils import dep_util -from distutils.command.build_ext import build_ext -from distutils.command.install_lib import install_lib -from distutils.command.install_data import install_data -from distutils.extension import Extension -from distutils.spawn import find_executable - -try: - import codegen.createdefs - from codegen.override import Overrides - from codegen.defsparser import DefsParser - from codegen.codegen import register_types, SourceWriter, FileOutput -except ImportError: - template_classes_enabled = False -else: - template_classes_enabled = True - - -GLOBAL_INC = [] -GLOBAL_MACROS = [] - -codegen_error_message=''' -*************************************************************************** -Codegen could not be found on your system and is required by the -dsextras.Template and dsextras.TemplateExtension classes. -*************************************************************************** -''' - - -def get_m4_define(varname): - '''Return the value of a m4_define variable as set in configure.in.''' - pattern = re.compile('m4_define\(' + varname + '\,\s*(.+)\)') - - if os.path.exists('configure.ac'): - fname = 'configure.ac' - elif os.path.exists('configure.in'): - fname = 'configure.in' - else: - raise SystemExit('ERROR: Could not find configure file') - - for line in open(fname).readlines(): - match_obj = pattern.match(line) - - if match_obj: - return match_obj.group(1) - - return None - -def getoutput(cmd): - '''Return output (stdout or stderr) of executing cmd in a shell.''' - return getstatusoutput(cmd)[1] - -def getstatusoutput(cmd): - '''Return (status, output) of executing cmd in a shell.''' - if sys.platform == 'win32': - pipe = os.popen(cmd, 'r') - text = pipe.read() - sts = pipe.close() or 0 - - while text[-1:] in ['\n', '\r']: - text = text[:-1] - - return sts, text - else: - from commands import getstatusoutput - return getstatusoutput(cmd) - -def have_gcc(): - '''Checks for the existence of gcc''' - if find_executable('gcc'): - return True - -def have_pkgconfig(): - '''Checks for the existence of pkg-config''' - if find_executable('pkg-config'): - return True - -def list_files(dir): - '''List all files in a dir, with filename match support: - for example: glade/*.glade will return all files in the glade directory - that matches *.glade. It also looks up the full path''' - if dir.find(os.sep) != -1: - parts = dir.split(os.sep) - dir = string.join(parts[:-1], os.sep) - pattern = parts[-1] - else: - pattern = dir - dir = '.' - - dir = os.path.abspath(dir) - retval = [] - - for file in os.listdir(dir): - if fnmatch.fnmatch(file, pattern): - retval.append(os.path.join(dir, file)) - - return retval - -def pkgc_version_check(name, req_version): - '''Check the existence and version number of a package: - returns False if not installed or too old, True otherwise.''' - is_installed = not os.system('pkg-config --exists %s' % name) - - if not is_installed: - return False - - orig_version = pkgc_get_version(name) - version = map(int, orig_version.split('.')) - pkc_version = map(int, req_version.split('.')) - - if version >= pkc_version: - return True - - return False - -def pkgc_get_version(name): - '''return the version as return by pkg-config --modversion''' - return getoutput('pkg-config --modversion %s' % name) - -def pkgc_get_libraries(name): - '''returns a list of libraries as returned by pkg-config --libs-only-l''' - output = getoutput('pkg-config --libs-only-l %s' % name) - return output.replace('-l', '').split() - -def pkgc_get_library_dirs(name): - '''returns a list of library dirs as returned by pkg-config --libs-only-L''' - output = getoutput('pkg-config --libs-only-L %s' % name) - return output.replace('-L', '').split() - -def pkgc_get_include_dirs(name): - '''returns a list of include dirs as returned by pkg-config --cflags-only-I''' - output = getoutput('pkg-config --cflags-only-I %s' % name) - return output.replace('-I', '').split() - -def pkgc_get_defs_dir(name): - '''returns the defs dir as returned by pkg-config --variable=defsdir''' - output = getoutput('pkg-config --variable=defsdir %s' % name) - return output - - -class BuildExt(build_ext): - def init_extra_compile_args(self): - self.extra_compile_args = [] - - if sys.platform == 'win32' and self.compiler.compiler_type == 'mingw32': - if not have_gcc(): - raise SystemExit('ERROR: Could not find gcc.') - - # MSVC compatible struct packing is required. - # Note gcc2 uses -fnative-struct while gcc3 - # and gcc4 use -mms-bitfields. Based on the - # version the proper flag is used below. - msnative_struct = {'2': '-fnative-struct', - '3': '-mms-bitfields', - '4': '-mms-bitfields'} - gcc_version = getoutput('gcc -dumpversion') - - print ('using MinGW GCC version %s with %s option' % \ - (gcc_version, msnative_struct[gcc_version[0]])) - - self.extra_compile_args.append(msnative_struct[gcc_version[0]]) - - def modify_compiler(self): - if sys.platform == 'win32' and self.compiler.compiler_type == 'mingw32': - if not have_gcc(): - raise SystemExit('ERROR: Could not find gcc.') - - # Remove '-static' linker option to prevent MinGW ld - # from trying to link with MSVC import libraries. - if self.compiler.linker_so.count('-static'): - self.compiler.linker_so.remove('-static') - - def build_extensions(self): - # Init self.extra_compile_args - self.init_extra_compile_args() - # Modify default compiler settings - self.modify_compiler() - # Invoke base build_extensions() - build_ext.build_extensions(self) - - def build_extension(self, ext): - # Add self.extra_compile_args to ext.extra_compile_args - ext.extra_compile_args += self.extra_compile_args - - # Generate eventual templates before building - if hasattr(ext, 'generate'): - ext.generate() - - # Filter out 'c' and 'm' libs when compilic w/ msvc - if sys.platform == 'win32' and self.compiler.compiler_type == 'msvc': - save_libs = ext.libraries - ext.libraries = [lib for lib in ext.libraries - if lib not in ['c', 'm']] - else: - save_libs = ext.libraries - - # Invoke base build_extension() - build_ext.build_extension(self, ext) - - if save_libs is not None and save_libs != ext.libraries: - ext.libraries = save_libs - - -class InstallLib(install_lib): - local_outputs = [] - local_inputs = [] - - def set_install_dir(self, install_dir): - self.install_dir = install_dir - - def get_outputs(self): - return install_lib.get_outputs(self) + self.local_outputs - - def get_inputs(self): - return install_lib.get_inputs(self) + self.local_inputs - - -class InstallData(install_data): - local_outputs = [] - local_inputs = [] - template_options = {} - - def prepare(self): - if os.name == 'nt': - self.prefix = os.sep.join(self.install_dir.split(os.sep)[:-3]) - else: - # default: os.name == 'posix' - self.prefix = os.sep.join(self.install_dir.split(os.sep)[:-4]) - - self.exec_prefix = '${prefix}/bin' - self.includedir = '${prefix}/include' - self.libdir = '${prefix}/lib' - self.datarootdir = '${prefix}/share' - self.datadir = '${prefix}/share' - - self.add_template_option('prefix', self.prefix) - self.add_template_option('exec_prefix', self.exec_prefix) - self.add_template_option('includedir', self.includedir) - self.add_template_option('libdir', self.libdir) - self.add_template_option('datarootdir', self.datarootdir) - self.add_template_option('datadir', self.datadir) - self.add_template_option('PYTHON', sys.executable) - self.add_template_option('THREADING_CFLAGS', '') - - def set_install_dir(self, install_dir): - self.install_dir = install_dir - - def add_template_option(self, name, value): - self.template_options['@%s@' % name] = value - - def install_template(self, filename, install_dir): - '''Install template filename into target directory install_dir.''' - output_file = os.path.split(filename)[-1][:-3] - - template = open(filename).read() - - for key, value in self.template_options.items(): - template = template.replace(key, value) - - output = os.path.join(install_dir, output_file) - self.mkpath(install_dir) - open(output, 'wb').write(template) - self.local_inputs.append(filename) - self.local_outputs.append(output) - return output - - def get_outputs(self): - return install_data.get_outputs(self) + self.local_outputs - - def get_inputs(self): - return install_data.get_inputs(self) + self.local_inputs - - -class PkgConfigExtension(Extension): - # Name of pygobject package extension depends on, can be None - pygobject_pkc = 'pygobject-2.0' - can_build_ok = None - - def __init__(self, **kwargs): - name = kwargs['pkc_name'] - - if 'include_dirs' in kwargs: - kwargs['include_dirs'] += self.get_include_dirs(name) + GLOBAL_INC - else: - kwargs['include_dirs'] = self.get_include_dirs(name) + GLOBAL_INC - - kwargs['define_macros'] = GLOBAL_MACROS - - if 'libraries' in kwargs: - kwargs['libraries'] += self.get_libraries(name) - else: - kwargs['libraries'] = self.get_libraries(name) - - if 'library_dirs' in kwargs: - kwargs['library_dirs'] += self.get_library_dirs(name) - else: - kwargs['library_dirs'] = self.get_library_dirs(name) - - if 'pygobject_pkc' in kwargs: - self.pygobject_pkc = kwargs.pop('pygobject_pkc') - - if self.pygobject_pkc: - kwargs['include_dirs'] += self.get_include_dirs(self.pygobject_pkc) - kwargs['libraries'] += self.get_libraries(self.pygobject_pkc) - kwargs['library_dirs'] += self.get_library_dirs(self.pygobject_pkc) - - self.name = kwargs['name'] - self.pkc_name = kwargs['pkc_name'] - self.pkc_version = kwargs['pkc_version'] - del kwargs['pkc_name'], kwargs['pkc_version'] - Extension.__init__(self, **kwargs) - - def get_include_dirs(self, names): - if type(names) != tuple: - names = (names,) - - retval = [] - - for name in names: - retval.extend(pkgc_get_include_dirs(name)) - - return retval - - def get_libraries(self, names): - if type(names) != tuple: - names = (names,) - - retval = [] - - for name in names: - retval.extend(pkgc_get_libraries(name)) - - return retval - - def get_library_dirs(self, names): - if type(names) != tuple: - names = (names,) - - retval = [] - - for name in names: - retval.extend(pkgc_get_library_dirs(name)) - - return retval - - def can_build(self): - '''If the pkg-config version found is good enough''' - if self.can_build_ok is not None: - return self.can_build_ok - - if type(self.pkc_name) != tuple: - reqs = [(self.pkc_name, self.pkc_version)] - else: - reqs = zip(self.pkc_name, self.pkc_version) - - for package, version in reqs: - retval = os.system('pkg-config --exists %s' % package) - - if retval: - print ('* %s.pc could not be found, bindings for %s' - ' will not be built.' % (package, self.name)) - self.can_build_ok = False - return False - - orig_version = pkgc_get_version(package) - - if (map(int, orig_version.split('.')) >= - map(int, version.split('.'))): - - self.can_build_ok = True - return True - else: - print ('Warning: Too old version of %s' % package) - print (' Need %s, but %s is installed' % (version, orig_version)) - self.can_build_ok = False - return False - - def generate(self): - pass - - -class Template(object): - def __new__(cls, *args, **kwds): - # The Template and TemplateExtension classes require codegen - if not template_classes_enabled: - raise NameError('\'%s\' is not defined\n%s' % (cls.__name__, - codegen_error_message)) - - return object.__new__(cls) - - def __init__(self, override, output, defs, prefix, - register=[], load_types=None, py_ssize_t_clean=False): - - self.override = override - self.output = output - self.prefix = prefix - self.load_types = load_types - self.py_ssize_t_clean = py_ssize_t_clean - - self.built_defs=[] - - if isinstance(defs, tuple): - self.defs=defs[0] - self.built_defs.append(defs) - else: - self.defs=defs - - self.register=[] - - for r in register: - if isinstance(r, tuple): - self.register.append(r[0]) - self.built_defs.append(r) - else: - self.register.append(r) - - def check_dates(self): - # Return True if files are up-to-date - files=self.register[:] - files.append(self.override) - files.append(self.defs) - - return not dep_util.newer_group(files, self.output) - - def generate_defs(self): - for (target, sources) in self.built_defs: - if dep_util.newer_group(sources, target): - # createdefs is mostly called from the CLI ! - args=['dummy', target] + sources - codegen.createdefs.main(args) - - def generate(self): - # Generate defs files if necessary - self.generate_defs() - - # ... then check the file timestamps - if self.check_dates(): - return - - for item in self.register: - dp = DefsParser(item, dict(GLOBAL_MACROS)) - dp.startParsing() - register_types(dp) - - if self.load_types: - globals = {} - execfile(self.load_types, globals) - - dp = DefsParser(self.defs, dict(GLOBAL_MACROS)) - dp.startParsing() - register_types(dp) - - fd = open(self.output, 'w') - sw = SourceWriter(dp, Overrides(self.override), self.prefix, - FileOutput(fd, self.output)) - sw.write(self.py_ssize_t_clean) - fd.close() - - -class TemplateExtension(PkgConfigExtension): - def __new__(cls,*args, **kwds): - if not template_classes_enabled: - raise NameError('\'%s\' is not defined\n%s' % (cls.__name__, - codegen_error_message)) - - return PkgConfigExtension.__new__(cls,*args, **kwds) - - def __init__(self, **kwargs): - name = kwargs['name'] - defs = kwargs['defs'] - - if isinstance(defs, tuple): - output = defs[0][:-5] + '.c' - else: - output = defs[:-5] + '.c' - - override = kwargs['override'] - load_types = kwargs.get('load_types') - py_ssize_t_clean = kwargs.pop('py_ssize_t_clean', False) - self.templates = [] - self.templates.append(Template(override, output, defs, 'py' + name, - kwargs['register'], load_types, - py_ssize_t_clean)) - - del kwargs['register'], kwargs['override'], kwargs['defs'] - - if load_types: - del kwargs['load_types'] - - if kwargs.has_key('output'): - kwargs['name'] = kwargs['output'] - del kwargs['output'] - - PkgConfigExtension.__init__(self, **kwargs) - - def generate(self): - map(lambda x: x.generate(), self.templates) diff --git a/examples/Makefile.in b/examples/Makefile.in index c91307a..0a60dfa 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -144,6 +144,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -154,7 +156,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/examples/cairo-demo.py b/examples/cairo-demo.py index 9b8e8f9..cec45d8 100755 --- a/examples/cairo-demo.py +++ b/examples/cairo-demo.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -"""Based on cairo-demo/X11/cairo-demo.c """ -import pygtk -pygtk.require('2.0') +Based on cairo-demo/X11/cairo-demo.c +""" + import cairo from gi.repository import Gdk, Gtk diff --git a/examples/signal.py b/examples/signal.py index d06fb02..d1b7357 100644 --- a/examples/signal.py +++ b/examples/signal.py @@ -5,8 +5,6 @@ class C(GObject.GObject): 'my_signal': (GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE, (GObject.TYPE_INT,)) } - def __init__(self): - self.__gobject_init__() # default constructor using our new GType def do_my_signal(self, arg): print "C: class closure for `my_signal' called with argument", arg diff --git a/gi/Makefile.am b/gi/Makefile.am index ee5eb00..0584cc9 100644 --- a/gi/Makefile.am +++ b/gi/Makefile.am @@ -1,33 +1,39 @@ -PLATFORM_VERSION = 2.0 - -pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) -pkgpyexecdir = $(pyexecdir) - SUBDIRS = \ repository \ overrides \ _glib \ _gobject -INCLUDES = -I$(top_srcdir)/gi/_gobject -I$(top_srcdir)/gi/_glib +extension_cppflags = \ + $(PYTHON_INCLUDES) \ + -DPY_SSIZE_T_CLEAN + +extension_ldflags = \ + -module \ + -avoid-version + +if OS_WIN32 +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +extension_libadd = \ + $(PYTHON_LIBS) + +extension_ldflags += \ + -no-undefined \ + -shrext ".pyd" +endif + +pygidir = $(pyexecdir)/gi -pygidir = $(pkgpyexecdir)/gi pygi_PYTHON = \ + __init__.py \ types.py \ module.py \ - importer.py \ - __init__.py + importer.py + +pygi_LTLIBRARIES = _gi.la -_gi_la_CFLAGS = \ - $(PYTHON_INCLUDES) \ - $(GI_CFLAGS) -_gi_la_LDFLAGS = \ - -module \ - -avoid-version \ - -export-symbols-regex "init_gi|PyInit__gi" -_gi_la_LIBADD = \ - $(GI_LIBS) \ - $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la _gi_la_SOURCES = \ pygi-repository.c \ pygi-repository.h \ @@ -62,39 +68,53 @@ _gi_la_SOURCES = \ pygi-invoke-state-struct.h \ pygi-cache.h \ pygi-cache.c \ - pygi-marshal-in.c \ - pygi-marshal-in.h \ - pygi-marshal-out.c \ - pygi-marshal-out.h \ + pygi-marshal-from-py.c \ + pygi-marshal-from-py.h \ + pygi-marshal-to-py.c \ + pygi-marshal-to-py.h \ pygi-marshal-cleanup.c \ pygi-marshal-cleanup.h +_gi_la_CFLAGS = \ + $(GI_CFLAGS) +_gi_la_CPPFLAGS = \ + $(extension_cppflags) \ + -I$(top_srcdir)/gi/_glib \ + -I$(top_srcdir)/gi/_gobject +_gi_la_LIBADD = \ + $(extension_libadd) \ + $(GI_LIBS) \ + $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la +_gi_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "init_gi|PyInit__gi" +if ENABLE_CAIRO +pygi_LTLIBRARIES += _gi_cairo.la +endif + +_gi_cairo_la_SOURCES = \ + pygi-foreign-cairo.c _gi_cairo_la_CFLAGS = \ - $(PYTHON_INCLUDES) \ $(GI_CFLAGS) \ $(PYCAIRO_CFLAGS) -_gi_cairo_la_LDFLAGS = \ - -module \ - -avoid-version \ - -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" +_gi_cairo_la_CPPFLAGS = \ + $(extension_cppflags) \ + -I$(top_srcdir)/gi/_glib \ + -I$(top_srcdir)/gi/_gobject _gi_cairo_la_LIBADD = \ + $(extension_libadd) \ $(GI_LIBS) \ $(PYCAIRO_LIBS) -_gi_cairo_la_SOURCES = pygi-foreign-cairo.c - - -pygi_LTLIBRARIES = _gi.la - -if ENABLE_CAIRO -pygi_LTLIBRARIES += _gi_cairo.la -endif +_gi_cairo_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" # This is to ensure we have a symlink to the .so in the # build directory, which the Python interpreter can load # directly without having to know how to parse .la files. .la.so: - test -L $@ || $(LN_S) .libs/$@ $@ + $(LN_S) .libs/$@ $@ || true all-local: $(LTLIBRARIES:.la=.so) check-local: $(LTLIBRARIES:.la=.so) diff --git a/gi/Makefile.in b/gi/Makefile.in index afadd49..a2a6fce 100644 --- a/gi/Makefile.in +++ b/gi/Makefile.in @@ -17,6 +17,7 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd @@ -33,7 +34,11 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_CAIRO_TRUE@am__append_1 = _gi_cairo.la +@OS_WIN32_TRUE@am__append_1 = \ +@OS_WIN32_TRUE@ -no-undefined \ +@OS_WIN32_TRUE@ -shrext ".pyd" + +@ENABLE_CAIRO_TRUE@am__append_2 = _gi_cairo.la subdir = gi DIST_COMMON = $(pygi_PYTHON) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in @@ -73,7 +78,8 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(pygidir)" "$(DESTDIR)$(pygidir)" LTLIBRARIES = $(pygi_LTLIBRARIES) am__DEPENDENCIES_1 = -_gi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@OS_WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +_gi_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la am__gi_la_OBJECTS = _gi_la-pygi-repository.lo _gi_la-pygi-info.lo \ _gi_la-pygi-foreign.lo _gi_la-pygi-foreign-gvariant.lo \ @@ -82,7 +88,7 @@ am__gi_la_OBJECTS = _gi_la-pygi-repository.lo _gi_la-pygi-info.lo \ _gi_la-pygi-closure.lo _gi_la-pygi-callbacks.lo \ _gi_la-pygi-property.lo _gi_la-pygi-signal-closure.lo \ _gi_la-gimodule.lo _gi_la-pygi-invoke.lo _gi_la-pygi-cache.lo \ - _gi_la-pygi-marshal-in.lo _gi_la-pygi-marshal-out.lo \ + _gi_la-pygi-marshal-from-py.lo _gi_la-pygi-marshal-to-py.lo \ _gi_la-pygi-marshal-cleanup.lo _gi_la_OBJECTS = $(am__gi_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) @@ -91,8 +97,8 @@ am__v_lt_0 = --silent _gi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gi_la_CFLAGS) $(CFLAGS) \ $(_gi_la_LDFLAGS) $(LDFLAGS) -o $@ -_gi_cairo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +_gi_cairo_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__gi_cairo_la_OBJECTS = _gi_cairo_la-pygi-foreign-cairo.lo _gi_cairo_la_OBJECTS = $(am__gi_cairo_la_OBJECTS) _gi_cairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -169,7 +175,6 @@ am__relativize = \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" -pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ @@ -258,6 +263,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -268,7 +275,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -310,7 +316,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir) +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -325,34 +331,32 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -PLATFORM_VERSION = 2.0 SUBDIRS = \ repository \ overrides \ _glib \ _gobject -INCLUDES = -I$(top_srcdir)/gi/_gobject -I$(top_srcdir)/gi/_glib -pygidir = $(pkgpyexecdir)/gi -pygi_PYTHON = \ - types.py \ - module.py \ - importer.py \ - __init__.py - -_gi_la_CFLAGS = \ +extension_cppflags = \ $(PYTHON_INCLUDES) \ - $(GI_CFLAGS) + -DPY_SSIZE_T_CLEAN -_gi_la_LDFLAGS = \ - -module \ - -avoid-version \ - -export-symbols-regex "init_gi|PyInit__gi" +extension_ldflags = -module -avoid-version $(am__append_1) -_gi_la_LIBADD = \ - $(GI_LIBS) \ - $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +@OS_WIN32_TRUE@extension_libadd = \ +@OS_WIN32_TRUE@ $(PYTHON_LIBS) + +pygidir = $(pyexecdir)/gi +pygi_PYTHON = \ + __init__.py \ + types.py \ + module.py \ + importer.py +pygi_LTLIBRARIES = _gi.la $(am__append_2) _gi_la_SOURCES = \ pygi-repository.c \ pygi-repository.h \ @@ -387,29 +391,51 @@ _gi_la_SOURCES = \ pygi-invoke-state-struct.h \ pygi-cache.h \ pygi-cache.c \ - pygi-marshal-in.c \ - pygi-marshal-in.h \ - pygi-marshal-out.c \ - pygi-marshal-out.h \ + pygi-marshal-from-py.c \ + pygi-marshal-from-py.h \ + pygi-marshal-to-py.c \ + pygi-marshal-to-py.h \ pygi-marshal-cleanup.c \ pygi-marshal-cleanup.h +_gi_la_CFLAGS = \ + $(GI_CFLAGS) + +_gi_la_CPPFLAGS = \ + $(extension_cppflags) \ + -I$(top_srcdir)/gi/_glib \ + -I$(top_srcdir)/gi/_gobject + +_gi_la_LIBADD = \ + $(extension_libadd) \ + $(GI_LIBS) \ + $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la + +_gi_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "init_gi|PyInit__gi" + +_gi_cairo_la_SOURCES = \ + pygi-foreign-cairo.c + _gi_cairo_la_CFLAGS = \ - $(PYTHON_INCLUDES) \ $(GI_CFLAGS) \ $(PYCAIRO_CFLAGS) -_gi_cairo_la_LDFLAGS = \ - -module \ - -avoid-version \ - -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" +_gi_cairo_la_CPPFLAGS = \ + $(extension_cppflags) \ + -I$(top_srcdir)/gi/_glib \ + -I$(top_srcdir)/gi/_gobject _gi_cairo_la_LIBADD = \ + $(extension_libadd) \ $(GI_LIBS) \ $(PYCAIRO_LIBS) -_gi_cairo_la_SOURCES = pygi-foreign-cairo.c -pygi_LTLIBRARIES = _gi.la $(am__append_1) +_gi_cairo_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo" + all: all-recursive .SUFFIXES: @@ -498,8 +524,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-invoke.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-marshal-cleanup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-marshal-in.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-marshal-out.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-marshal-from-py.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-marshal-to-py.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-repository.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_gi_la-pygi-signal-closure.Plo@am__quote@ @@ -531,156 +557,156 @@ distclean-compile: @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< _gi_la-pygi-repository.lo: pygi-repository.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-repository.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-repository.Tpo -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-repository.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-repository.Tpo -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-repository.Tpo $(DEPDIR)/_gi_la-pygi-repository.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-repository.c' object='_gi_la-pygi-repository.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-repository.lo `test -f 'pygi-repository.c' || echo '$(srcdir)/'`pygi-repository.c _gi_la-pygi-info.lo: pygi-info.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-info.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-info.Tpo -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-info.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-info.Tpo -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-info.Tpo $(DEPDIR)/_gi_la-pygi-info.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-info.c' object='_gi_la-pygi-info.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-info.lo `test -f 'pygi-info.c' || echo '$(srcdir)/'`pygi-info.c _gi_la-pygi-foreign.lo: pygi-foreign.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign.Tpo -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign.Tpo -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-foreign.Tpo $(DEPDIR)/_gi_la-pygi-foreign.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign.c' object='_gi_la-pygi-foreign.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign.lo `test -f 'pygi-foreign.c' || echo '$(srcdir)/'`pygi-foreign.c _gi_la-pygi-foreign-gvariant.lo: pygi-foreign-gvariant.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign-gvariant.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Tpo -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-foreign-gvariant.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Tpo -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Tpo $(DEPDIR)/_gi_la-pygi-foreign-gvariant.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign-gvariant.c' object='_gi_la-pygi-foreign-gvariant.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-foreign-gvariant.lo `test -f 'pygi-foreign-gvariant.c' || echo '$(srcdir)/'`pygi-foreign-gvariant.c _gi_la-pygi-struct.lo: pygi-struct.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-struct.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-struct.Tpo -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-struct.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-struct.Tpo -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-struct.Tpo $(DEPDIR)/_gi_la-pygi-struct.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-struct.c' object='_gi_la-pygi-struct.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-struct.lo `test -f 'pygi-struct.c' || echo '$(srcdir)/'`pygi-struct.c _gi_la-pygi-argument.lo: pygi-argument.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-argument.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-argument.Tpo -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-argument.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-argument.Tpo -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-argument.Tpo $(DEPDIR)/_gi_la-pygi-argument.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-argument.c' object='_gi_la-pygi-argument.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-argument.lo `test -f 'pygi-argument.c' || echo '$(srcdir)/'`pygi-argument.c _gi_la-pygi-type.lo: pygi-type.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-type.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-type.Tpo -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-type.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-type.Tpo -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-type.Tpo $(DEPDIR)/_gi_la-pygi-type.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-type.c' object='_gi_la-pygi-type.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-type.lo `test -f 'pygi-type.c' || echo '$(srcdir)/'`pygi-type.c _gi_la-pygi-boxed.lo: pygi-boxed.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-boxed.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-boxed.Tpo -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-boxed.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-boxed.Tpo -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-boxed.Tpo $(DEPDIR)/_gi_la-pygi-boxed.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-boxed.c' object='_gi_la-pygi-boxed.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-boxed.lo `test -f 'pygi-boxed.c' || echo '$(srcdir)/'`pygi-boxed.c _gi_la-pygi-closure.lo: pygi-closure.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-closure.Tpo -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-closure.Tpo -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-closure.Tpo $(DEPDIR)/_gi_la-pygi-closure.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-closure.c' object='_gi_la-pygi-closure.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-closure.lo `test -f 'pygi-closure.c' || echo '$(srcdir)/'`pygi-closure.c _gi_la-pygi-callbacks.lo: pygi-callbacks.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-callbacks.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-callbacks.Tpo -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-callbacks.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-callbacks.Tpo -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-callbacks.Tpo $(DEPDIR)/_gi_la-pygi-callbacks.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-callbacks.c' object='_gi_la-pygi-callbacks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-callbacks.lo `test -f 'pygi-callbacks.c' || echo '$(srcdir)/'`pygi-callbacks.c _gi_la-pygi-property.lo: pygi-property.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-property.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-property.Tpo -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-property.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-property.Tpo -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-property.Tpo $(DEPDIR)/_gi_la-pygi-property.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-property.c' object='_gi_la-pygi-property.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-property.lo `test -f 'pygi-property.c' || echo '$(srcdir)/'`pygi-property.c _gi_la-pygi-signal-closure.lo: pygi-signal-closure.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-signal-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-signal-closure.Tpo -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-signal-closure.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-signal-closure.Tpo -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-signal-closure.Tpo $(DEPDIR)/_gi_la-pygi-signal-closure.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-signal-closure.c' object='_gi_la-pygi-signal-closure.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-signal-closure.lo `test -f 'pygi-signal-closure.c' || echo '$(srcdir)/'`pygi-signal-closure.c _gi_la-gimodule.lo: gimodule.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-gimodule.lo -MD -MP -MF $(DEPDIR)/_gi_la-gimodule.Tpo -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-gimodule.lo -MD -MP -MF $(DEPDIR)/_gi_la-gimodule.Tpo -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-gimodule.Tpo $(DEPDIR)/_gi_la-gimodule.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gimodule.c' object='_gi_la-gimodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-gimodule.lo `test -f 'gimodule.c' || echo '$(srcdir)/'`gimodule.c _gi_la-pygi-invoke.lo: pygi-invoke.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-invoke.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-invoke.Tpo -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-invoke.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-invoke.Tpo -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-invoke.Tpo $(DEPDIR)/_gi_la-pygi-invoke.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-invoke.c' object='_gi_la-pygi-invoke.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-invoke.lo `test -f 'pygi-invoke.c' || echo '$(srcdir)/'`pygi-invoke.c _gi_la-pygi-cache.lo: pygi-cache.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-cache.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-cache.Tpo -c -o _gi_la-pygi-cache.lo `test -f 'pygi-cache.c' || echo '$(srcdir)/'`pygi-cache.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-cache.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-cache.Tpo -c -o _gi_la-pygi-cache.lo `test -f 'pygi-cache.c' || echo '$(srcdir)/'`pygi-cache.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-cache.Tpo $(DEPDIR)/_gi_la-pygi-cache.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-cache.c' object='_gi_la-pygi-cache.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-cache.lo `test -f 'pygi-cache.c' || echo '$(srcdir)/'`pygi-cache.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-cache.lo `test -f 'pygi-cache.c' || echo '$(srcdir)/'`pygi-cache.c -_gi_la-pygi-marshal-in.lo: pygi-marshal-in.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-in.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-in.Tpo -c -o _gi_la-pygi-marshal-in.lo `test -f 'pygi-marshal-in.c' || echo '$(srcdir)/'`pygi-marshal-in.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-marshal-in.Tpo $(DEPDIR)/_gi_la-pygi-marshal-in.Plo +_gi_la-pygi-marshal-from-py.lo: pygi-marshal-from-py.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-from-py.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-from-py.Tpo -c -o _gi_la-pygi-marshal-from-py.lo `test -f 'pygi-marshal-from-py.c' || echo '$(srcdir)/'`pygi-marshal-from-py.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-marshal-from-py.Tpo $(DEPDIR)/_gi_la-pygi-marshal-from-py.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-marshal-in.c' object='_gi_la-pygi-marshal-in.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-marshal-from-py.c' object='_gi_la-pygi-marshal-from-py.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-in.lo `test -f 'pygi-marshal-in.c' || echo '$(srcdir)/'`pygi-marshal-in.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-from-py.lo `test -f 'pygi-marshal-from-py.c' || echo '$(srcdir)/'`pygi-marshal-from-py.c -_gi_la-pygi-marshal-out.lo: pygi-marshal-out.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-out.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-out.Tpo -c -o _gi_la-pygi-marshal-out.lo `test -f 'pygi-marshal-out.c' || echo '$(srcdir)/'`pygi-marshal-out.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-marshal-out.Tpo $(DEPDIR)/_gi_la-pygi-marshal-out.Plo +_gi_la-pygi-marshal-to-py.lo: pygi-marshal-to-py.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-to-py.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-to-py.Tpo -c -o _gi_la-pygi-marshal-to-py.lo `test -f 'pygi-marshal-to-py.c' || echo '$(srcdir)/'`pygi-marshal-to-py.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-marshal-to-py.Tpo $(DEPDIR)/_gi_la-pygi-marshal-to-py.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-marshal-out.c' object='_gi_la-pygi-marshal-out.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-marshal-to-py.c' object='_gi_la-pygi-marshal-to-py.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-out.lo `test -f 'pygi-marshal-out.c' || echo '$(srcdir)/'`pygi-marshal-out.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-to-py.lo `test -f 'pygi-marshal-to-py.c' || echo '$(srcdir)/'`pygi-marshal-to-py.c _gi_la-pygi-marshal-cleanup.lo: pygi-marshal-cleanup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-cleanup.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-cleanup.Tpo -c -o _gi_la-pygi-marshal-cleanup.lo `test -f 'pygi-marshal-cleanup.c' || echo '$(srcdir)/'`pygi-marshal-cleanup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -MT _gi_la-pygi-marshal-cleanup.lo -MD -MP -MF $(DEPDIR)/_gi_la-pygi-marshal-cleanup.Tpo -c -o _gi_la-pygi-marshal-cleanup.lo `test -f 'pygi-marshal-cleanup.c' || echo '$(srcdir)/'`pygi-marshal-cleanup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_la-pygi-marshal-cleanup.Tpo $(DEPDIR)/_gi_la-pygi-marshal-cleanup.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-marshal-cleanup.c' object='_gi_la-pygi-marshal-cleanup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-cleanup.lo `test -f 'pygi-marshal-cleanup.c' || echo '$(srcdir)/'`pygi-marshal-cleanup.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_la_CPPFLAGS) $(CPPFLAGS) $(_gi_la_CFLAGS) $(CFLAGS) -c -o _gi_la-pygi-marshal-cleanup.lo `test -f 'pygi-marshal-cleanup.c' || echo '$(srcdir)/'`pygi-marshal-cleanup.c _gi_cairo_la-pygi-foreign-cairo.lo: pygi-foreign-cairo.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -MT _gi_cairo_la-pygi-foreign-cairo.lo -MD -MP -MF $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Tpo -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_cairo_la_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -MT _gi_cairo_la-pygi-foreign-cairo.lo -MD -MP -MF $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Tpo -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Tpo $(DEPDIR)/_gi_cairo_la-pygi-foreign-cairo.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygi-foreign-cairo.c' object='_gi_cairo_la-pygi-foreign-cairo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_gi_cairo_la_CPPFLAGS) $(CPPFLAGS) $(_gi_cairo_la_CFLAGS) $(CFLAGS) -c -o _gi_cairo_la-pygi-foreign-cairo.lo `test -f 'pygi-foreign-cairo.c' || echo '$(srcdir)/'`pygi-foreign-cairo.c mostlyclean-libtool: -rm -f *.lo @@ -1049,7 +1075,7 @@ uninstall-am: uninstall-pygiLTLIBRARIES uninstall-pygiPYTHON # build directory, which the Python interpreter can load # directly without having to know how to parse .la files. .la.so: - test -L $@ || $(LN_S) .libs/$@ $@ + $(LN_S) .libs/$@ $@ || true all-local: $(LTLIBRARIES:.la=.so) check-local: $(LTLIBRARIES:.la=.so) diff --git a/gi/__init__.py b/gi/__init__.py index d4da310..e6bc06e 100644 --- a/gi/__init__.py +++ b/gi/__init__.py @@ -25,8 +25,10 @@ from ._gi import _API, Repository # Force loading the GObject typelib so we have available the wrappers for # base classes such as GInitiallyUnowned import gi._gobject +import os _versions = {} +_overridesdir = os.path.join(os.path.dirname(__file__), 'overrides') def require_version(namespace, version): repository = Repository.get_default() diff --git a/gi/_glib/Makefile.am b/gi/_glib/Makefile.am index fcea61d..3cf2593 100644 --- a/gi/_glib/Makefile.am +++ b/gi/_glib/Makefile.am @@ -1,53 +1,88 @@ AUTOMAKE_OPTIONS = 1.7 -INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN -lib_LTLIBRARIES = libpyglib-gi-2.0-@PYTHON_BASENAME@.la +extension_cppflags = \ + $(PYTHON_INCLUDES) \ + -DPY_SSIZE_T_CLEAN -pkgpyexecdir = $(pyexecdir) +extension_ldflags = \ + -module \ + -avoid-version -pyglibdir = $(pkgpyexecdir)/gi/_glib -pyglib_PYTHON = \ - __init__.py \ - option.py -pyglib_LTLIBRARIES = _glib.la +if OS_WIN32 +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +extension_libadd = \ + $(PYTHON_LIBS) -common_ldflags = -module -avoid-version -if PLATFORM_WIN32 -common_ldflags += -no-undefined +extension_ldflags += \ + -no-undefined \ + -shrext ".pyd" endif -libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS) -libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) -libpyglib_gi_2_0_@PYTHON_BASENAME@_la_SOURCES = \ - pyglib.c \ - pyglib.h \ - pyglib-private.h \ + +pyglibdir = $(pyexecdir)/gi/_glib + +pyglib_PYTHON = \ + __init__.py \ + option.py + +lib_LTLIBRARIES = libpyglib-gi-2.0-@PYTHON_BASENAME@.la + +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_SOURCES = \ + pyglib.c \ + pyglib.h \ + pyglib-private.h \ pyglib-python-compat.h +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CPPFLAGS = \ + $(extension_cppflags) +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS = \ + $(GLIB_CFLAGS) +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LIBADD = \ + $(extension_libadd) \ + $(FFI_LIBS) \ + $(GLIB_LIBS) + +if OS_WIN32 +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LDFLAGS = \ + -no-undefined +endif -_glib_la_CFLAGS = $(GLIB_CFLAGS) -_glib_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_glib|PyInit__glib" -_glib_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS) libpyglib-gi-2.0-@PYTHON_BASENAME@.la -_glib_la_SOURCES = \ - glibmodule.c \ - pygiochannel.c \ - pygiochannel.h \ - pygoptioncontext.c \ - pygoptioncontext.h \ - pygoptiongroup.c \ - pygoptiongroup.h \ - pygmaincontext.c \ - pygmaincontext.h \ - pygmainloop.c \ - pygmainloop.h \ - pygsource.c \ - pygsource.h \ - pygspawn.c \ +pyglib_LTLIBRARIES = _glib.la + +_glib_la_SOURCES = \ + glibmodule.c \ + pygiochannel.c \ + pygiochannel.h \ + pygoptioncontext.c \ + pygoptioncontext.h \ + pygoptiongroup.c \ + pygoptiongroup.h \ + pygmaincontext.c \ + pygmaincontext.h \ + pygmainloop.c \ + pygmainloop.h \ + pygsource.c \ + pygsource.h \ + pygspawn.c \ pygspawn.h +_glib_la_CFLAGS = \ + $(GLIB_CFLAGS) +_glib_la_CPPFLAGS = \ + $(extension_cppflags) +_glib_la_LIBADD = \ + $(extension_libadd) \ + $(GLIB_LIBS) \ + libpyglib-gi-2.0-@PYTHON_BASENAME@.la +_glib_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "_glib|PyInit__glib" if PLATFORM_WIN32 _glib_la_CFLAGS += -DPLATFORM_WIN32 endif + all: $(pyglib_LTLIBRARIES:.la=.so) check-local: $(pyglib_LTLIBRARIES:.la=.so) clean-local: @@ -55,4 +90,5 @@ clean-local: .la.so: $(LN_S) .libs/$@ $@ || true + -include $(top_srcdir)/git.mk diff --git a/gi/_glib/Makefile.in b/gi/_glib/Makefile.in index 107ad28..43062d7 100644 --- a/gi/_glib/Makefile.in +++ b/gi/_glib/Makefile.in @@ -34,7 +34,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined +@OS_WIN32_TRUE@am__append_1 = \ +@OS_WIN32_TRUE@ -no-undefined \ +@OS_WIN32_TRUE@ -shrext ".pyd" + @PLATFORM_WIN32_TRUE@am__append_2 = -DPLATFORM_WIN32 subdir = gi/_glib DIST_COMMON = $(pyglib_PYTHON) $(srcdir)/Makefile.am \ @@ -76,7 +79,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyglibdir)" \ "$(DESTDIR)$(pyglibdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(pyglib_LTLIBRARIES) am__DEPENDENCIES_1 = -_glib_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@OS_WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +_glib_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ libpyglib-gi-2.0-@PYTHON_BASENAME@.la am__glib_la_OBJECTS = _glib_la-glibmodule.lo _glib_la-pygiochannel.lo \ _glib_la-pygoptioncontext.lo _glib_la-pygoptiongroup.lo \ @@ -90,7 +94,8 @@ _glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_glib_la_CFLAGS) \ $(CFLAGS) $(_glib_la_LDFLAGS) $(LDFLAGS) -o $@ libpyglib_gi_2_0_@PYTHON_BASENAME@_la_DEPENDENCIES = \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_libpyglib_gi_2_0_@PYTHON_BASENAME@_la_OBJECTS = \ libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo libpyglib_gi_2_0_@PYTHON_BASENAME@_la_OBJECTS = \ @@ -98,7 +103,8 @@ libpyglib_gi_2_0_@PYTHON_BASENAME@_la_OBJECTS = \ libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ $(CCLD) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(CFLAGS) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LDFLAGS) \ + $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -221,6 +227,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -231,7 +239,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -273,7 +280,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir) +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -289,43 +296,75 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 -INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN -lib_LTLIBRARIES = libpyglib-gi-2.0-@PYTHON_BASENAME@.la -pyglibdir = $(pkgpyexecdir)/gi/_glib +extension_cppflags = \ + $(PYTHON_INCLUDES) \ + -DPY_SSIZE_T_CLEAN + +extension_ldflags = -module -avoid-version $(am__append_1) + +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +@OS_WIN32_TRUE@extension_libadd = \ +@OS_WIN32_TRUE@ $(PYTHON_LIBS) + +pyglibdir = $(pyexecdir)/gi/_glib pyglib_PYTHON = \ - __init__.py \ + __init__.py \ option.py -pyglib_LTLIBRARIES = _glib.la -common_ldflags = -module -avoid-version $(am__append_1) -libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS) -libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) +lib_LTLIBRARIES = libpyglib-gi-2.0-@PYTHON_BASENAME@.la libpyglib_gi_2_0_@PYTHON_BASENAME@_la_SOURCES = \ - pyglib.c \ - pyglib.h \ - pyglib-private.h \ + pyglib.c \ + pyglib.h \ + pyglib-private.h \ pyglib-python-compat.h -_glib_la_CFLAGS = $(GLIB_CFLAGS) $(am__append_2) -_glib_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_glib|PyInit__glib" -_glib_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS) libpyglib-gi-2.0-@PYTHON_BASENAME@.la +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CPPFLAGS = \ + $(extension_cppflags) + +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS = \ + $(GLIB_CFLAGS) + +libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LIBADD = \ + $(extension_libadd) \ + $(FFI_LIBS) \ + $(GLIB_LIBS) + +@OS_WIN32_TRUE@libpyglib_gi_2_0_@PYTHON_BASENAME@_la_LDFLAGS = \ +@OS_WIN32_TRUE@ -no-undefined + +pyglib_LTLIBRARIES = _glib.la _glib_la_SOURCES = \ - glibmodule.c \ - pygiochannel.c \ - pygiochannel.h \ - pygoptioncontext.c \ - pygoptioncontext.h \ - pygoptiongroup.c \ - pygoptiongroup.h \ - pygmaincontext.c \ - pygmaincontext.h \ - pygmainloop.c \ - pygmainloop.h \ - pygsource.c \ - pygsource.h \ - pygspawn.c \ + glibmodule.c \ + pygiochannel.c \ + pygiochannel.h \ + pygoptioncontext.c \ + pygoptioncontext.h \ + pygoptiongroup.c \ + pygoptiongroup.h \ + pygmaincontext.c \ + pygmaincontext.h \ + pygmainloop.c \ + pygmainloop.h \ + pygsource.c \ + pygsource.h \ + pygspawn.c \ pygspawn.h +_glib_la_CFLAGS = $(GLIB_CFLAGS) $(am__append_2) +_glib_la_CPPFLAGS = \ + $(extension_cppflags) + +_glib_la_LIBADD = \ + $(extension_libadd) \ + $(GLIB_LIBS) \ + libpyglib-gi-2.0-@PYTHON_BASENAME@.la + +_glib_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "_glib|PyInit__glib" + all: all-am .SUFFIXES: @@ -468,76 +507,76 @@ distclean-compile: @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< _glib_la-glibmodule.lo: glibmodule.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-glibmodule.lo -MD -MP -MF $(DEPDIR)/_glib_la-glibmodule.Tpo -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-glibmodule.lo -MD -MP -MF $(DEPDIR)/_glib_la-glibmodule.Tpo -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-glibmodule.Tpo $(DEPDIR)/_glib_la-glibmodule.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='glibmodule.c' object='_glib_la-glibmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-glibmodule.lo `test -f 'glibmodule.c' || echo '$(srcdir)/'`glibmodule.c _glib_la-pygiochannel.lo: pygiochannel.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygiochannel.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygiochannel.Tpo -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygiochannel.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygiochannel.Tpo -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygiochannel.Tpo $(DEPDIR)/_glib_la-pygiochannel.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygiochannel.c' object='_glib_la-pygiochannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygiochannel.lo `test -f 'pygiochannel.c' || echo '$(srcdir)/'`pygiochannel.c _glib_la-pygoptioncontext.lo: pygoptioncontext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptioncontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptioncontext.Tpo -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptioncontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptioncontext.Tpo -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygoptioncontext.Tpo $(DEPDIR)/_glib_la-pygoptioncontext.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygoptioncontext.c' object='_glib_la-pygoptioncontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptioncontext.lo `test -f 'pygoptioncontext.c' || echo '$(srcdir)/'`pygoptioncontext.c _glib_la-pygoptiongroup.lo: pygoptiongroup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptiongroup.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptiongroup.Tpo -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygoptiongroup.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygoptiongroup.Tpo -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygoptiongroup.Tpo $(DEPDIR)/_glib_la-pygoptiongroup.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygoptiongroup.c' object='_glib_la-pygoptiongroup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygoptiongroup.lo `test -f 'pygoptiongroup.c' || echo '$(srcdir)/'`pygoptiongroup.c _glib_la-pygmaincontext.lo: pygmaincontext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmaincontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmaincontext.Tpo -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmaincontext.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmaincontext.Tpo -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygmaincontext.Tpo $(DEPDIR)/_glib_la-pygmaincontext.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygmaincontext.c' object='_glib_la-pygmaincontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmaincontext.lo `test -f 'pygmaincontext.c' || echo '$(srcdir)/'`pygmaincontext.c _glib_la-pygmainloop.lo: pygmainloop.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmainloop.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmainloop.Tpo -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygmainloop.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygmainloop.Tpo -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygmainloop.Tpo $(DEPDIR)/_glib_la-pygmainloop.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygmainloop.c' object='_glib_la-pygmainloop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygmainloop.lo `test -f 'pygmainloop.c' || echo '$(srcdir)/'`pygmainloop.c _glib_la-pygsource.lo: pygsource.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygsource.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygsource.Tpo -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygsource.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygsource.Tpo -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygsource.Tpo $(DEPDIR)/_glib_la-pygsource.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygsource.c' object='_glib_la-pygsource.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygsource.lo `test -f 'pygsource.c' || echo '$(srcdir)/'`pygsource.c _glib_la-pygspawn.lo: pygspawn.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygspawn.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygspawn.Tpo -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -MT _glib_la-pygspawn.lo -MD -MP -MF $(DEPDIR)/_glib_la-pygspawn.Tpo -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_glib_la-pygspawn.Tpo $(DEPDIR)/_glib_la-pygspawn.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygspawn.c' object='_glib_la-pygspawn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(_glib_la_CPPFLAGS) $(CPPFLAGS) $(_glib_la_CFLAGS) $(CFLAGS) -c -o _glib_la-pygspawn.lo `test -f 'pygspawn.c' || echo '$(srcdir)/'`pygspawn.c libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo: pyglib.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -MT libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo -MD -MP -MF $(DEPDIR)/libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo -c -o libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CPPFLAGS) $(CPPFLAGS) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -MT libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo -MD -MP -MF $(DEPDIR)/libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo -c -o libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.Tpo $(DEPDIR)/libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pyglib.c' object='libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -c -o libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CPPFLAGS) $(CPPFLAGS) $(libpyglib_gi_2_0_@PYTHON_BASENAME@_la_CFLAGS) $(CFLAGS) -c -o libpyglib_gi_2_0_@PYTHON_BASENAME@_la-pyglib.lo `test -f 'pyglib.c' || echo '$(srcdir)/'`pyglib.c mostlyclean-libtool: -rm -f *.lo diff --git a/gi/_gobject/Makefile.am b/gi/_gobject/Makefile.am index a31085f..6bddcf7 100644 --- a/gi/_gobject/Makefile.am +++ b/gi/_gobject/Makefile.am @@ -4,65 +4,76 @@ PLATFORM_VERSION = 3.0 pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION) pkginclude_HEADERS = pygobject.h -pkgpyexecdir = $(pyexecdir) +extension_cppflags = \ + $(PYTHON_INCLUDES) \ + -DPY_SSIZE_T_CLEAN -# gobject python scripts -pygobjectdir = $(pkgpyexecdir)/gi/_gobject -pygobject_PYTHON = \ - __init__.py \ - constants.py \ - propertyhelper.py -pygobject_LTLIBRARIES = _gobject.la +extension_ldflags = \ + -module \ + -avoid-version -common_ldflags = -module -avoid-version -if PLATFORM_WIN32 -common_ldflags += -no-undefined +if OS_WIN32 +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +extension_libadd = \ + $(PYTHON_LIBS) + +extension_ldflags += \ + -no-undefined \ + -shrext ".pyd" endif +pygobjectdir = $(pyexecdir)/gi/_gobject + +pygobject_PYTHON = \ + __init__.py \ + constants.py \ + propertyhelper.py + +pygobject_LTLIBRARIES = _gobject.la + +_gobject_la_SOURCES = \ + gobjectmodule.c \ + pygboxed.c \ + pygboxed.h \ + pygenum.c \ + pygenum.h \ + pygflags.c \ + pygflags.h \ + pyginterface.c \ + pyginterface.h \ + pygobject.c \ + pygobject.h \ + pygobject-private.h \ + pygparamspec.c \ + pygparamspec.h \ + pygpointer.c \ + pygpointer.h \ + pygtype.c \ + pygtype.h _gobject_la_CFLAGS = \ + $(extension_cppflags) \ -I$(top_srcdir)/gi/_glib \ -I$(top_srcdir)/gi \ - $(PYTHON_INCLUDES) \ $(FFI_CFLAGS) \ $(GLIB_CFLAGS) \ - $(GI_CFLAGS) \ - -DPY_SSIZE_T_CLEAN - -_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject" + $(GI_CFLAGS) +_gi_la_CPPFLAGS = \ + $(extension_cppflags) _gobject_la_LIBADD = \ + $(extension_libadd) \ $(GLIB_LIBS) \ $(FFI_LIBS) \ - $(PYTHON_LIBS) \ $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la - -_gobject_la_SOURCES = \ - gobjectmodule.c \ - pygboxed.c \ - pygboxed.h \ - pygenum.c \ - pygenum.h \ - pygflags.c \ - pygflags.h \ - pyginterface.c \ - pyginterface.h \ - pygobject.c \ - pygobject.h \ - pygobject-private.h \ - pygparamspec.c \ - pygparamspec.h \ - pygpointer.c \ - pygpointer.h \ - pygtype.c \ - pygtype.h +_gobject_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "_gobject|PyInit__gobject" if HAVE_LIBFFI _gobject_la_SOURCES += ffi-marshaller.c ffi-marshaller.h endif -if PLATFORM_WIN32 -_gobject_la_CFLAGS += -DPLATFORM_WIN32 -endif - all: $(pygobject_LTLIBRARIES:.la=.so) check-local: $(pygobject_LTLIBRARIES:.la=.so) diff --git a/gi/_gobject/Makefile.in b/gi/_gobject/Makefile.in index c16a340..9283893 100644 --- a/gi/_gobject/Makefile.in +++ b/gi/_gobject/Makefile.in @@ -34,9 +34,11 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@PLATFORM_WIN32_TRUE@am__append_1 = -no-undefined +@OS_WIN32_TRUE@am__append_1 = \ +@OS_WIN32_TRUE@ -no-undefined \ +@OS_WIN32_TRUE@ -shrext ".pyd" + @HAVE_LIBFFI_TRUE@am__append_2 = ffi-marshaller.c ffi-marshaller.h -@PLATFORM_WIN32_TRUE@am__append_3 = -DPLATFORM_WIN32 subdir = gi/_gobject DIST_COMMON = $(pkginclude_HEADERS) $(pygobject_PYTHON) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -77,7 +79,9 @@ am__installdirs = "$(DESTDIR)$(pygobjectdir)" \ "$(DESTDIR)$(pygobjectdir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(pygobject_LTLIBRARIES) am__DEPENDENCIES_1 = -_gobject_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ +@OS_WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +_gobject_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) \ $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la am___gobject_la_SOURCES_DIST = gobjectmodule.c pygboxed.c pygboxed.h \ pygenum.c pygenum.h pygflags.c pygflags.h pyginterface.c \ @@ -220,6 +224,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -230,7 +236,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -272,7 +277,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir) +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -290,31 +295,51 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 PLATFORM_VERSION = 3.0 pkginclude_HEADERS = pygobject.h +extension_cppflags = \ + $(PYTHON_INCLUDES) \ + -DPY_SSIZE_T_CLEAN + +extension_ldflags = -module -avoid-version $(am__append_1) -# gobject python scripts -pygobjectdir = $(pkgpyexecdir)/gi/_gobject +# Windows requires Python modules to be explicitly linked to libpython. +# Extension modules are shared libaries (.dll), but need to be +# called .pyd for Python to load it as an extension module. +@OS_WIN32_TRUE@extension_libadd = \ +@OS_WIN32_TRUE@ $(PYTHON_LIBS) + +pygobjectdir = $(pyexecdir)/gi/_gobject pygobject_PYTHON = \ - __init__.py \ - constants.py \ + __init__.py \ + constants.py \ propertyhelper.py -pygobject_LTLIBRARIES = _gobject.la -common_ldflags = -module -avoid-version $(am__append_1) -_gobject_la_CFLAGS = -I$(top_srcdir)/gi/_glib -I$(top_srcdir)/gi \ - $(PYTHON_INCLUDES) $(FFI_CFLAGS) $(GLIB_CFLAGS) $(GI_CFLAGS) \ - -DPY_SSIZE_T_CLEAN $(am__append_3) -_gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex "_gobject|PyInit__gobject" -_gobject_la_LIBADD = \ - $(GLIB_LIBS) \ - $(FFI_LIBS) \ - $(PYTHON_LIBS) \ - $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la - +pygobject_LTLIBRARIES = _gobject.la _gobject_la_SOURCES = gobjectmodule.c pygboxed.c pygboxed.h pygenum.c \ pygenum.h pygflags.c pygflags.h pyginterface.c pyginterface.h \ pygobject.c pygobject.h pygobject-private.h pygparamspec.c \ pygparamspec.h pygpointer.c pygpointer.h pygtype.c pygtype.h \ $(am__append_2) +_gobject_la_CFLAGS = \ + $(extension_cppflags) \ + -I$(top_srcdir)/gi/_glib \ + -I$(top_srcdir)/gi \ + $(FFI_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GI_CFLAGS) + +_gi_la_CPPFLAGS = \ + $(extension_cppflags) + +_gobject_la_LIBADD = \ + $(extension_libadd) \ + $(GLIB_LIBS) \ + $(FFI_LIBS) \ + $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la + +_gobject_la_LDFLAGS = \ + $(extension_ldflags) \ + -export-symbols-regex "_gobject|PyInit__gobject" + all: all-am .SUFFIXES: diff --git a/gi/_gobject/gobjectmodule.c b/gi/_gobject/gobjectmodule.c index dfa1a8c..ffa323b 100644 --- a/gi/_gobject/gobjectmodule.c +++ b/gi/_gobject/gobjectmodule.c @@ -1017,12 +1017,38 @@ pygobject_init_wrapper_get(void) return (PyObject *) g_static_private_get(&pygobject_construction_wrapper); } +int +pygobject_constructv(PyGObject *self, + guint n_parameters, + GParameter *parameters) +{ + if (self->obj == NULL) { + GObject *obj; + pygobject_init_wrapper_set((PyObject *) self); + obj = g_object_newv(pyg_type_from_object((PyObject *) self), + n_parameters, parameters); + pygobject_sink (obj); + pygobject_init_wrapper_set(NULL); + if (self->obj == NULL) { + self->obj = obj; + pygobject_register_wrapper((PyObject *) self); + } + } else { + int i; + for (i = 0; i < n_parameters; ++i) + g_object_set_property(self->obj, + parameters[i].name, + ¶meters[i].value); + } + return 0; +} + static void pygobject__g_instance_init(GTypeInstance *instance, gpointer g_class) { GObject *object = (GObject *) instance; - PyObject *wrapper, *args, *kwargs; + PyObject *wrapper; wrapper = g_object_get_qdata(object, pygobject_wrapper_key); if (wrapper == NULL) { @@ -1033,22 +1059,6 @@ pygobject__g_instance_init(GTypeInstance *instance, } } pygobject_init_wrapper_set(NULL); - if (wrapper == NULL) { - /* this looks like a python object created through - * g_object_new -> we have no python wrapper, so create it - * now */ - PyGILState_STATE state; - state = pyglib_gil_state_ensure(); - wrapper = pygobject_new_full(object, FALSE, g_class); - args = PyTuple_New(0); - kwargs = PyDict_New(); - if (Py_TYPE(wrapper)->tp_init(wrapper, args, kwargs)) - PyErr_Print(); - Py_DECREF(wrapper); - Py_DECREF(args); - Py_DECREF(kwargs); - pyglib_gil_state_release(state); - } } @@ -1720,8 +1730,22 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs) g_type_class_unref(class); if (obj) { + PyObject *empty_args; + PyObject *empty_kwargs; + PyGILState_STATE state; + pygobject_sink (obj); self = (PyGObject *) pygobject_new_full((GObject *)obj, FALSE, NULL); + empty_args = PyTuple_New(0); + empty_kwargs = PyDict_New(); + + state = pyglib_gil_state_ensure(); + if (Py_TYPE(self)->tp_init((PyObject *)self, empty_args, empty_kwargs)) + PyErr_Print(); + pyglib_gil_state_release(state); + + Py_DECREF(empty_args); + Py_DECREF(empty_kwargs); g_object_unref(obj); } else self = NULL; @@ -2210,96 +2234,6 @@ pyg_parse_constructor_args(GType obj_type, return TRUE; } -int -pygobject_constructv(PyGObject *self, - guint n_parameters, - GParameter *parameters) -{ - if (self->obj == NULL) { - GObject *obj; - pygobject_init_wrapper_set((PyObject *) self); - obj = g_object_newv(pyg_type_from_object((PyObject *) self), - n_parameters, parameters); - pygobject_sink (obj); - pygobject_init_wrapper_set(NULL); - if (self->obj == NULL) { - self->obj = obj; - pygobject_register_wrapper((PyObject *) self); - } - } else { - int i; - for (i = 0; i < n_parameters; ++i) - g_object_set_property(self->obj, - parameters[i].name, - ¶meters[i].value); - } - return 0; -} - -/* This function is mostly juste copy-paste from g_object_new, but - * calls pygobject_constructv instead of g_object_newv */ -int -pygobject_construct(PyGObject *self, const char *first_property_name, ...) -{ - va_list var_args; - GObjectClass *class; - GParameter *params; - const gchar *name; - guint n_params = 0, n_alloced_params = 16; - GType object_type = pyg_type_from_object((PyObject *) self); - int retval; - - if (!first_property_name) - return pygobject_constructv(self, 0, NULL); - - va_start(var_args, first_property_name); - class = g_type_class_ref(object_type); - - params = g_new(GParameter, n_alloced_params); - name = first_property_name; - while (name) - { - gchar *error = NULL; - GParamSpec *pspec = g_object_class_find_property(class, name); - - if (!pspec) - { - g_warning("%s: object class `%s' has no property named `%s'", - G_STRFUNC, - g_type_name(object_type), - name); - break; - } - if (n_params >= n_alloced_params) - { - n_alloced_params += 16; - params = g_renew(GParameter, params, n_alloced_params); - } - params[n_params].name = name; - params[n_params].value.g_type = 0; - g_value_init(¶ms[n_params].value, G_PARAM_SPEC_VALUE_TYPE(pspec)); - G_VALUE_COLLECT(¶ms[n_params].value, var_args, 0, &error); - if (error) - { - g_warning("%s: %s", G_STRFUNC, error); - g_free(error); - g_value_unset(¶ms[n_params].value); - break; - } - n_params++; - name = va_arg(var_args, gchar*); - } - - retval = pygobject_constructv(self, n_params, params); - - while (n_params--) - g_value_unset(¶ms[n_params].value); - g_free(params); - va_end(var_args); - g_type_class_unref(class); - return retval; -} - PyObject * pyg_integer_richcompare(PyObject *v, PyObject *w, int op) { @@ -2450,8 +2384,6 @@ struct _PyGObject_Functions pygobject_api_functions = { pyg_register_interface_info, pyg_closure_set_exception_handler, - pygobject_constructv, - pygobject_construct, add_warning_redirection, disable_warning_redirections, @@ -2566,10 +2498,6 @@ pygobject_register_version_tuples(PyObject *d) PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION); PyDict_SetItemString(d, "pygobject_version", tuple); - - /* backwards compatibility */ - PyDict_SetItemString(d, "pygtk_version", tuple); - Py_DECREF(tuple); } static void diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py index 4fb6ee9..0d8a32f 100644 --- a/gi/_gobject/propertyhelper.py +++ b/gi/_gobject/propertyhelper.py @@ -82,7 +82,7 @@ class property(object): @type type: type @param default: default value @param nick: short description - @type bick: string + @type nick: string @param blurb: long description @type blurb: string @param flags: parameter flags, one of: diff --git a/gi/_gobject/pygobject-private.h b/gi/_gobject/pygobject-private.h index 1fed2ae..dabf0a4 100644 --- a/gi/_gobject/pygobject-private.h +++ b/gi/_gobject/pygobject-private.h @@ -89,9 +89,6 @@ gboolean pyg_error_check (GError **error); int pygobject_constructv (PyGObject *self, guint n_parameters, GParameter *parameters); -int pygobject_construct (PyGObject *self, - const char *first_property_name, - ...); PyObject *pyg_integer_richcompare(PyObject *v, PyObject *w, @@ -187,7 +184,7 @@ typedef struct { extern PyTypeObject PyGFlags_Type; -#define PyGFlags_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_FLAGS)) +#define PyGFlags_Check(x) (PyObject_IsInstance((PyObject *)x, (PyObject *)&PyGFlags_Type) && g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_FLAGS)) extern PyObject * pyg_flags_add (PyObject * module, const char * type_name, @@ -197,7 +194,7 @@ extern PyObject * pyg_flags_from_gtype (GType gtype, int value); /* pygenum */ -#define PyGEnum_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_ENUM)) +#define PyGEnum_Check(x) (PyObject_IsInstance((PyObject *)x, (PyObject *)&PyGEnum_Type) && g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_ENUM)) typedef struct { PYGLIB_PyLongObject parent; diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c index 0ad7e95..48a9f18 100644 --- a/gi/_gobject/pygobject.c +++ b/gi/_gobject/pygobject.c @@ -1178,15 +1178,6 @@ pygobject_init(PyGObject *self, PyObject *args, PyObject *kwargs) return (self->obj) ? 0 : -1; } -static PyObject * -pygobject__gobject_init__(PyGObject *self, PyObject *args, PyObject *kwargs) -{ - if (pygobject_init(self, args, kwargs) < 0) - return NULL; - Py_INCREF(Py_None); - return Py_None; -} - #define CHECK_GOBJECT(self) \ if (!G_IS_OBJECT(self->obj)) { \ PyErr_Format(PyExc_TypeError, \ @@ -2033,8 +2024,6 @@ pygobject_handler_unblock_by_func(PyGObject *self, PyObject *args) } static PyMethodDef pygobject_methods[] = { - { "__gobject_init__", (PyCFunction)pygobject__gobject_init__, - METH_VARARGS|METH_KEYWORDS }, { "get_property", (PyCFunction)pygobject_get_property, METH_VARARGS }, { "get_properties", (PyCFunction)pygobject_get_properties, METH_VARARGS }, { "set_property", (PyCFunction)pygobject_set_property, METH_VARARGS }, diff --git a/gi/_gobject/pygobject.h b/gi/_gobject/pygobject.h index 7939563..f728e15 100644 --- a/gi/_gobject/pygobject.h +++ b/gi/_gobject/pygobject.h @@ -9,10 +9,7 @@ G_BEGIN_DECLS -/* This is deprecated, don't use */ -#define PYGIL_API_IS_BUGGY FALSE - - /* PyGClosure is a _private_ structure */ +/* PyGClosure is a _private_ structure */ typedef void (* PyClosureExceptionHandler) (GValue *ret, guint n_param_values, const GValue *params); typedef struct _PyGClosure PyGClosure; typedef struct _PyGObjectData PyGObjectData; @@ -180,12 +177,6 @@ struct _PyGObject_Functions { void (*register_class_init) (GType gtype, PyGClassInitFunc class_init); void (*register_interface_info) (GType gtype, const GInterfaceInfo *info); void (*closure_set_exception_handler) (GClosure *closure, PyClosureExceptionHandler handler); - int (*pygobject_constructv) (PyGObject *self, - guint n_parameters, - GParameter *parameters); - int (*pygobject_construct) (PyGObject *self, - const char *first_property_name, - ...); void (*add_warning_redirection) (const char *domain, PyObject *warning); @@ -219,8 +210,6 @@ struct _PyGObject_Functions *_PyGObject_API; #define pyg_type_wrapper_new (_PyGObject_API->type_wrapper_new) #define pyg_enum_get_value (_PyGObject_API->enum_get_value) #define pyg_flags_get_value (_PyGObject_API->flags_get_value) -/* This is deprecated, call pyg_register_gtype_custom directly instead */ -#define pyg_register_boxed_custom pyg_register_gtype_custom #define pyg_register_gtype_custom (_PyGObject_API->register_gtype_custom) #define pyg_value_from_pyobject (_PyGObject_API->value_from_pyobject) #define pyg_value_as_pyobject (_PyGObject_API->value_as_pyobject) @@ -254,8 +243,6 @@ struct _PyGObject_Functions *_PyGObject_API; #define pyg_gil_state_release (_PyGObject_API->gil_state_release) #define pyg_register_class_init (_PyGObject_API->register_class_init) #define pyg_register_interface_info (_PyGObject_API->register_interface_info) -#define pygobject_construct (_PyGObject_API->pygobject_construct) -#define pygobject_constructv (_PyGObject_API->pygobject_constructv) #define pyg_add_warning_redirection (_PyGObject_API->add_warning_redirection) #define pyg_disable_warning_redirections (_PyGObject_API->disable_warning_redirections) #define pyg_type_register_custom_callback (_PyGObject_API->type_register_custom) @@ -369,8 +356,6 @@ pygobject_init(int req_major, int req_minor, int req_micro) PyObject *version; version = PyObject_GetAttrString(gobject, "pygobject_version"); - if (!version) - version = PyObject_GetAttrString(gobject, "pygtk_version"); if (!version) { PyErr_SetString(PyExc_ImportError, "could not import gobject (version too old)"); @@ -400,18 +385,6 @@ pygobject_init(int req_major, int req_minor, int req_micro) return gobject; } -/* deprecated macro, use pygobject_init() instead. */ -#define init_pygobject() G_STMT_START { \ - if (!pygobject_init(-1, -1, -1)) \ - return; \ -} G_STMT_END - -/* deprecated macro, use pygobject_init() instead. */ -#define init_pygobject_check(req_major, req_minor, req_micro) G_STMT_START { \ - if (!pygobject_init(req_major, req_minor, req_micro)) \ - return; \ -} G_STMT_END - /** * PYLIST_FROMGLIBLIST: * @type: the type of the GLib list e.g. #GList or #GSList diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py index 3485689..d94201e 100644 --- a/gi/overrides/Gdk.py +++ b/gi/overrides/Gdk.py @@ -292,6 +292,55 @@ def color_parse(color): return None return color +# constants +SELECTION_PRIMARY = Gdk.atom_intern('PRIMARY', True) +__all__.append('SELECTION_PRIMARY') + +SELECTION_SECONDARY = Gdk.atom_intern('SECONDARY', True) +__all__.append('SELECTION_SECONDARY') + +SELECTION_CLIPBOARD = Gdk.atom_intern('CLIPBOARD', True) +__all__.append('SELECTION_CLIPBOARD') + +TARGET_BITMAP = Gdk.atom_intern('BITMAP', True) +__all__.append('TARGET_BITMAP') + +TARGET_COLORMAP = Gdk.atom_intern('COLORMAP', True) +__all__.append('TARGET_COLORMAP') + +TARGET_DRAWABLE = Gdk.atom_intern('DRAWABLE', True) +__all__.append('TARGET_DRAWABLE') + +TARGET_PIXMAP = Gdk.atom_intern('PIXMAP', True) +__all__.append('TARGET_PIXMAP') + +TARGET_STRING = Gdk.atom_intern('STRING', True) +__all__.append('TARGET_STRING') + +SELECTION_TYPE_ATOM = Gdk.atom_intern('ATOM', True) +__all__.append('SELECTION_TYPE_ATOM') + +SELECTION_TYPE_BITMAP = Gdk.atom_intern('BITMAP', True) +__all__.append('SELECTION_TYPE_BITMAP') + +SELECTION_TYPE_COLORMAP = Gdk.atom_intern('COLORMAP', True) +__all__.append('SELECTION_TYPE_COLORMAP') + +SELECTION_TYPE_DRAWABLE = Gdk.atom_intern('DRAWABLE', True) +__all__.append('SELECTION_TYPE_DRAWABLE') + +SELECTION_TYPE_INTEGER = Gdk.atom_intern('INTEGER', True) +__all__.append('SELECTION_TYPE_INTEGER') + +SELECTION_TYPE_PIXMAP = Gdk.atom_intern('PIXMAP', True) +__all__.append('SELECTION_TYPE_PIXMAP') + +SELECTION_TYPE_WINDOW = Gdk.atom_intern('WINDOW', True) +__all__.append('SELECTION_TYPE_WINDOW') + +SELECTION_TYPE_STRING = Gdk.atom_intern('STRING', True) +__all__.append('SELECTION_TYPE_STRING') + import sys initialized, argv = Gdk.init_check(sys.argv) diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py index 97c8b40..7945cc8 100644 --- a/gi/overrides/Gtk.py +++ b/gi/overrides/Gtk.py @@ -625,11 +625,10 @@ class TextBuffer(Gtk.TextBuffer): def set_text(self, text, length=-1): Gtk.TextBuffer.set_text(self, text, length) - def insert(self, iter, text): + def insert(self, iter, text, length=-1): if not isinstance(text , _basestring): raise TypeError('text must be a string, not %s' % type(text)) - length = len(text) Gtk.TextBuffer.insert(self, iter, text, length) def insert_with_tags(self, iter, text, *tags): @@ -658,11 +657,10 @@ class TextBuffer(Gtk.TextBuffer): self.insert_with_tags(iter, text, *tag_objs) - def insert_at_cursor(self, text): + def insert_at_cursor(self, text, length=-1): if not isinstance(text , _basestring): raise TypeError('text must be a string, not %s' % type(text)) - length = len(text) Gtk.TextBuffer.insert_at_cursor(self, text, length) def get_selection_bounds(self): diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am index 7a15b46..2657eb3 100644 --- a/gi/overrides/Makefile.am +++ b/gi/overrides/Makefile.am @@ -1,8 +1,5 @@ -PLATFORM_VERSION = 2.0 +pygioverridesdir = $(pyexecdir)/gi/overrides -pkgpyexecdir = $(pyexecdir)/gi - -pygioverridesdir = $(pkgpyexecdir)/overrides pygioverrides_PYTHON = \ GLib.py \ Gtk.py \ diff --git a/gi/overrides/Makefile.in b/gi/overrides/Makefile.in index ffe5df4..1294cb3 100644 --- a/gi/overrides/Makefile.in +++ b/gi/overrides/Makefile.in @@ -168,6 +168,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -178,7 +180,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -220,7 +221,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir)/gi +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -235,8 +236,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -PLATFORM_VERSION = 2.0 -pygioverridesdir = $(pkgpyexecdir)/overrides +pygioverridesdir = $(pyexecdir)/gi/overrides pygioverrides_PYTHON = \ GLib.py \ Gtk.py \ diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index a376443..659c424 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -21,8 +21,8 @@ #include "pygi-info.h" #include "pygi-cache.h" -#include "pygi-marshal-in.h" -#include "pygi-marshal-out.h" +#include "pygi-marshal-to-py.h" +#include "pygi-marshal-from-py.h" #include "pygi-marshal-cleanup.h" #include "pygi-type.h" #include @@ -31,7 +31,7 @@ PyGIArgCache * _arg_cache_new (GITypeInfo *type_info, PyGICallableCache *callable_cache, GIArgInfo *arg_info, GITransfer transfer, - GIDirection direction, + PyGIDirection direction, gssize c_arg_index, gssize py_arg_index); @@ -39,7 +39,7 @@ PyGIArgCache * _arg_cache_new_for_interface (GIInterfaceInfo *iface_info, PyGICallableCache *callable_cache, GIArgInfo *arg_info, GITransfer transfer, - GIDirection direction, + PyGIDirection direction, gssize c_arg_index, gssize py_arg_index); /* cleanup */ @@ -108,7 +108,7 @@ _pygi_callable_cache_free (PyGICallableCache *cache) if (cache == NULL) return; - g_slist_free (cache->out_args); + g_slist_free (cache->to_py_args); g_slist_free (cache->arg_name_list); g_hash_table_destroy (cache->arg_name_hash); @@ -262,274 +262,280 @@ _arg_cache_alloc (void) } static void -_arg_cache_in_void_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_void_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_void; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_void; } static void -_arg_cache_out_void_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_void_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_void; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_void; } static void -_arg_cache_in_boolean_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_boolean_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_boolean; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_boolean; } static void -_arg_cache_out_boolean_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_boolean_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_boolean; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_boolean; } static void -_arg_cache_in_int8_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_int8_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_int8; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_int8; } static void -_arg_cache_out_int8_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_int8_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_int8; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_int8; } static void -_arg_cache_in_uint8_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_uint8_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_uint8; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_uint8; } static void -_arg_cache_out_uint8_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_uint8_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_uint8; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_uint8; } static void -_arg_cache_in_int16_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_int16_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_int16; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_int16; } static void -_arg_cache_out_int16_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_int16_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_int16; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_int16; } static void -_arg_cache_in_uint16_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_uint16_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_uint16; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_uint16; } static void -_arg_cache_out_uint16_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_uint16_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_uint16; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_uint16; } static void -_arg_cache_in_int32_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_int32_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_int32; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_int32; } static void -_arg_cache_out_int32_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_int32_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_int32; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_int32; } static void -_arg_cache_in_uint32_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_uint32_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_uint32; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_uint32; } static void -_arg_cache_out_uint32_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_uint32_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_uint32; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_uint32; } static void -_arg_cache_in_int64_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_int64_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_int64; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_int64; } static void -_arg_cache_out_int64_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_int64_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_int64; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_int64; } static void -_arg_cache_in_uint64_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_uint64_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_uint64; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_uint64; } static void -_arg_cache_out_uint64_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_uint64_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_uint64; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_uint64; } static void -_arg_cache_in_float_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_float_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_float; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_float; } static void -_arg_cache_out_float_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_float_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_float; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_float; } static void -_arg_cache_in_double_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_double_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_double; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_double; } static void -_arg_cache_out_double_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_double_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_double; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_double; } static void -_arg_cache_in_unichar_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_unichar_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_unichar; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_unichar; } static void -_arg_cache_out_unichar_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_unichar_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_unichar; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_unichar; } static void -_arg_cache_in_gtype_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_gtype_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_gtype; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_gtype; } static void -_arg_cache_out_gtype_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_gtype_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_gtype; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_gtype; } static void -_arg_cache_in_utf8_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_utf8_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_utf8; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_utf8; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_utf8; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_utf8; } static void -_arg_cache_out_utf8_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_utf8_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_utf8; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_utf8; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_utf8; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_utf8; } static void -_arg_cache_in_filename_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_filename_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_filename; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_utf8; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_filename; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_utf8; } static void -_arg_cache_out_filename_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_filename_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_filename; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_utf8; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_filename; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_utf8; } static gboolean -_arg_cache_in_array_setup (PyGIArgCache *arg_cache, - PyGICallableCache *callable_cache, - GITypeInfo *type_info, - GITransfer transfer, - GIDirection direction) +_arg_cache_from_py_array_setup (PyGIArgCache *arg_cache, + PyGICallableCache *callable_cache, + GITypeInfo *type_info, + GITransfer transfer, + PyGIDirection direction, + gssize arg_index) { PyGISequenceCache *seq_cache = (PyGISequenceCache *)arg_cache; seq_cache->array_type = g_type_info_get_array_type (type_info); - arg_cache->in_marshaller = _pygi_marshal_in_array; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_array; - if (seq_cache->len_arg_index >= 0 && - direction == GI_DIRECTION_IN) { + if (seq_cache->len_arg_index >= 0) { PyGIArgCache *child_cache = callable_cache->args_cache[seq_cache->len_arg_index]; if (child_cache == NULL) { child_cache = _arg_cache_alloc (); - } else if (child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD) { + } else if (child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD || + child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE) { return TRUE; } - child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; + if (seq_cache->len_arg_index < arg_index) + child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE; + else + child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; + child_cache->direction = direction; - child_cache->in_marshaller = NULL; - child_cache->out_marshaller = NULL; + child_cache->to_py_marshaller = NULL; + child_cache->from_py_marshaller = NULL; callable_cache->args_cache[seq_cache->len_arg_index] = child_cache; } - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_array; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_to_py_array; return TRUE; } static gboolean -_arg_cache_out_array_setup (PyGIArgCache *arg_cache, - PyGICallableCache *callable_cache, - GITypeInfo *type_info, - GITransfer transfer, - GIDirection direction, - gssize arg_index) +_arg_cache_to_py_array_setup (PyGIArgCache *arg_cache, + PyGICallableCache *callable_cache, + GITypeInfo *type_info, + GITransfer transfer, + PyGIDirection direction, + gssize arg_index) { PyGISequenceCache *seq_cache = (PyGISequenceCache *)arg_cache; - arg_cache->out_marshaller = _pygi_marshal_out_array; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_array; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_array; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_array; seq_cache->array_type = g_type_info_get_array_type (type_info); if (seq_cache->len_arg_index >= 0) { PyGIArgCache *child_cache = callable_cache->args_cache[seq_cache->len_arg_index]; if (seq_cache->len_arg_index < arg_index) - callable_cache->n_out_child_args++; + callable_cache->n_to_py_child_args++; if (child_cache != NULL) { - if (child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD) - return TRUE; + callable_cache->to_py_args = + g_slist_remove (callable_cache->to_py_args, child_cache); - callable_cache->out_args = - g_slist_remove (callable_cache->out_args, child_cache); + if (child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD || + child_cache->meta_type == PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE) + return TRUE; } else { child_cache = _arg_cache_alloc (); } child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; child_cache->direction = direction; - child_cache->in_marshaller = NULL; - child_cache->out_marshaller = NULL; + child_cache->to_py_marshaller = NULL; + child_cache->from_py_marshaller = NULL; callable_cache->args_cache[seq_cache->len_arg_index] = child_cache; } @@ -538,175 +544,177 @@ _arg_cache_out_array_setup (PyGIArgCache *arg_cache, } static void -_arg_cache_in_glist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_glist_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_glist; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_glist; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_glist; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_glist; } static void -_arg_cache_out_glist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_glist_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_glist; - arg_cache->in_cleanup = _pygi_marshal_cleanup_out_glist; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_glist; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_glist; } static void -_arg_cache_in_gslist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_gslist_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_gslist; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_glist; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_gslist; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_glist; } static void -_arg_cache_out_gslist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_gslist_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_gslist; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_glist; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_gslist; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_glist; } static void -_arg_cache_in_ghash_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_ghash_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_ghash; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_ghash; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_ghash; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_ghash; } static void -_arg_cache_out_ghash_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_ghash_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_ghash; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_ghash; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_ghash; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_ghash; } static void -_arg_cache_in_gerror_setup (PyGIArgCache *arg_cache) +_arg_cache_from_py_gerror_setup (PyGIArgCache *arg_cache) { - arg_cache->in_marshaller = _pygi_marshal_in_gerror; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_gerror; arg_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; } static void -_arg_cache_out_gerror_setup (PyGIArgCache *arg_cache) +_arg_cache_to_py_gerror_setup (PyGIArgCache *arg_cache) { - arg_cache->out_marshaller = _pygi_marshal_out_gerror; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_gerror; arg_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; } static void -_arg_cache_in_interface_union_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_interface_union_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_interface_struct; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_struct; } static void -_arg_cache_out_interface_union_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_interface_union_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_interface_struct; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_interface_struct; } static void -_arg_cache_in_interface_struct_setup (PyGIArgCache *arg_cache, - GIInterfaceInfo *iface_info, - GITransfer transfer) +_arg_cache_from_py_interface_struct_setup (PyGIArgCache *arg_cache, + GIInterfaceInfo *iface_info, + GITransfer transfer) { PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; iface_cache->is_foreign = g_struct_info_is_foreign ( (GIStructInfo*)iface_info); - arg_cache->in_marshaller = _pygi_marshal_in_interface_struct; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_struct; if (iface_cache->g_type == G_TYPE_VALUE) - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_interface_struct_gvalue; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_interface_struct_gvalue; else if (iface_cache->is_foreign) - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_interface_struct_foreign; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_interface_struct_foreign; } static void -_arg_cache_out_interface_struct_setup (PyGIArgCache *arg_cache, - GIInterfaceInfo *iface_info, - GITransfer transfer) +_arg_cache_to_py_interface_struct_setup (PyGIArgCache *arg_cache, + GIInterfaceInfo *iface_info, + GITransfer transfer) { PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; iface_cache->is_foreign = g_struct_info_is_foreign ( (GIStructInfo*)iface_info); - arg_cache->out_marshaller = _pygi_marshal_out_interface_struct; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_interface_struct; if (iface_cache->is_foreign) - arg_cache->in_cleanup = _pygi_marshal_cleanup_out_interface_struct_foreign; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_interface_struct_foreign; } static void -_arg_cache_in_interface_object_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_interface_object_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_interface_object; - arg_cache->in_cleanup = _pygi_marshal_cleanup_in_interface_object; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_object; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_interface_object; } static void -_arg_cache_out_interface_object_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_interface_object_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_interface_object; - arg_cache->out_cleanup = _pygi_marshal_cleanup_out_interface_object; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_interface_object; + arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_interface_object; } static void -_arg_cache_in_interface_callback_setup (PyGIArgCache *arg_cache, - PyGICallableCache *callable_cache) +_arg_cache_from_py_interface_callback_setup (PyGIArgCache *arg_cache, + PyGICallableCache *callable_cache) { PyGICallbackCache *callback_cache = (PyGICallbackCache *)arg_cache; if (callback_cache->user_data_index >= 0) { PyGIArgCache *user_data_arg_cache = _arg_cache_alloc (); user_data_arg_cache->meta_type = PYGI_META_ARG_TYPE_CHILD_WITH_PYARG; + user_data_arg_cache->direction = PYGI_DIRECTION_FROM_PYTHON; callable_cache->args_cache[callback_cache->user_data_index] = user_data_arg_cache; } if (callback_cache->destroy_notify_index >= 0) { PyGIArgCache *destroy_arg_cache = _arg_cache_alloc (); destroy_arg_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; + destroy_arg_cache->direction = PYGI_DIRECTION_FROM_PYTHON; callable_cache->args_cache[callback_cache->destroy_notify_index] = destroy_arg_cache; } - arg_cache->in_marshaller = _pygi_marshal_in_interface_callback; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_callback; } static void -_arg_cache_out_interface_callback_setup (void) +_arg_cache_to_py_interface_callback_setup (void) { PyErr_Format(PyExc_NotImplementedError, "Callback returns are not supported"); } static void -_arg_cache_in_interface_enum_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_interface_enum_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_interface_enum; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_enum; } static void -_arg_cache_out_interface_enum_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_interface_enum_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_interface_enum; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_interface_enum; } static void -_arg_cache_in_interface_flags_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_from_py_interface_flags_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->in_marshaller = _pygi_marshal_in_interface_flags; + arg_cache->from_py_marshaller = _pygi_marshal_from_py_interface_flags; } static void -_arg_cache_out_interface_flags_setup (PyGIArgCache *arg_cache, - GITransfer transfer) +_arg_cache_to_py_interface_flags_setup (PyGIArgCache *arg_cache, + GITransfer transfer) { - arg_cache->out_marshaller = _pygi_marshal_out_interface_flags; + arg_cache->to_py_marshaller = _pygi_marshal_to_py_interface_flags; } PyGIArgCache * @@ -714,7 +722,7 @@ _arg_cache_new_for_interface (GIInterfaceInfo *iface_info, PyGICallableCache *callable_cache, GIArgInfo *arg_info, GITransfer transfer, - GIDirection direction, + PyGIDirection direction, gssize c_arg_index, gssize py_arg_index) { @@ -743,52 +751,50 @@ _arg_cache_new_for_interface (GIInterfaceInfo *iface_info, switch (info_type) { case GI_INFO_TYPE_UNION: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_union_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_union_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_union_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_union_setup (arg_cache, transfer); break; case GI_INFO_TYPE_STRUCT: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_struct_setup (arg_cache, - iface_info, - transfer); - - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_struct_setup (arg_cache, - iface_info, - transfer); - + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_struct_setup (arg_cache, + iface_info, + transfer); + + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_struct_setup (arg_cache, + iface_info, + transfer); break; case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_object_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_object_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_object_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_object_setup (arg_cache, transfer); break; case GI_INFO_TYPE_BOXED: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_struct_setup (arg_cache, - iface_info, - transfer); - - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_struct_setup (arg_cache, + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_struct_setup (arg_cache, iface_info, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_struct_setup (arg_cache, + iface_info, + transfer); break; case GI_INFO_TYPE_CALLBACK: { PyGICallbackCache *callback_cache; - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { - _arg_cache_out_interface_callback_setup (); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { + _arg_cache_to_py_interface_callback_setup (); return NULL; } @@ -801,25 +807,25 @@ _arg_cache_new_for_interface (GIInterfaceInfo *iface_info, if (arg_cache == NULL) return NULL; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_callback_setup (arg_cache, callable_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_callback_setup (arg_cache, callable_cache); break; } case GI_INFO_TYPE_ENUM: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_enum_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_enum_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_enum_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_enum_setup (arg_cache, transfer); break; case GI_INFO_TYPE_FLAGS: - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_interface_flags_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_interface_flags_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_interface_flags_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_interface_flags_setup (arg_cache, transfer); break; default: @@ -847,14 +853,14 @@ _arg_cache_new (GITypeInfo *type_info, PyGICallableCache *callable_cache, GIArgInfo *arg_info, GITransfer transfer, - GIDirection direction, + PyGIDirection direction, gssize c_arg_index, gssize py_arg_index) { PyGIArgCache *arg_cache = NULL; gssize child_offset = 0; GITypeTag type_tag; - + GI_IS_TYPE_INFO (type_info); type_tag = g_type_info_get_tag (type_info); @@ -870,22 +876,23 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_void_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_void_setup (arg_cache); + + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_void_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_void_setup (arg_cache); break; case GI_TYPE_TAG_BOOLEAN: arg_cache = _arg_cache_alloc (); if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_boolean_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_boolean_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_boolean_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_boolean_setup (arg_cache); break; case GI_TYPE_TAG_INT8: @@ -893,11 +900,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_int8_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_int8_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_int8_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_int8_setup (arg_cache); break; case GI_TYPE_TAG_UINT8: @@ -905,11 +912,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_uint8_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_uint8_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_uint8_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_uint8_setup (arg_cache); break; case GI_TYPE_TAG_INT16: @@ -917,11 +924,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_int16_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_int16_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_int16_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_int16_setup (arg_cache); break; case GI_TYPE_TAG_UINT16: @@ -929,23 +936,22 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_uint16_setup (arg_cache); - - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_uint16_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_uint16_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_uint16_setup (arg_cache); break; case GI_TYPE_TAG_INT32: arg_cache = _arg_cache_alloc (); if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_int32_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_int32_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_int32_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_int32_setup (arg_cache); break; case GI_TYPE_TAG_UINT32: @@ -953,11 +959,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_uint32_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_uint32_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_uint32_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_uint32_setup (arg_cache); break; case GI_TYPE_TAG_INT64: @@ -965,11 +971,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_int64_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_int64_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_int64_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_int64_setup (arg_cache); break; case GI_TYPE_TAG_UINT64: @@ -977,11 +983,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_uint64_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_uint64_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_uint64_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_uint64_setup (arg_cache); break; case GI_TYPE_TAG_FLOAT: @@ -989,11 +995,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_float_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_float_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_float_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_float_setup (arg_cache); break; case GI_TYPE_TAG_DOUBLE: @@ -1001,11 +1007,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_double_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_double_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_double_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_double_setup (arg_cache); break; case GI_TYPE_TAG_UNICHAR: @@ -1013,11 +1019,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_unichar_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_unichar_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_unichar_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_unichar_setup (arg_cache); break; case GI_TYPE_TAG_GTYPE: @@ -1025,11 +1031,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_gtype_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_gtype_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_gtype_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_gtype_setup (arg_cache); break; case GI_TYPE_TAG_UTF8: @@ -1037,11 +1043,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_utf8_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_utf8_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_utf8_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_utf8_setup (arg_cache, transfer); break; case GI_TYPE_TAG_FILENAME: @@ -1049,11 +1055,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_filename_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_filename_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_filename_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_filename_setup (arg_cache, transfer); break; case GI_TYPE_TAG_ARRAY: @@ -1068,20 +1074,21 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_array_setup (arg_cache, - callable_cache, - type_info, - transfer, - direction); - - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_array_setup (arg_cache, - callable_cache, - type_info, - transfer, - direction, - c_arg_index); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_array_setup (arg_cache, + callable_cache, + type_info, + transfer, + direction, + c_arg_index); + + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_array_setup (arg_cache, + callable_cache, + type_info, + transfer, + direction, + c_arg_index); /* ugly edge case code: * @@ -1089,9 +1096,12 @@ _arg_cache_new (GITypeInfo *type_info, * need to update indexes if this happens */ if (seq_cache->len_arg_index > -1 && - seq_cache->len_arg_index < c_arg_index) { + callable_cache->args_cache[seq_cache->len_arg_index]->meta_type == PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE) { gssize i; + PyGIArgCache *child_cache = + callable_cache->args_cache[seq_cache->len_arg_index]; + child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD; py_arg_index -= 1; callable_cache->n_py_args -= 1; @@ -1120,11 +1130,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_glist_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_glist_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_glist_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_glist_setup (arg_cache, transfer); break; @@ -1141,11 +1151,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_gslist_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_gslist_setup (arg_cache, transfer); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_gslist_setup (arg_cache, transfer); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_gslist_setup (arg_cache, transfer); break; } @@ -1158,11 +1168,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_ghash_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_ghash_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { - _arg_cache_out_ghash_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { + _arg_cache_to_py_ghash_setup (arg_cache); } break; @@ -1185,11 +1195,11 @@ _arg_cache_new (GITypeInfo *type_info, if (arg_cache == NULL) break; - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) - _arg_cache_in_gerror_setup (arg_cache); + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_from_py_gerror_setup (arg_cache); - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) - _arg_cache_out_gerror_setup (arg_cache); + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) + _arg_cache_to_py_gerror_setup (arg_cache); break; } @@ -1225,8 +1235,8 @@ _arg_name_list_generate (PyGICallableCache *callable_cache) arg_cache = callable_cache->args_cache[i]; if (arg_cache->meta_type != PYGI_META_ARG_TYPE_CHILD && - (arg_cache->direction == GI_DIRECTION_IN || - arg_cache->direction == GI_DIRECTION_INOUT)) { + (arg_cache->direction == PYGI_DIRECTION_FROM_PYTHON || + arg_cache->direction == PYGI_DIRECTION_BIDIRECTIONAL)) { gpointer arg_name = (gpointer)arg_cache->arg_name; @@ -1250,6 +1260,13 @@ _args_cache_generate (GICallableInfo *callable_info, GITypeInfo *return_info; GITransfer return_transfer; PyGIArgCache *return_cache; + PyGIDirection return_direction; + + /* determine if we are marshalling the return to or from python */ + if (callable_cache->function_type == PYGI_FUNCTION_TYPE_CALLBACK) + return_direction = PYGI_DIRECTION_FROM_PYTHON; + else + return_direction = PYGI_DIRECTION_TO_PYTHON; /* cache the return arg */ return_info = @@ -1261,7 +1278,7 @@ _args_cache_generate (GICallableInfo *callable_info, callable_cache, NULL, return_transfer, - GI_DIRECTION_OUT, + return_direction, -1, -1); @@ -1274,6 +1291,10 @@ _args_cache_generate (GICallableInfo *callable_info, callable_cache->function_type == PYGI_FUNCTION_TYPE_VFUNC) { GIInterfaceInfo *interface_info; PyGIArgCache *instance_cache; + PyGIDirection instance_direction; + + instance_direction = PYGI_DIRECTION_FROM_PYTHON; + interface_info = g_base_info_get_container ( (GIBaseInfo *)callable_info); @@ -1282,11 +1303,12 @@ _args_cache_generate (GICallableInfo *callable_info, callable_cache, NULL, GI_TRANSFER_NOTHING, - GI_DIRECTION_IN, + instance_direction, arg_index, 0); - instance_cache->in_marshaller = _pygi_marshal_in_interface_instance; + /* FIXME: marshal interfaces from_py */ + instance_cache->from_py_marshaller = _pygi_marshal_from_py_interface_instance; g_base_info_unref ( (GIBaseInfo *)interface_info); if (instance_cache == NULL) @@ -1295,7 +1317,7 @@ _args_cache_generate (GICallableInfo *callable_info, callable_cache->args_cache[arg_index] = instance_cache; arg_index++; - callable_cache->n_in_args++; + callable_cache->n_from_py_args++; callable_cache->n_py_args++; } @@ -1304,7 +1326,8 @@ _args_cache_generate (GICallableInfo *callable_info, PyGIArgCache *arg_cache = NULL; GIArgInfo *arg_info; GITypeInfo *type_info; - GIDirection direction; + GIDirection gi_direction; + PyGIDirection direction; GITransfer transfer; GITypeTag type_tag; gboolean is_caller_allocates = FALSE; @@ -1313,7 +1336,21 @@ _args_cache_generate (GICallableInfo *callable_info, arg_info = g_callable_info_get_arg (callable_info, i); - direction = g_arg_info_get_direction (arg_info); + /* For vfuncs and callbacks our marshalling directions + are reversed */ + gi_direction = g_arg_info_get_direction (arg_info); + if (gi_direction == GI_DIRECTION_INOUT) { + direction = PYGI_DIRECTION_BIDIRECTIONAL; + } else if (gi_direction == GI_DIRECTION_IN) { + direction = PYGI_DIRECTION_FROM_PYTHON; + if (callable_cache->function_type == PYGI_FUNCTION_TYPE_CALLBACK) + direction = PYGI_DIRECTION_TO_PYTHON; + } else { + direction = PYGI_DIRECTION_TO_PYTHON; + if (callable_cache->function_type == PYGI_FUNCTION_TYPE_CALLBACK) + direction = PYGI_DIRECTION_FROM_PYTHON; + } + transfer = g_arg_info_get_ownership_transfer (arg_info); type_info = g_arg_info_get_type (arg_info); type_tag = g_type_info_get_tag (type_info); @@ -1322,8 +1359,8 @@ _args_cache_generate (GICallableInfo *callable_info, is_caller_allocates = g_arg_info_is_caller_allocates (arg_info); /* must be an child arg filled in by its owner - * fill in it's c_arg_index, add to the in count * and continue + * fill in it's c_arg_index, add to the in count */ if (callable_cache->args_cache[arg_index] != NULL) { arg_cache = callable_cache->args_cache[arg_index]; @@ -1332,23 +1369,23 @@ _args_cache_generate (GICallableInfo *callable_info, callable_cache->n_py_args++; } - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { - arg_cache->c_arg_index = callable_cache->n_in_args; - callable_cache->n_in_args++; + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { + arg_cache->c_arg_index = callable_cache->n_from_py_args; + callable_cache->n_from_py_args++; } - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { - callable_cache->n_out_args++; - callable_cache->n_out_child_args++; + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { + callable_cache->n_to_py_args++; + callable_cache->n_to_py_child_args++; } g_base_info_unref ( (GIBaseInfo *)arg_info); continue; } - if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { + if (direction == PYGI_DIRECTION_FROM_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { py_arg_index = callable_cache->n_py_args; - callable_cache->n_in_args++; + callable_cache->n_from_py_args++; callable_cache->n_py_args++; } @@ -1368,14 +1405,14 @@ _args_cache_generate (GICallableInfo *callable_info, arg_cache->allow_none = g_arg_info_may_be_null(arg_info); arg_cache->is_caller_allocates = is_caller_allocates; - if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { - callable_cache->n_out_args++; + if (direction == PYGI_DIRECTION_TO_PYTHON || direction == PYGI_DIRECTION_BIDIRECTIONAL) { + callable_cache->n_to_py_args++; if (arg_cache == NULL) goto arg_err; - callable_cache->out_args = - g_slist_append (callable_cache->out_args, arg_cache); + callable_cache->to_py_args = + g_slist_append (callable_cache->to_py_args, arg_cache); } callable_cache->args_cache[arg_index] = arg_cache; diff --git a/gi/pygi-cache.h b/gi/pygi-cache.h index a0e6e4f..510987b 100644 --- a/gi/pygi-cache.h +++ b/gi/pygi-cache.h @@ -32,16 +32,16 @@ G_BEGIN_DECLS typedef struct _PyGICallableCache PyGICallableCache; typedef struct _PyGIArgCache PyGIArgCache; -typedef gboolean (*PyGIMarshalInFunc) (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); +typedef gboolean (*PyGIMarshalFromPyFunc) (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); -typedef PyObject *(*PyGIMarshalOutFunc) (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); +typedef PyObject *(*PyGIMarshalToPyFunc) (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); typedef void (*PyGIMarshalCleanupFunc) (PyGIInvokeState *state, PyGIArgCache *arg_cache, @@ -49,13 +49,17 @@ typedef void (*PyGIMarshalCleanupFunc) (PyGIInvokeState *state, gboolean was_processed); /* Argument meta types denote how we process the argument: - * - Parents (PYGI_META_ARG_TYPE_PARENT) may or may not have children + * - PYGI_META_ARG_TYPE_PARENT - parents may or may not have children * but are always processed via the normal marshaller for their * actual GI type. If they have children the marshaller will * also handle marshalling the children. - * - Children without python argument (PYGI_META_ARG_TYPE_CHILD) are + * - PYGI_META_ARG_TYPE_CHILD - Children without python argument are * ignored by the marshallers and handled directly by their parents * marshaller. + * - PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE -Sometimes children arguments + * come before the parent. In these cases they need to be flagged + * so that the argument list counts must be updated for the cache to + * be valid * - Children with pyargs (PYGI_META_ARG_TYPE_CHILD_WITH_PYARG) are processed * the same as other child args but also have an index into the * python parameters passed to the invoker @@ -63,6 +67,7 @@ typedef void (*PyGIMarshalCleanupFunc) (PyGIInvokeState *state, typedef enum { PYGI_META_ARG_TYPE_PARENT, PYGI_META_ARG_TYPE_CHILD, + PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE, PYGI_META_ARG_TYPE_CHILD_WITH_PYARG } PyGIMetaArgType; @@ -72,14 +77,28 @@ typedef enum { * PyGIFunctionType enum consolidates them into one enumeration for ease of * branching and debugging. */ - typedef enum { - PYGI_FUNCTION_TYPE_FUNCTION, - PYGI_FUNCTION_TYPE_METHOD, - PYGI_FUNCTION_TYPE_CONSTRUCTOR, - PYGI_FUNCTION_TYPE_VFUNC, - PYGI_FUNCTION_TYPE_CALLBACK +typedef enum { + PYGI_FUNCTION_TYPE_FUNCTION, + PYGI_FUNCTION_TYPE_METHOD, + PYGI_FUNCTION_TYPE_CONSTRUCTOR, + PYGI_FUNCTION_TYPE_VFUNC, + PYGI_FUNCTION_TYPE_CALLBACK } PyGIFunctionType; +/* + * In PyGI IN and OUT arguments mean different things depending on the context + * of the callable (e.g. is it a callback that is being called from C or a + * function that is being called from python). We don't as much care if the + * parameter is an IN or OUT C parameter, than we do if the parameter is being + * marshalled into Python or from Python. + */ +typedef enum { + PYGI_DIRECTION_TO_PYTHON, + PYGI_DIRECTION_FROM_PYTHON, + PYGI_DIRECTION_BIDIRECTIONAL + } PyGIDirection; + + struct _PyGIArgCache { const gchar *arg_name; @@ -90,16 +109,16 @@ struct _PyGIArgCache gboolean is_skipped; gboolean allow_none; - GIDirection direction; + PyGIDirection direction; GITransfer transfer; GITypeTag type_tag; GITypeInfo *type_info; - PyGIMarshalInFunc in_marshaller; - PyGIMarshalOutFunc out_marshaller; + PyGIMarshalFromPyFunc from_py_marshaller; + PyGIMarshalToPyFunc to_py_marshaller; - PyGIMarshalCleanupFunc in_cleanup; - PyGIMarshalCleanupFunc out_cleanup; + PyGIMarshalCleanupFunc from_py_cleanup; + PyGIMarshalCleanupFunc to_py_cleanup; GDestroyNotify destroy_notify; @@ -152,14 +171,14 @@ struct _PyGICallableCache PyGIArgCache *return_cache; PyGIArgCache **args_cache; - GSList *out_args; + GSList *to_py_args; GSList *arg_name_list; /* for keyword arg matching */ GHashTable *arg_name_hash; /* counts */ - gssize n_in_args; - gssize n_out_args; - gssize n_out_child_args; + gssize n_from_py_args; + gssize n_to_py_args; + gssize n_to_py_child_args; gssize n_args; gssize n_py_args; diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c index 4a7366c..f669c2e 100644 --- a/gi/pygi-invoke.c +++ b/gi/pygi-invoke.c @@ -43,17 +43,17 @@ _invoke_callable (PyGIInvokeState *state, retval = g_vfunc_info_invoke ( callable_info, state->implementor_gtype, state->in_args, - cache->n_in_args, + cache->n_from_py_args, state->out_args, - cache->n_out_args, + cache->n_to_py_args, &state->return_arg, &error); else retval = g_function_info_invoke ( callable_info, state->in_args, - cache->n_in_args, + cache->n_from_py_args, state->out_args, - cache->n_out_args, + cache->n_to_py_args, &state->return_arg, &error); pyg_end_allow_threads; @@ -67,7 +67,7 @@ _invoke_callable (PyGIInvokeState *state, * We eventually should marshal directly to FFI so we no longer * have to use the reference implementation */ - pygi_marshal_cleanup_args_in_marshal_success (state, cache); + pygi_marshal_cleanup_args_from_py_marshal_success (state, cache); return FALSE; } @@ -76,7 +76,7 @@ _invoke_callable (PyGIInvokeState *state, if (pyglib_error_check (&(state->error))) { /* even though we errored out, the call itself was successful, so we assume the call processed all of the parameters */ - pygi_marshal_cleanup_args_in_marshal_success (state, cache); + pygi_marshal_cleanup_args_from_py_marshal_success (state, cache); return FALSE; } } @@ -299,20 +299,20 @@ _invoke_state_init_from_callable_cache (PyGIInvokeState *state, return FALSE; } - state->in_args = g_slice_alloc0 (cache->n_in_args * sizeof(GIArgument)); - if (state->in_args == NULL && cache->n_in_args != 0) { + state->in_args = g_slice_alloc0 (cache->n_from_py_args * sizeof(GIArgument)); + if (state->in_args == NULL && cache->n_from_py_args != 0) { PyErr_NoMemory (); return FALSE; } - state->out_values = g_slice_alloc0 (cache->n_out_args * sizeof(GIArgument)); - if (state->out_values == NULL && cache->n_out_args != 0) { + state->out_values = g_slice_alloc0 (cache->n_to_py_args * sizeof(GIArgument)); + if (state->out_values == NULL && cache->n_to_py_args != 0) { PyErr_NoMemory (); return FALSE; } - state->out_args = g_slice_alloc0 (cache->n_out_args * sizeof(GIArgument)); - if (state->out_args == NULL && cache->n_out_args != 0) { + state->out_args = g_slice_alloc0 (cache->n_to_py_args * sizeof(GIArgument)); + if (state->out_args == NULL && cache->n_to_py_args != 0) { PyErr_NoMemory (); return FALSE; } @@ -326,9 +326,9 @@ static inline void _invoke_state_clear (PyGIInvokeState *state, PyGICallableCache *cache) { g_slice_free1 (cache->n_args * sizeof(GIArgument *), state->args); - g_slice_free1 (cache->n_in_args * sizeof(GIArgument), state->in_args); - g_slice_free1 (cache->n_out_args * sizeof(GIArgument), state->out_args); - g_slice_free1 (cache->n_out_args * sizeof(GIArgument), state->out_values); + g_slice_free1 (cache->n_from_py_args * sizeof(GIArgument), state->in_args); + g_slice_free1 (cache->n_to_py_args * sizeof(GIArgument), state->out_args); + g_slice_free1 (cache->n_to_py_args * sizeof(GIArgument), state->out_values); Py_XDECREF (state->py_in_args); } @@ -396,7 +396,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) PyObject *py_arg = NULL; switch (arg_cache->direction) { - case GI_DIRECTION_IN: + case PYGI_DIRECTION_FROM_PYTHON: state->args[i] = &(state->in_args[in_count]); in_count++; @@ -413,9 +413,9 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) /* clean up all of the args we have already marshalled, * since invoke will not be called */ - pygi_marshal_cleanup_args_in_parameter_fail (state, - cache, - i - 1); + pygi_marshal_cleanup_args_from_py_parameter_fail (state, + cache, + i - 1); return FALSE; } @@ -424,7 +424,7 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) arg_cache->py_arg_index); break; - case GI_DIRECTION_INOUT: + case PYGI_DIRECTION_BIDIRECTIONAL: /* this will be filled in if it is an child value */ if (state->in_args[in_count].v_pointer != NULL) state->out_values[out_count] = state->in_args[in_count]; @@ -439,9 +439,9 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) cache->name, cache->n_py_args, state->n_py_in_args); - pygi_marshal_cleanup_args_in_parameter_fail (state, - cache, - i - 1); + pygi_marshal_cleanup_args_from_py_parameter_fail (state, + cache, + i - 1); return FALSE; } @@ -449,15 +449,15 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) PyTuple_GET_ITEM (state->py_in_args, arg_cache->py_arg_index); } - case GI_DIRECTION_OUT: + case PYGI_DIRECTION_TO_PYTHON: if (arg_cache->is_caller_allocates) { if (!_caller_alloc (state, arg_cache, i, out_count)) { PyErr_Format (PyExc_TypeError, "Could not caller allocate argument %zd of callable %s", i, cache->name); - pygi_marshal_cleanup_args_in_parameter_fail (state, - cache, - i - 1); + pygi_marshal_cleanup_args_from_py_parameter_fail (state, + cache, + i - 1); return FALSE; } } else { @@ -469,26 +469,26 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache) } c_arg = state->args[i]; - if (arg_cache->in_marshaller != NULL) { + if (arg_cache->from_py_marshaller != NULL) { if (!arg_cache->allow_none && py_arg == Py_None) { PyErr_Format (PyExc_TypeError, "Argument %i does not allow None as a value", i); - pygi_marshal_cleanup_args_in_parameter_fail (state, - cache, - i - 1); + pygi_marshal_cleanup_args_from_py_parameter_fail (state, + cache, + i - 1); return FALSE; } - gboolean success = arg_cache->in_marshaller (state, - cache, - arg_cache, - py_arg, - c_arg); - if (!success) { - pygi_marshal_cleanup_args_in_parameter_fail (state, + gboolean success = arg_cache->from_py_marshaller (state, cache, - i - 1); + arg_cache, + py_arg, + c_arg); + if (!success) { + pygi_marshal_cleanup_args_from_py_parameter_fail (state, + cache, + i - 1); return FALSE; } @@ -504,7 +504,7 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGICallableCache *cache) { PyObject *py_out = NULL; PyObject *py_return = NULL; - gssize total_out_args = cache->n_out_args; + gssize total_out_args = cache->n_to_py_args; gboolean has_return = FALSE; if (cache->return_cache) { @@ -518,10 +518,10 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGICallableCache *cache) } } - py_return = cache->return_cache->out_marshaller ( state, - cache, - cache->return_cache, - &state->return_arg); + py_return = cache->return_cache->to_py_marshaller ( state, + cache, + cache->return_cache, + &state->return_arg); if (py_return == NULL) { pygi_marshal_cleanup_args_return_fail (state, cache); @@ -535,39 +535,39 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGICallableCache *cache) } } else { if (cache->return_cache->transfer == GI_TRANSFER_EVERYTHING) { - PyGIMarshalCleanupFunc out_cleanup = - cache->return_cache->out_cleanup; - - if (out_cleanup != NULL) - out_cleanup ( state, - cache->return_cache, - &state->return_arg, - FALSE); + PyGIMarshalCleanupFunc to_py_cleanup = + cache->return_cache->to_py_cleanup; + + if (to_py_cleanup != NULL) + to_py_cleanup ( state, + cache->return_cache, + &state->return_arg, + FALSE); } } } - total_out_args -= cache->n_out_child_args; + total_out_args -= cache->n_to_py_child_args; - if (cache->n_out_args - cache->n_out_child_args == 0) { + if (cache->n_to_py_args - cache->n_to_py_child_args == 0) { py_out = py_return; } else if (total_out_args == 1) { /* if we get here there is one out arg an no return */ - PyGIArgCache *arg_cache = (PyGIArgCache *)cache->out_args->data; - py_out = arg_cache->out_marshaller (state, - cache, - arg_cache, - state->args[arg_cache->c_arg_index]); + PyGIArgCache *arg_cache = (PyGIArgCache *)cache->to_py_args->data; + py_out = arg_cache->to_py_marshaller (state, + cache, + arg_cache, + state->args[arg_cache->c_arg_index]); if (py_out == NULL) { - pygi_marshal_cleanup_args_out_parameter_fail (state, - cache, - 0); + pygi_marshal_cleanup_args_to_py_parameter_fail (state, + cache, + 0); return NULL; } } else { gssize py_arg_index = 0; - GSList *cache_item = cache->out_args; + GSList *cache_item = cache->to_py_args; /* return a tuple */ py_out = PyTuple_New (total_out_args); if (has_return) { @@ -577,18 +577,18 @@ _invoke_marshal_out_args (PyGIInvokeState *state, PyGICallableCache *cache) for(; py_arg_index < total_out_args; py_arg_index++) { PyGIArgCache *arg_cache = (PyGIArgCache *)cache_item->data; - PyObject *py_obj = arg_cache->out_marshaller (state, - cache, - arg_cache, - state->args[arg_cache->c_arg_index]); + PyObject *py_obj = arg_cache->to_py_marshaller (state, + cache, + arg_cache, + state->args[arg_cache->c_arg_index]); if (py_obj == NULL) { if (has_return) py_arg_index--; - pygi_marshal_cleanup_args_out_parameter_fail (state, - cache, - py_arg_index); + pygi_marshal_cleanup_args_to_py_parameter_fail (state, + cache, + py_arg_index); Py_DECREF (py_out); return NULL; } @@ -623,11 +623,11 @@ _wrap_g_callable_info_invoke (PyGIBaseInfo *self, if (!_invoke_callable (&state, self->cache, self->info)) goto err; - pygi_marshal_cleanup_args_in_marshal_success (&state, self->cache); + pygi_marshal_cleanup_args_from_py_marshal_success (&state, self->cache); ret = _invoke_marshal_out_args (&state, self->cache); if (ret) - pygi_marshal_cleanup_args_out_marshal_success (&state, self->cache); + pygi_marshal_cleanup_args_to_py_marshal_success (&state, self->cache); err: _invoke_state_clear (&state, self->cache); return ret; diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c index cd072f4..8ed9bdb 100644 --- a/gi/pygi-marshal-cleanup.c +++ b/gi/pygi-marshal-cleanup.c @@ -66,42 +66,42 @@ _cleanup_caller_allocates (PyGIInvokeState *state, * stage (either success or failure) * * The in stage must call one of these cleanup functions: - * - pygi_marshal_cleanup_args_in_marshal_success + * - pygi_marshal_cleanup_args_from_py_marshal_success * (continue to out stage) - * - pygi_marshal_cleanup_args_in_parameter_fail + * - pygi_marshal_cleanup_args_from_py_parameter_fail * (final, exit from invoke) * * The out stage must call one of these cleanup functions which are all final: - * - pygi_marshal_cleanup_args_out_marshal_success + * - pygi_marshal_cleanup_args_to_py_marshal_success * - pygi_marshal_cleanup_args_return_fail - * - pygi_marshal_cleanup_args_out_parameter_fail + * - pygi_marshal_cleanup_args_to_py_parameter_fail * **/ void -pygi_marshal_cleanup_args_in_marshal_success (PyGIInvokeState *state, - PyGICallableCache *cache) +pygi_marshal_cleanup_args_from_py_marshal_success (PyGIInvokeState *state, + PyGICallableCache *cache) { gssize i; /* For in success, call cleanup for all GI_DIRECTION_IN values only. */ for (i = 0; i < cache->n_args; i++) { PyGIArgCache *arg_cache = cache->args_cache[i]; - PyGIMarshalCleanupFunc cleanup_func = arg_cache->in_cleanup; + PyGIMarshalCleanupFunc cleanup_func = arg_cache->from_py_cleanup; if (cleanup_func && - arg_cache->direction == GI_DIRECTION_IN && + arg_cache->direction == PYGI_DIRECTION_FROM_PYTHON && state->args[i]->v_pointer != NULL) cleanup_func (state, arg_cache, state->args[i]->v_pointer, TRUE); } } void -pygi_marshal_cleanup_args_out_marshal_success (PyGIInvokeState *state, - PyGICallableCache *cache) +pygi_marshal_cleanup_args_to_py_marshal_success (PyGIInvokeState *state, + PyGICallableCache *cache) { /* clean up the return if available */ if (cache->return_cache != NULL) { - PyGIMarshalCleanupFunc cleanup_func = cache->return_cache->out_cleanup; + PyGIMarshalCleanupFunc cleanup_func = cache->return_cache->to_py_cleanup; if (cleanup_func && state->return_arg.v_pointer != NULL) cleanup_func (state, cache->return_cache, @@ -110,10 +110,10 @@ pygi_marshal_cleanup_args_out_marshal_success (PyGIInvokeState *state, } /* Now clean up args */ - GSList *cache_item = cache->out_args; + GSList *cache_item = cache->to_py_args; while (cache_item) { PyGIArgCache *arg_cache = (PyGIArgCache *) cache_item->data; - PyGIMarshalCleanupFunc cleanup_func = arg_cache->out_cleanup; + PyGIMarshalCleanupFunc cleanup_func = arg_cache->to_py_cleanup; gpointer data = state->args[arg_cache->c_arg_index]->v_pointer; if (cleanup_func != NULL && data != NULL) @@ -127,9 +127,9 @@ pygi_marshal_cleanup_args_out_marshal_success (PyGIInvokeState *state, } void -pygi_marshal_cleanup_args_in_parameter_fail (PyGIInvokeState *state, - PyGICallableCache *cache, - gssize failed_arg_index) +pygi_marshal_cleanup_args_from_py_parameter_fail (PyGIInvokeState *state, + PyGICallableCache *cache, + gssize failed_arg_index) { gssize i; @@ -137,11 +137,11 @@ pygi_marshal_cleanup_args_in_parameter_fail (PyGIInvokeState *state, for (i = 0; i < cache->n_args && i <= failed_arg_index; i++) { PyGIArgCache *arg_cache = cache->args_cache[i]; - PyGIMarshalCleanupFunc cleanup_func = arg_cache->in_cleanup; + PyGIMarshalCleanupFunc cleanup_func = arg_cache->from_py_cleanup; gpointer data = state->args[i]->v_pointer; if (cleanup_func && - arg_cache->direction == GI_DIRECTION_IN && + arg_cache->direction == PYGI_DIRECTION_FROM_PYTHON && data != NULL) { cleanup_func (state, arg_cache, @@ -164,9 +164,9 @@ pygi_marshal_cleanup_args_return_fail (PyGIInvokeState *state, } void -pygi_marshal_cleanup_args_out_parameter_fail (PyGIInvokeState *state, +pygi_marshal_cleanup_args_to_py_parameter_fail (PyGIInvokeState *state, PyGICallableCache *cache, - gssize failed_out_arg_index) + gssize failed_to_py_arg_index) { state->failed = TRUE; } @@ -181,10 +181,10 @@ _pygi_marshal_cleanup_closure_unref (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_utf8 (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_utf8 (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { /* We strdup strings so always free if we have processed this parameter for input */ @@ -193,10 +193,10 @@ _pygi_marshal_cleanup_in_utf8 (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_utf8 (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_utf8 (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { /* Python copies the string so we need to free it if the interface is transfering ownership, @@ -206,10 +206,10 @@ _pygi_marshal_cleanup_out_utf8 (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_interface_object (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_interface_object (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { /* If we processed the parameter but fail before invoking the method, we need to remove the ref we added */ @@ -219,10 +219,10 @@ _pygi_marshal_cleanup_in_interface_object (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_interface_object (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_interface_object (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { /* If we error out and the object is not marshalled into a PyGObject we must take care of removing the ref */ @@ -231,10 +231,10 @@ _pygi_marshal_cleanup_out_interface_object (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_interface_struct_gvalue (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_interface_struct_gvalue (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (was_processed) { PyObject *py_arg = PyTuple_GET_ITEM (state->py_in_args, @@ -250,10 +250,10 @@ _pygi_marshal_cleanup_in_interface_struct_gvalue (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_interface_struct_foreign (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_interface_struct_foreign (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (state->failed && was_processed) pygi_struct_foreign_release ( @@ -262,10 +262,10 @@ _pygi_marshal_cleanup_in_interface_struct_foreign (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_interface_struct_foreign (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_interface_struct_foreign (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (!was_processed && arg_cache->transfer == GI_TRANSFER_EVERYTHING) pygi_struct_foreign_release ( @@ -274,10 +274,10 @@ _pygi_marshal_cleanup_out_interface_struct_foreign (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_array (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_array (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (was_processed) { GArray *array_; @@ -311,10 +311,10 @@ _pygi_marshal_cleanup_in_array (PyGIInvokeState *state, } /* clean up items first */ - if (sequence_cache->item_cache->in_cleanup != NULL) { + if (sequence_cache->item_cache->from_py_cleanup != NULL) { gsize i; PyGIMarshalCleanupFunc cleanup_func = - sequence_cache->item_cache->in_cleanup; + sequence_cache->item_cache->from_py_cleanup; for(i = 0; i < array_->len; i++) { cleanup_func (state, @@ -335,10 +335,10 @@ _pygi_marshal_cleanup_in_array (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_array (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache; @@ -351,10 +351,10 @@ _pygi_marshal_cleanup_out_array (PyGIInvokeState *state, return; } - if (sequence_cache->item_cache->out_cleanup != NULL) { + if (sequence_cache->item_cache->to_py_cleanup != NULL) { gsize i; - PyGIMarshalCleanupFunc cleanup_func = sequence_cache->item_cache->out_cleanup; + PyGIMarshalCleanupFunc cleanup_func = sequence_cache->item_cache->to_py_cleanup; for (i = 0; i < array_->len; i++) { cleanup_func (state, sequence_cache->item_cache, @@ -369,10 +369,10 @@ _pygi_marshal_cleanup_out_array (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_glist (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_glist (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (was_processed) { GSList *list_; @@ -381,9 +381,9 @@ _pygi_marshal_cleanup_in_glist (PyGIInvokeState *state, list_ = (GSList *)data; /* clean up items first */ - if (sequence_cache->item_cache->in_cleanup != NULL) { + if (sequence_cache->item_cache->from_py_cleanup != NULL) { PyGIMarshalCleanupFunc cleanup_func = - sequence_cache->item_cache->in_cleanup; + sequence_cache->item_cache->from_py_cleanup; GSList *node = list_; while (node != NULL) { cleanup_func (state, @@ -412,10 +412,10 @@ _pygi_marshal_cleanup_in_glist (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_glist (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_glist (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache; @@ -423,9 +423,9 @@ _pygi_marshal_cleanup_out_glist (PyGIInvokeState *state, arg_cache->transfer == GI_TRANSFER_CONTAINER) { GSList *list_ = (GSList *)data; - if (sequence_cache->item_cache->out_cleanup != NULL) { + if (sequence_cache->item_cache->to_py_cleanup != NULL) { PyGIMarshalCleanupFunc cleanup_func = - sequence_cache->item_cache->out_cleanup; + sequence_cache->item_cache->to_py_cleanup; GSList *node = list_; while (node != NULL) { @@ -453,10 +453,10 @@ _pygi_marshal_cleanup_out_glist (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_in_ghash (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_from_py_ghash (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (data == NULL) return; @@ -468,16 +468,16 @@ _pygi_marshal_cleanup_in_ghash (PyGIInvokeState *state, hash_ = (GHashTable *)data; /* clean up keys and values first */ - if (hash_cache->key_cache->in_cleanup != NULL || - hash_cache->value_cache->in_cleanup != NULL) { + if (hash_cache->key_cache->from_py_cleanup != NULL || + hash_cache->value_cache->from_py_cleanup != NULL) { GHashTableIter hiter; gpointer key; gpointer value; PyGIMarshalCleanupFunc key_cleanup_func = - hash_cache->key_cache->in_cleanup; + hash_cache->key_cache->from_py_cleanup; PyGIMarshalCleanupFunc value_cleanup_func = - hash_cache->value_cache->in_cleanup; + hash_cache->value_cache->from_py_cleanup; g_hash_table_iter_init (&hiter, hash_); while (g_hash_table_iter_next (&hiter, &key, &value)) { @@ -503,10 +503,10 @@ _pygi_marshal_cleanup_in_ghash (PyGIInvokeState *state, } void -_pygi_marshal_cleanup_out_ghash (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed) +_pygi_marshal_cleanup_to_py_ghash (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed) { if (data == NULL) return; diff --git a/gi/pygi-marshal-cleanup.h b/gi/pygi-marshal-cleanup.h index 3aff8fa..92027be 100644 --- a/gi/pygi-marshal-cleanup.h +++ b/gi/pygi-marshal-cleanup.h @@ -26,72 +26,72 @@ G_BEGIN_DECLS -void pygi_marshal_cleanup_args_in_marshal_success (PyGIInvokeState *state, - PyGICallableCache *cache); -void pygi_marshal_cleanup_args_in_parameter_fail (PyGIInvokeState *state, - PyGICallableCache *cache, - gssize failed_arg_index); +void pygi_marshal_cleanup_args_from_py_marshal_success (PyGIInvokeState *state, + PyGICallableCache *cache); +void pygi_marshal_cleanup_args_from_py_parameter_fail (PyGIInvokeState *state, + PyGICallableCache *cache, + gssize failed_arg_index); -void pygi_marshal_cleanup_args_out_marshal_success (PyGIInvokeState *state, - PyGICallableCache *cache); -void pygi_marshal_cleanup_args_return_fail (PyGIInvokeState *state, - PyGICallableCache *cache); -void pygi_marshal_cleanup_args_out_parameter_fail (PyGIInvokeState *state, - PyGICallableCache *cache, - gssize failed_out_arg_index); +void pygi_marshal_cleanup_args_to_py_marshal_success (PyGIInvokeState *state, + PyGICallableCache *cache); +void pygi_marshal_cleanup_args_return_fail (PyGIInvokeState *state, + PyGICallableCache *cache); +void pygi_marshal_cleanup_args_to_py_parameter_fail (PyGIInvokeState *state, + PyGICallableCache *cache, + gssize failed_to_py_arg_index); -void _pygi_marshal_cleanup_in_utf8 (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_utf8 (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_interface_struct_gvalue (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_interface_struct_foreign (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_interface_struct_foreign (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_interface_object (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_interface_object (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_array (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_array (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_glist (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_glist (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_in_ghash (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); -void _pygi_marshal_cleanup_out_ghash (PyGIInvokeState *state, - PyGIArgCache *arg_cache, - gpointer data, - gboolean was_processed); +void _pygi_marshal_cleanup_from_py_utf8 (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_utf8 (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_interface_struct_gvalue (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_interface_struct_foreign (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_interface_struct_foreign (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_interface_object (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_interface_object (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_array (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_glist (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_glist (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_from_py_ghash (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); +void _pygi_marshal_cleanup_to_py_ghash (PyGIInvokeState *state, + PyGIArgCache *arg_cache, + gpointer data, + gboolean was_processed); G_END_DECLS #endif /* __PYGI_MARSHAL_CLEANUP_H__ */ diff --git a/gi/pygi-marshal-in.c b/gi/pygi-marshal-from-py.c similarity index 70% rename from gi/pygi-marshal-in.c rename to gi/pygi-marshal-from-py.c index 9ae7def..6d41eb8 100644 --- a/gi/pygi-marshal-in.c +++ b/gi/pygi-marshal-from-py.c @@ -3,7 +3,7 @@ * * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. * - * pygi-marshal-in.c: PyObject conversion functions for in parameters. + * pygi-marshal-from-py.c: Functions to convert PyObjects to C types. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,14 +32,14 @@ #include "pygi-cache.h" #include "pygi-marshal-cleanup.h" -#include "pygi-marshal-in.h" +#include "pygi-marshal-from-py.h" gboolean -_pygi_marshal_in_void (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_void (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { g_warn_if_fail (arg_cache->transfer == GI_TRANSFER_NOTHING); @@ -49,11 +49,11 @@ _pygi_marshal_in_void (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_boolean (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_boolean (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { arg->v_boolean = PyObject_IsTrue (py_arg); @@ -61,11 +61,11 @@ _pygi_marshal_in_boolean (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_int8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_int8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long_; @@ -100,11 +100,11 @@ _pygi_marshal_in_int8 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_uint8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_uint8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { unsigned long long_; @@ -149,11 +149,11 @@ _pygi_marshal_in_uint8 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_int16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_int16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long_; @@ -188,11 +188,11 @@ _pygi_marshal_in_int16 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_uint16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_uint16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long_; @@ -227,11 +227,11 @@ _pygi_marshal_in_uint16 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_int32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_int32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long_; @@ -266,11 +266,11 @@ _pygi_marshal_in_int32 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_uint32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_uint32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long long_; @@ -311,11 +311,11 @@ _pygi_marshal_in_uint32 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_int64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_int64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; long long long_; @@ -383,11 +383,11 @@ _pygi_marshal_in_int64 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_uint64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_uint64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_long; guint64 ulong_; @@ -462,11 +462,11 @@ _pygi_marshal_in_uint64 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_float (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_float (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_float; double double_; @@ -501,11 +501,11 @@ _pygi_marshal_in_float (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_double (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_double (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *py_float; double double_; @@ -540,11 +540,11 @@ _pygi_marshal_in_double (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_unichar (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_unichar (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { Py_ssize_t size; gchar *string_; @@ -586,11 +586,11 @@ _pygi_marshal_in_unichar (PyGIInvokeState *state, return TRUE; } gboolean -_pygi_marshal_in_gtype (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_gtype (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { long type_ = pyg_type_from_object (py_arg); @@ -604,11 +604,11 @@ _pygi_marshal_in_gtype (PyGIInvokeState *state, return TRUE; } gboolean -_pygi_marshal_in_utf8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_utf8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { gchar *string_; @@ -641,11 +641,11 @@ _pygi_marshal_in_utf8 (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_filename (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_filename (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { gchar *string_; GError *error = NULL; @@ -683,15 +683,16 @@ _pygi_marshal_in_filename (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_array (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_array (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { - PyGIMarshalInFunc in_marshaller; + PyGIMarshalFromPyFunc from_py_marshaller; int i; Py_ssize_t length; + gssize item_size; gboolean is_ptr_array; GArray *array_ = NULL; PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache; @@ -720,13 +721,14 @@ _pygi_marshal_in_array (PyGIInvokeState *state, return FALSE; } + item_size = sequence_cache->item_size; is_ptr_array = (sequence_cache->array_type == GI_ARRAY_TYPE_PTR_ARRAY); if (is_ptr_array) { array_ = (GArray *)g_ptr_array_new (); } else { array_ = g_array_sized_new (sequence_cache->is_zero_terminated, FALSE, - sequence_cache->item_size, + item_size, length); } @@ -742,34 +744,61 @@ _pygi_marshal_in_array (PyGIInvokeState *state, goto array_success; } - in_marshaller = sequence_cache->item_cache->in_marshaller; + from_py_marshaller = sequence_cache->item_cache->from_py_marshaller; for (i = 0; i < length; i++) { GIArgument item; PyObject *py_item = PySequence_GetItem (py_arg, i); if (py_item == NULL) goto err; - if (!in_marshaller ( state, - callable_cache, - sequence_cache->item_cache, - py_item, - &item)) + if (!from_py_marshaller ( state, + callable_cache, + sequence_cache->item_cache, + py_item, + &item)) goto err; /* FIXME: it is much more efficent to have seperate marshaller * for ptr arrays than doing the evaluation * and casting each loop iteration */ - if (is_ptr_array) + if (is_ptr_array) { g_ptr_array_add((GPtrArray *)array_, item.v_pointer); - else + } else if (sequence_cache->item_cache->type_tag == GI_TYPE_TAG_INTERFACE) { + PyGIInterfaceCache *item_iface_cache = (PyGIInterfaceCache *) sequence_cache->item_cache; + GIBaseInfo *base_info = (GIBaseInfo *) item_iface_cache->interface_info; + GIInfoType info_type = g_base_info_get_type (base_info); + + switch (info_type) { + case GI_INFO_TYPE_UNION: + case GI_INFO_TYPE_STRUCT: + { + PyGIArgCache *item_arg_cache = (PyGIArgCache *)item_iface_cache; + PyGIMarshalCleanupFunc from_py_cleanup = item_arg_cache->from_py_cleanup; + gboolean is_boxed = g_type_is_a (item_iface_cache->g_type, G_TYPE_BOXED); + gboolean is_gvalue = item_iface_cache->g_type == G_TYPE_VALUE; + + if (!is_boxed || is_gvalue) { + memcpy (array_->data + (i * item_size), item.v_pointer, item_size); + if (from_py_cleanup) + from_py_cleanup (state, item_arg_cache, item.v_pointer, TRUE); + } else { + g_array_insert_val (array_, i, item); + } + break; + } + default: + g_array_insert_val (array_, i, item); + } + } else { g_array_insert_val (array_, i, item); + } continue; err: - if (sequence_cache->item_cache->in_cleanup != NULL) { + if (sequence_cache->item_cache->from_py_cleanup != NULL) { gsize j; PyGIMarshalCleanupFunc cleanup_func = - sequence_cache->item_cache->in_cleanup; + sequence_cache->item_cache->from_py_cleanup; for(j = 0; j < i; j++) { cleanup_func (state, @@ -780,7 +809,7 @@ err: } if (is_ptr_array) - g_ptr_array_free (array_, TRUE); + g_ptr_array_free ( ( GPtrArray *)array_, TRUE); else g_array_free (array_, TRUE); _PyGI_ERROR_PREFIX ("Item %i: ", i); @@ -793,7 +822,7 @@ array_success: PyGIArgCache *child_cache = callable_cache->args_cache[sequence_cache->len_arg_index]; - if (child_cache->direction == GI_DIRECTION_INOUT) { + if (child_cache->direction == PYGI_DIRECTION_BIDIRECTIONAL) { gint *len_arg = (gint *)state->in_args[child_cache->c_arg_index].v_pointer; /* if we are not setup yet just set the in arg */ if (len_arg == NULL) @@ -816,13 +845,13 @@ array_success: } gboolean -_pygi_marshal_in_glist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_glist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { - PyGIMarshalInFunc in_marshaller; + PyGIMarshalFromPyFunc from_py_marshaller; int i; Py_ssize_t length; GList *list_ = NULL; @@ -852,25 +881,25 @@ _pygi_marshal_in_glist (PyGIInvokeState *state, return FALSE; } - in_marshaller = sequence_cache->item_cache->in_marshaller; + from_py_marshaller = sequence_cache->item_cache->from_py_marshaller; for (i = 0; i < length; i++) { GIArgument item; PyObject *py_item = PySequence_GetItem (py_arg, i); if (py_item == NULL) goto err; - if (!in_marshaller ( state, - callable_cache, - sequence_cache->item_cache, - py_item, - &item)) + if (!from_py_marshaller ( state, + callable_cache, + sequence_cache->item_cache, + py_item, + &item)) goto err; list_ = g_list_append (list_, item.v_pointer); continue; err: - if (sequence_cache->item_cache->in_cleanup != NULL) { - GDestroyNotify cleanup = sequence_cache->item_cache->in_cleanup; + if (sequence_cache->item_cache->from_py_cleanup != NULL) { + PyGIMarshalCleanupFunc cleanup = sequence_cache->item_cache->from_py_cleanup; } g_list_free (list_); @@ -883,13 +912,13 @@ err: } gboolean -_pygi_marshal_in_gslist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_gslist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { - PyGIMarshalInFunc in_marshaller; + PyGIMarshalFromPyFunc from_py_marshaller; int i; Py_ssize_t length; GSList *list_ = NULL; @@ -918,14 +947,14 @@ _pygi_marshal_in_gslist (PyGIInvokeState *state, return FALSE; } - in_marshaller = sequence_cache->item_cache->in_marshaller; + from_py_marshaller = sequence_cache->item_cache->from_py_marshaller; for (i = 0; i < length; i++) { GIArgument item; PyObject *py_item = PySequence_GetItem (py_arg, i); if (py_item == NULL) goto err; - if (!in_marshaller ( state, + if (!from_py_marshaller ( state, callable_cache, sequence_cache->item_cache, py_item, @@ -935,8 +964,8 @@ _pygi_marshal_in_gslist (PyGIInvokeState *state, list_ = g_slist_append (list_, item.v_pointer); continue; err: - if (sequence_cache->item_cache->in_cleanup != NULL) { - GDestroyNotify cleanup = sequence_cache->item_cache->in_cleanup; + if (sequence_cache->item_cache->from_py_cleanup != NULL) { + PyGIMarshalCleanupFunc cleanup = sequence_cache->item_cache->from_py_cleanup; } g_slist_free (list_); @@ -949,14 +978,14 @@ err: } gboolean -_pygi_marshal_in_ghash (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_ghash (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { - PyGIMarshalInFunc key_in_marshaller; - PyGIMarshalInFunc value_in_marshaller; + PyGIMarshalFromPyFunc key_from_py_marshaller; + PyGIMarshalFromPyFunc value_from_py_marshaller; int i; Py_ssize_t length; @@ -992,8 +1021,8 @@ _pygi_marshal_in_ghash (PyGIInvokeState *state, return FALSE; } - key_in_marshaller = hash_cache->key_cache->in_marshaller; - value_in_marshaller = hash_cache->value_cache->in_marshaller; + key_from_py_marshaller = hash_cache->key_cache->from_py_marshaller; + value_from_py_marshaller = hash_cache->value_cache->from_py_marshaller; switch (hash_cache->key_cache->type_tag) { case GI_TYPE_TAG_UTF8: @@ -1021,18 +1050,18 @@ _pygi_marshal_in_ghash (PyGIInvokeState *state, if (py_key == NULL || py_value == NULL) goto err; - if (!key_in_marshaller ( state, - callable_cache, - hash_cache->key_cache, - py_key, - &key)) + if (!key_from_py_marshaller ( state, + callable_cache, + hash_cache->key_cache, + py_key, + &key)) goto err; - if (!value_in_marshaller ( state, - callable_cache, - hash_cache->value_cache, - py_value, - &value)) + if (!value_from_py_marshaller ( state, + callable_cache, + hash_cache->value_cache, + py_value, + &value)) goto err; g_hash_table_insert (hash_, key.v_pointer, value.v_pointer); @@ -1053,11 +1082,11 @@ err: } gboolean -_pygi_marshal_in_gerror (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_gerror (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyErr_Format (PyExc_NotImplementedError, "Marshalling for GErrors is not implemented"); @@ -1065,11 +1094,11 @@ _pygi_marshal_in_gerror (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_interface_callback (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { GICallableInfo *callable_info; PyGICClosure *closure; @@ -1134,11 +1163,11 @@ _pygi_marshal_in_interface_callback (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_interface_enum (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_enum (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *int_; gint is_instance; @@ -1186,11 +1215,11 @@ err: } gboolean -_pygi_marshal_in_interface_flags (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_flags (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyObject *int_; gint is_instance; @@ -1221,11 +1250,11 @@ err: } gboolean -_pygi_marshal_in_interface_struct (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_struct (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; @@ -1320,11 +1349,11 @@ _pygi_marshal_in_interface_struct (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_interface_boxed (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_boxed (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyErr_Format (PyExc_NotImplementedError, "Marshalling for this type is not implemented yet"); @@ -1332,11 +1361,11 @@ _pygi_marshal_in_interface_boxed (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_interface_object (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_object (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { if (py_arg == Py_None) { arg->v_pointer = NULL; @@ -1358,34 +1387,40 @@ _pygi_marshal_in_interface_object (PyGIInvokeState *state, } gboolean -_pygi_marshal_in_interface_union (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +_pygi_marshal_from_py_interface_union (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { PyErr_Format(PyExc_NotImplementedError, "Marshalling for this type is not implemented yet"); return FALSE; } -gboolean _pygi_marshal_in_interface_instance (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg) +gboolean _pygi_marshal_from_py_interface_instance (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg) { GIInfoType info_type; PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; - /* FIXME: add instance checks */ - info_type = g_base_info_get_type (iface_cache->interface_info); switch (info_type) { case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_STRUCT: { GType type = iface_cache->g_type; + + if (!PyObject_IsInstance (py_arg, iface_cache->py_type)) { + PyErr_Format (PyExc_TypeError, "Expected a %s, but got %s", + iface_cache->type_name, + py_arg->ob_type->tp_name); + return FALSE; + } + if (g_type_is_a (type, G_TYPE_BOXED)) { arg->v_pointer = pyg_boxed_get (py_arg, void); } else if (g_type_is_a (type, G_TYPE_POINTER) || @@ -1402,6 +1437,17 @@ gboolean _pygi_marshal_in_interface_instance (PyGIInvokeState *state, case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: arg->v_pointer = pygobject_get (py_arg); + if (arg->v_pointer != NULL) { + GType obj_type = G_OBJECT_TYPE (( GObject *)arg->v_pointer); + GType expected_type = iface_cache->g_type; + + if (!g_type_is_a (obj_type, expected_type)) { + PyErr_Format (PyExc_TypeError, "Expected a %s, but got %s", + iface_cache->type_name, + py_arg->ob_type->tp_name); + return FALSE; + } + } break; default: /* Other types don't have methods. */ diff --git a/gi/pygi-marshal-from-py.h b/gi/pygi-marshal-from-py.h new file mode 100644 index 0000000..34511db --- /dev/null +++ b/gi/pygi-marshal-from-py.h @@ -0,0 +1,186 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_MARSHAL_from_py_PY_H__ +#define __PYGI_MARSHAL_from_py_PY_H__ + +#include + +#include + +#include "pygi-private.h" + +G_BEGIN_DECLS + +gboolean _pygi_marshal_from_py_void (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_boolean (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_int8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_uint8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_int16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_uint16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_int32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_uint32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_int64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_uint64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_float (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_double (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_unichar (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_gtype (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_utf8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_filename (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_array (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_glist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_gslist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_ghash (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_gerror (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_enum (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_flags (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_struct (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_interface(PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_boxed (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_object (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_union (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); +gboolean _pygi_marshal_from_py_interface_instance (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + PyObject *py_arg, + GIArgument *arg); + +G_END_DECLS + +#endif /* __PYGI_MARSHAL_from_py_PY__ */ diff --git a/gi/pygi-marshal-in.h b/gi/pygi-marshal-in.h deleted file mode 100644 index 7d948bc..0000000 --- a/gi/pygi-marshal-in.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- - * vim: tabstop=4 shiftwidth=4 expandtab - * - * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - */ - -#ifndef __PYGI_MARSHAL_H__ -#define __PYGI_MARSHAL_H__ - -#include - -#include - -#include "pygi-private.h" - -G_BEGIN_DECLS - -gboolean _pygi_marshal_in_void (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_boolean (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_int8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_uint8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_int16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_uint16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_int32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_uint32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_int64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_uint64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_float (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_double (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_unichar (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_gtype (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_utf8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_filename (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_array (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_glist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_gslist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_ghash (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_gerror (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_callback (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_enum (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_flags (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_struct (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_interface(PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_boxed (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_object (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_union (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); -gboolean _pygi_marshal_in_interface_instance (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - PyObject *py_arg, - GIArgument *arg); - -G_END_DECLS - -#endif /* __PYGI_MARSHAL_H__ */ diff --git a/gi/pygi-marshal-out.h b/gi/pygi-marshal-out.h deleted file mode 100644 index db6bcfe..0000000 --- a/gi/pygi-marshal-out.h +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- - * vim: tabstop=4 shiftwidth=4 expandtab - * - * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - */ - -#ifndef __PYGI_MARSHAL_OUT_H__ -#define __PYGI_MARSHAL_OUT_H__ - -PyObject *_pygi_marshal_out_void (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_boolean (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_int8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_uint8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_int16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_uint16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_int32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_uint32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_int64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_uint64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_float (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_double (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_unichar (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_gtype (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_utf8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_filename (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_array (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_glist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_gslist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_ghash (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_gerror (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_callback(PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_enum (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_flags (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_struct (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_interface(PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_boxed (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_object (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); -PyObject *_pygi_marshal_out_interface_union (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg); - -G_END_DECLS - -#endif /* __PYGI_MARSHAL_OUT_H__ */ diff --git a/gi/pygi-marshal-out.c b/gi/pygi-marshal-to-py.c similarity index 72% rename from gi/pygi-marshal-out.c rename to gi/pygi-marshal-to-py.c index e72db80..cb62c49 100644 --- a/gi/pygi-marshal-out.c +++ b/gi/pygi-marshal-to-py.c @@ -3,7 +3,7 @@ * * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. * - * pygi-marshal-out.c: PyObject conversion functions for out parameters. + * pygi-marshal-from-py.c: functions for converting C types to PyObject * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,13 +32,13 @@ #include "pygi-cache.h" #include "pygi-marshal-cleanup.h" -#include "pygi-marshal-out.h" +#include "pygi-marshal-to-py.h" PyObject * -_pygi_marshal_out_void (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_void (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; if (arg_cache->is_pointer) @@ -51,30 +51,30 @@ _pygi_marshal_out_void (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_boolean (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_boolean (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyBool_FromLong (arg->v_boolean); return py_obj; } PyObject * -_pygi_marshal_out_int8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_int8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PYGLIB_PyLong_FromLong (arg->v_int8); return py_obj; } PyObject * -_pygi_marshal_out_uint8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_uint8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PYGLIB_PyLong_FromLong (arg->v_uint8); @@ -82,10 +82,10 @@ _pygi_marshal_out_uint8 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_int16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_int16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PYGLIB_PyLong_FromLong (arg->v_int16); @@ -93,10 +93,10 @@ _pygi_marshal_out_int16 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_uint16 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_uint16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PYGLIB_PyLong_FromLong (arg->v_uint16); @@ -104,10 +104,10 @@ _pygi_marshal_out_uint16 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_int32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_int32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PYGLIB_PyLong_FromLong (arg->v_int32); @@ -115,10 +115,10 @@ _pygi_marshal_out_int32 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_uint32 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_uint32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyLong_FromLongLong (arg->v_uint32); @@ -126,10 +126,10 @@ _pygi_marshal_out_uint32 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_int64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_int64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyLong_FromLongLong (arg->v_int64); @@ -137,10 +137,10 @@ _pygi_marshal_out_int64 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_uint64 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_uint64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyLong_FromUnsignedLongLong (arg->v_uint64); @@ -148,10 +148,10 @@ _pygi_marshal_out_uint64 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_float (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_float (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyFloat_FromDouble (arg->v_float); @@ -159,10 +159,10 @@ _pygi_marshal_out_float (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_double (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_double (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = PyFloat_FromDouble (arg->v_double); @@ -170,10 +170,10 @@ _pygi_marshal_out_double (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_unichar (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_unichar (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; @@ -197,10 +197,10 @@ _pygi_marshal_out_unichar (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_gtype (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_gtype (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; @@ -209,10 +209,10 @@ _pygi_marshal_out_gtype (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_utf8 (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_utf8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; if (arg->v_string == NULL) { @@ -226,10 +226,10 @@ _pygi_marshal_out_utf8 (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_filename (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_filename (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { gchar *string; PyObject *py_obj = NULL; @@ -255,10 +255,10 @@ _pygi_marshal_out_filename (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_array (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_array (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { GArray *array_; PyObject *py_obj = NULL; @@ -311,7 +311,7 @@ _pygi_marshal_out_array (PyGIInvokeState *state, int i; gsize item_size; - PyGIMarshalOutFunc item_out_marshaller; + PyGIMarshalToPyFunc item_to_py_marshaller; PyGIArgCache *item_arg_cache; py_obj = PyList_New (array_->len); @@ -320,7 +320,7 @@ _pygi_marshal_out_array (PyGIInvokeState *state, item_arg_cache = seq_cache->item_cache; - item_out_marshaller = item_arg_cache->out_marshaller; + item_to_py_marshaller = item_arg_cache->to_py_marshaller; item_size = g_array_get_element_size (array_); @@ -351,7 +351,7 @@ _pygi_marshal_out_array (PyGIInvokeState *state, memcpy (&item_arg, array_->data + i * item_size, item_size); } - py_item = item_out_marshaller ( state, + py_item = item_to_py_marshaller ( state, callable_cache, item_arg_cache, &item_arg); @@ -380,9 +380,9 @@ err: g_array_free (array_, arg_cache->transfer == GI_TRANSFER_EVERYTHING); } else { /* clean up unprocessed items */ - if (seq_cache->item_cache->out_cleanup != NULL) { + if (seq_cache->item_cache->to_py_cleanup != NULL) { int j; - PyGIMarshalCleanupFunc cleanup_func = seq_cache->item_cache->out_cleanup; + PyGIMarshalCleanupFunc cleanup_func = seq_cache->item_cache->to_py_cleanup; for (j = processed_items; j < array_->len; j++) { cleanup_func (state, seq_cache->item_cache, @@ -399,16 +399,16 @@ err: } PyObject * -_pygi_marshal_out_glist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_glist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { GList *list_; gsize length; gsize i; - PyGIMarshalOutFunc item_out_marshaller; + PyGIMarshalToPyFunc item_to_py_marshaller; PyGIArgCache *item_arg_cache; PyGISequenceCache *seq_cache = (PyGISequenceCache *)arg_cache; @@ -422,14 +422,14 @@ _pygi_marshal_out_glist (PyGIInvokeState *state, return NULL; item_arg_cache = seq_cache->item_cache; - item_out_marshaller = item_arg_cache->out_marshaller; + item_to_py_marshaller = item_arg_cache->to_py_marshaller; for (i = 0; list_ != NULL; list_ = g_list_next (list_), i++) { GIArgument item_arg; PyObject *py_item; item_arg.v_pointer = list_->data; - py_item = item_out_marshaller ( state, + py_item = item_to_py_marshaller ( state, callable_cache, item_arg_cache, &item_arg); @@ -447,16 +447,16 @@ _pygi_marshal_out_glist (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_gslist (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_gslist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { GSList *list_; gsize length; gsize i; - PyGIMarshalOutFunc item_out_marshaller; + PyGIMarshalToPyFunc item_to_py_marshaller; PyGIArgCache *item_arg_cache; PyGISequenceCache *seq_cache = (PyGISequenceCache *)arg_cache; @@ -470,14 +470,14 @@ _pygi_marshal_out_gslist (PyGIInvokeState *state, return NULL; item_arg_cache = seq_cache->item_cache; - item_out_marshaller = item_arg_cache->out_marshaller; + item_to_py_marshaller = item_arg_cache->to_py_marshaller; for (i = 0; list_ != NULL; list_ = g_slist_next (list_), i++) { GIArgument item_arg; PyObject *py_item; item_arg.v_pointer = list_->data; - py_item = item_out_marshaller ( state, + py_item = item_to_py_marshaller ( state, callable_cache, item_arg_cache, &item_arg); @@ -495,16 +495,16 @@ _pygi_marshal_out_gslist (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_ghash (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_ghash (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { GHashTable *hash_; GHashTableIter hash_table_iter; - PyGIMarshalOutFunc key_out_marshaller; - PyGIMarshalOutFunc value_out_marshaller; + PyGIMarshalToPyFunc key_to_py_marshaller; + PyGIMarshalToPyFunc value_to_py_marshaller; PyGIArgCache *key_arg_cache; PyGIArgCache *value_arg_cache; @@ -528,10 +528,10 @@ _pygi_marshal_out_ghash (PyGIInvokeState *state, return NULL; key_arg_cache = hash_cache->key_cache; - key_out_marshaller = key_arg_cache->out_marshaller; + key_to_py_marshaller = key_arg_cache->to_py_marshaller; value_arg_cache = hash_cache->value_cache; - value_out_marshaller = value_arg_cache->out_marshaller; + value_to_py_marshaller = value_arg_cache->to_py_marshaller; g_hash_table_iter_init (&hash_table_iter, hash_); while (g_hash_table_iter_next (&hash_table_iter, @@ -541,7 +541,7 @@ _pygi_marshal_out_ghash (PyGIInvokeState *state, PyObject *py_value; int retval; - py_key = key_out_marshaller ( state, + py_key = key_to_py_marshaller ( state, callable_cache, key_arg_cache, &key_arg); @@ -551,7 +551,7 @@ _pygi_marshal_out_ghash (PyGIInvokeState *state, return NULL; } - py_value = value_out_marshaller ( state, + py_value = value_to_py_marshaller ( state, callable_cache, value_arg_cache, &value_arg); @@ -577,36 +577,36 @@ _pygi_marshal_out_ghash (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_gerror (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_gerror (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; PyErr_Format (PyExc_NotImplementedError, - "Marshalling for gerror out is not implemented"); + "Marshalling for gerror to PyObject is not implemented"); return py_obj; } PyObject * -_pygi_marshal_out_interface_callback (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_callback (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; PyErr_Format (PyExc_NotImplementedError, - "Callback out values are not supported"); + "Marshalling a callback to PyObject is not supported"); return py_obj; } PyObject * -_pygi_marshal_out_interface_enum (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_enum (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; @@ -620,10 +620,10 @@ _pygi_marshal_out_interface_enum (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_flags (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_flags (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; @@ -656,10 +656,10 @@ _pygi_marshal_out_interface_flags (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_struct (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_struct (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; @@ -686,12 +686,12 @@ _pygi_marshal_out_interface_struct (PyGIInvokeState *state, py_obj = pyg_pointer_new (type, arg->v_pointer); } else { py_obj = _pygi_struct_new ( (PyTypeObject *)iface_cache->py_type, arg->v_pointer, - arg_cache->transfer == GI_TRANSFER_EVERYTHING); + arg_cache->transfer == GI_TRANSFER_EVERYTHING); } } else if (g_type_is_a (type, G_TYPE_VARIANT)) { g_variant_ref_sink (arg->v_pointer); py_obj = _pygi_struct_new ( (PyTypeObject *)iface_cache->py_type, arg->v_pointer, - FALSE); + FALSE); } else if (type == G_TYPE_NONE && iface_cache->is_foreign) { py_obj = pygi_struct_foreign_convert_from_g_argument (iface_cache->interface_info, arg->v_pointer); } else if (type == G_TYPE_NONE) { @@ -707,10 +707,10 @@ _pygi_marshal_out_interface_struct (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_interface (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_interface (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; @@ -720,10 +720,10 @@ _pygi_marshal_out_interface_interface (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_boxed (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_boxed (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; @@ -733,10 +733,10 @@ _pygi_marshal_out_interface_boxed (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_object (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_object (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj; @@ -755,10 +755,10 @@ _pygi_marshal_out_interface_object (PyGIInvokeState *state, } PyObject * -_pygi_marshal_out_interface_union (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) +_pygi_marshal_to_py_interface_union (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg) { PyObject *py_obj = NULL; diff --git a/gi/pygi-marshal-to-py.h b/gi/pygi-marshal-to-py.h new file mode 100644 index 0000000..a07a13e --- /dev/null +++ b/gi/pygi-marshal-to-py.h @@ -0,0 +1,144 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * vim: tabstop=4 shiftwidth=4 expandtab + * + * Copyright (C) 2011 John (J5) Palmieri , Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#ifndef __PYGI_MARSHAL_TO_PY_H__ +#define __PYGI_MARSHAL_TO_PY_H__ + +PyObject *_pygi_marshal_to_py_void (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_boolean (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_int8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_uint8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_int16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_uint16 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_int32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_uint32 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_int64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_uint64 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_float (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_double (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_unichar (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_gtype (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_utf8 (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_filename (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_array (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_glist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_gslist (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_ghash (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_gerror (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_callback(PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_enum (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_flags (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_struct (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_interface(PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_boxed (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_object (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); +PyObject *_pygi_marshal_to_py_interface_union (PyGIInvokeState *state, + PyGICallableCache *callable_cache, + PyGIArgCache *arg_cache, + GIArgument *arg); + +G_END_DECLS + +#endif /* __PYGI_MARSHAL_TO_PY_H__ */ diff --git a/gi/repository/Makefile.am b/gi/repository/Makefile.am index ece9c4f..9326dc3 100644 --- a/gi/repository/Makefile.am +++ b/gi/repository/Makefile.am @@ -1,8 +1,5 @@ -PLATFORM_VERSION = 2.0 +pygirepositorydir = $(pyexecdir)/gi/repository -pkgpyexecdir = $(pyexecdir)/gi - -pygirepositorydir = $(pkgpyexecdir)/repository pygirepository_PYTHON = \ __init__.py diff --git a/gi/repository/Makefile.in b/gi/repository/Makefile.in index 308b74a..c8fd08d 100644 --- a/gi/repository/Makefile.in +++ b/gi/repository/Makefile.in @@ -168,6 +168,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -178,7 +180,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -220,7 +221,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ -pkgpyexecdir = $(pyexecdir)/gi +pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -235,8 +236,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -PLATFORM_VERSION = 2.0 -pygirepositorydir = $(pkgpyexecdir)/repository +pygirepositorydir = $(pyexecdir)/gi/repository pygirepository_PYTHON = \ __init__.py diff --git a/m4/python.m4 b/m4/python.m4 index 523e45a..7c90275 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -43,16 +43,18 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], [AC_REQUIRE([AM_PATH_PYTHON]) AC_MSG_CHECKING(for headers required to compile python extensions) dnl deduce PYTHON_INCLUDES -py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` -py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` -PYTHON_CONFIG=`which $PYTHON`-config -if test -x "$PYTHON_CONFIG"; then -PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` -else -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" -if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" -fi +if test "x$PYTHON_INCLUDES" == x; then + PYTHON_CONFIG=`which $PYTHON`-config + if test -x "$PYTHON_CONFIG"; then + PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` + else + py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` + py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + fi fi AC_SUBST(PYTHON_INCLUDES) dnl check if the headers exist: @@ -66,6 +68,31 @@ $2]) CPPFLAGS="$save_CPPFLAGS" ]) +dnl a macro to check for ability to embed python +dnl AM_CHECK_PYTHON_LIBS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_LIBS +AC_DEFUN([AM_CHECK_PYTHON_LIBS], +[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) +AC_MSG_CHECKING(for libraries required to embed python) +dnl deduce PYTHON_LIBS +py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` +if test "x$PYTHON_LIBS" == x; then + PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" +fi +if test "x$PYTHON_LIB_LOC" == x; then + PYTHON_LIB_LOC="${py_prefix}/lib" +fi +AC_SUBST(PYTHON_LIBS) +AC_SUBST(PYTHON_LIB_LOC) +dnl check if the headers exist: +save_LIBS="$LIBS" +LIBS="$LIBS $PYTHON_LIBS" +AC_TRY_LINK_FUNC(Py_Initialize, dnl + [LIBS="$save_LIBS"; AC_MSG_RESULT(yes); $1], dnl + [LIBS="$save_LIBS"; AC_MSG_RESULT(no); $2]) + +]) + # JD_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. diff --git a/pygobject-3.0-uninstalled.pc.in b/pygobject-3.0-uninstalled.pc.in index 5d96925..6b07aa6 100644 --- a/pygobject-3.0-uninstalled.pc.in +++ b/pygobject-3.0-uninstalled.pc.in @@ -1,18 +1,12 @@ +# you can use the --variable=pygobjectincludedir argument to +# pkg-config to get this value. You might want to use this to +# install additional headers. +pygobjectincludedir=${pc_top_builddir}/${pcfiledir}/gi/_gobject +overridesdir=${pc_top_builddir}/${pcfiledir}/gi/overrides + Name: PyGObject Description: Python bindings for GObject Requires: gobject-2.0 Requires.private: @LIBFFI_PC@ Version: @VERSION@ -Cflags: -I${pc_top_builddir}/${pcfiledir}/gobject - -# you can use the --variable=pygobjectincludedir argument to -# pkg-config to get this value. You might want to use this to -# install additional headers. -pygobjectincludedir=${pc_top_builddir}/${pcfiledir}/gobject -xslfiles=${pc_top_builddir}/${pcfiledir}/docs/xsl - -# same here. Useful when calling the code generator in addon packages. -defsdir=${pc_top_builddir}/${pcfiledir}/gio -fixxref=${pc_top_builddir}/${pcfiledir}/docs/xsl/fixxref.py -pygdocs=${pc_top_builddir}/${pcfiledir}/docs -datadir=${pc_top_builddir}/pygobject-@VERSION@ +Cflags: -I${pc_top_builddir}/${pcfiledir}/gi/_gobject diff --git a/pygobject-3.0.pc.in b/pygobject-3.0.pc.in index 15672de..3c7af01 100644 --- a/pygobject-3.0.pc.in +++ b/pygobject-3.0.pc.in @@ -6,13 +6,9 @@ datadir=@datadir@ libdir=@libdir@ # you can use the --variable=pygobjectincludedir argument to -# pkg-config to get this value. You might want to use this to +# pkg-config to get this value. You might want to use this to # install additional headers. pygobjectincludedir=${includedir}/pygobject-3.0 -fixxref=${datadir}/pygobject/xsl/fixxref.py -pygdocs=${datadir}/gtk-doc/html/pygobject -defsdir=${datadir}/pygobject/2.0/defs -overridesdir=@pyexecdir@/gi/overrides Name: PyGObject Description: Python bindings for GObject @@ -20,3 +16,12 @@ Requires: gobject-2.0 Requires.private: @LIBFFI_PC@ Version: @VERSION@ Cflags: -I${pygobjectincludedir} + +# overridesdir has now moved to the gi module +# third parties can access it in a python script: +# +# import gi +# installdir = gi._overridesdir +# +# the version of python you run the script from +# will determine the actual overrides path diff --git a/pygobject_postinstall.py b/pygobject_postinstall.py deleted file mode 100644 index bd546bf..0000000 --- a/pygobject_postinstall.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - - -import sys - - -if len(sys.argv) == 2: - if sys.argv[1] == '-install': - print ('pygobject is now installed on your machine.\n') diff --git a/setup.py b/setup.py deleted file mode 100755 index 74b9141..0000000 --- a/setup.py +++ /dev/null @@ -1,351 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# setup.py - distutils configuration for pygobject - - -'''Python Bindings for GObject. - -PyGObject is a set of bindings for the glib, gobject and gio libraries. -It provides an object oriented interface that is slightly higher level than -the C one. It automatically does all the type casting and reference -counting that you would have to do normally with the C API. You can -find out more on the official homepage, http://www.pygtk.org/''' - - -import os -import sys -import glob - -from distutils.command.build import build -from distutils.command.build_clib import build_clib -from distutils.command.build_scripts import build_scripts -from distutils.sysconfig import get_python_inc -from distutils.extension import Extension -from distutils.core import setup - -from dsextras import GLOBAL_MACROS, GLOBAL_INC, get_m4_define, getoutput, \ - have_pkgconfig, pkgc_get_libraries, \ - pkgc_get_library_dirs, pkgc_get_include_dirs, \ - PkgConfigExtension, TemplateExtension, \ - BuildExt, InstallLib, InstallData - - -if sys.platform != 'win32': - msg = '*' * 68 + '\n' - msg += '* Building PyGObject using distutils is only supported on windows. *\n' - msg += '* To build PyGObject in a supported way, read the INSTALL file. *\n' - msg += '*' * 68 - raise SystemExit(msg) - -MIN_PYTHON_VERSION = (2, 6, 0) - -if sys.version_info[:3] < MIN_PYTHON_VERSION: - raise SystemExit('ERROR: Python %s or higher is required, %s found.' % ( - '.'.join(map(str, MIN_PYTHON_VERSION)), - '.'.join(map(str, sys.version_info[:3])))) - -if not have_pkgconfig(): - raise SystemExit('ERROR: Could not find pkg-config: ' - 'Please check your PATH environment variable.') - - -PYGTK_SUFFIX = '2.0' -PYGTK_SUFFIX_LONG = 'gtk-' + PYGTK_SUFFIX - -GLIB_REQUIRED = get_m4_define('glib_required_version') - -MAJOR_VERSION = int(get_m4_define('pygobject_major_version')) -MINOR_VERSION = int(get_m4_define('pygobject_minor_version')) -MICRO_VERSION = int(get_m4_define('pygobject_micro_version')) -VERSION = '%d.%d.%d' % (MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION) - -GLOBAL_INC += ['gobject'] -GLOBAL_MACROS += [('PYGOBJECT_MAJOR_VERSION', MAJOR_VERSION), - ('PYGOBJECT_MINOR_VERSION', MINOR_VERSION), - ('PYGOBJECT_MICRO_VERSION', MICRO_VERSION), - ('VERSION', '\\"%s\\"' % VERSION)] - -BIN_DIR = os.path.join('Scripts') -INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGTK_SUFFIX) -DEFS_DIR = os.path.join('share', 'pygobject', PYGTK_SUFFIX, 'defs') -XSL_DIR = os.path.join('share', 'pygobject','xsl') -HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygobject') - - -class PyGObjectInstallLib(InstallLib): - def run(self): - # Install pygtk.pth, pygtk.py[c] and templates - self.install_pth() - self.install_pygtk() - - # Modify the base installation dir - install_dir = os.path.join(self.install_dir, PYGTK_SUFFIX_LONG) - self.set_install_dir(install_dir) - - # Install tests - self.install_tests() - - InstallLib.run(self) - - def install_pth(self): - '''Create the pygtk.pth file''' - file = os.path.join(self.install_dir, 'pygtk.pth') - self.mkpath(self.install_dir) - open(file, 'w').write(PYGTK_SUFFIX_LONG) - self.local_outputs.append(file) - self.local_inputs.append('pygtk.pth') - - def install_pygtk(self): - '''Install pygtk.py in the right place.''' - self.copy_file('pygtk.py', self.install_dir) - pygtk = os.path.join(self.install_dir, 'pygtk.py') - self.byte_compile([pygtk]) - self.local_outputs.append(pygtk) - self.local_inputs.append('pygtk.py') - - def copy_test(self, srcfile, dstfile=None): - if dstfile is None: - dstfile = os.path.join(self.test_dir, srcfile) - else: - dstfile = os.path.join(self.test_dir, dstfile) - - srcfile = os.path.join('tests', srcfile) - - self.copy_file(srcfile, os.path.abspath(dstfile)) - self.local_outputs.append(dstfile) - self.local_inputs.append('srcfile') - - def install_tests(self): - self.test_dir = os.path.join(self.install_dir, 'tests', 'pygobject') - self.mkpath(self.test_dir) - - self.copy_test('runtests-windows.py', 'runtests.py') - self.copy_test('compathelper.py') - - for testfile in glob.glob('tests/test*.py'): - self.copy_test(os.path.basename(testfile)) - - -class PyGObjectInstallData(InstallData): - def run(self): - self.add_template_option('VERSION', VERSION) - self.add_template_option('FFI_LIBS', '') - self.add_template_option('LIBFFI_PC', '') - self.prepare() - - # Install templates - self.install_templates() - - InstallData.run(self) - - def install_templates(self): - self.install_template('pygobject-%s.pc.in' % PYGTK_SUFFIX, - os.path.join(self.install_dir, 'lib', 'pkgconfig')) - - self.install_template('docs/xsl/fixxref.py.in', - os.path.join(self.install_dir, XSL_DIR)) - - -class PyGObjectBuild(build): - enable_threading = True - -PyGObjectBuild.user_options.append(('enable-threading', None, - 'enable threading support')) - - -class PyGObjectBuildScripts(build_scripts): - ''' - Overrides distutils' build_script command so we can generate - a valid pygobject-codegen script that works on windows. - ''' - - def run(self): - self.mkpath(self.build_dir) - self.install_codegen_script() - build_scripts.run(self) - - def install_codegen_script(self): - '''Create pygobject-codegen''' - script = ('#!/bin/sh\n\n' - 'codegendir=`pkg-config pygobject-%s --variable=codegendir`\n\n' - 'PYTHONPATH=$codegendir\n' - 'export PYTHONPATH\n\n' - 'exec pythonw.exe "$codegendir/codegen.py" "$@"\n' % PYGTK_SUFFIX) - - outfile = os.path.join(self.build_dir, 'pygobject-codegen-%s' % PYGTK_SUFFIX) - open(outfile, 'w').write(script) - - -# glib -glib = PkgConfigExtension(name='glib._glib', - pkc_name='glib-%s' % PYGTK_SUFFIX, - pkc_version=GLIB_REQUIRED, - pygobject_pkc=None, - include_dirs=['glib'], - libraries=['pyglib'], - sources=['glib/glibmodule.c', - 'glib/pygiochannel.c', - 'glib/pygmaincontext.c', - 'glib/pygmainloop.c', - 'glib/pygoptioncontext.c', - 'glib/pygoptiongroup.c', - 'glib/pygsource.c', - 'glib/pygspawn.c', - ]) - -# GObject -gobject = PkgConfigExtension(name='gobject._gobject', - pkc_name='gobject-%s' % PYGTK_SUFFIX, - pkc_version=GLIB_REQUIRED, - pygobject_pkc=None, - include_dirs=['glib','gi'], - libraries=['pyglib'], - sources=['gobject/gobjectmodule.c', - 'gobject/pygboxed.c', - 'gobject/pygenum.c', - 'gobject/pygflags.c', - 'gobject/pyginterface.c', - 'gobject/pygobject.c', - 'gobject/pygparamspec.c', - 'gobject/pygpointer.c', - 'gobject/pygtype.c', - ]) - -# gio -gio = TemplateExtension(name='gio', - pkc_name='gio-%s' % PYGTK_SUFFIX, - pkc_version=GLIB_REQUIRED, - output='gio._gio', - defs='gio/gio.defs', - include_dirs=['glib'], - libraries=['pyglib'], - sources=['gio/giomodule.c', - 'gio/gio.c', - 'gio/pygio-utils.c'], - register=['gio/gio-types.defs'], - override='gio/gio.override') - -clibs = [] -data_files = [] -ext_modules = [] - -#Install dsextras and codegen so that the pygtk installer can find them -py_modules = ['dsextras'] -packages = ['codegen'] - -if glib.can_build(): - #It would have been nice to create another class, such as PkgConfigCLib to - #encapsulate this dictionary, but it is impossible. build_clib.py does - #a dumb check to see if its only arguments are a 2-tuple containing a - #string and a Dictionary type - which makes it impossible to hide behind a - #subclass - # - #So we are stuck with this ugly thing - clibs.append(('pyglib', {'sources': ['glib/pyglib.c'], - 'macros': GLOBAL_MACROS, - 'include_dirs': ['glib', get_python_inc()] + - pkgc_get_include_dirs('glib-%s' % PYGTK_SUFFIX)})) - #this library is not installed, so probably should not include its header - #data_files.append((INCLUDE_DIR, ('glib/pyglib.h',))) - - ext_modules.append(glib) - py_modules += ['glib.__init__', 'glib.option'] -else: - raise SystemExit('ERROR: Nothing to do, glib could not be found and is essential.') - -if gobject.can_build(): - ext_modules.append(gobject) - data_files.append((INCLUDE_DIR, ('gobject/pygobject.h',))) - data_files.append((HTML_DIR, glob.glob('docs/html/*.html'))) - data_files.append((HTML_DIR, ['docs/style.css'])) - data_files.append((XSL_DIR, glob.glob('docs/xsl/*.xsl'))) - py_modules += ['gobject.__init__', 'gobject.propertyhelper', 'gobject.constants'] -else: - raise SystemExit('ERROR: Nothing to do, gobject could not be found and is essential.') - -if gio.can_build(): - ext_modules.append(gio) - py_modules += ['gio.__init__'] - data_files.append((DEFS_DIR,('gio/gio.defs', 'gio/gio-types.defs',))) -else: - raise SystemExit, 'ERROR: Nothing to do, gio could not be found and is essential.' - -# Build testhelper library -testhelper = Extension(name='testhelper', - sources=['tests/testhelpermodule.c', - 'tests/test-floating.c', - 'tests/test-thread.c', - 'tests/test-unknown.c'], - libraries=['pyglib'] + - pkgc_get_libraries('glib-%s' % PYGTK_SUFFIX) + - pkgc_get_libraries('gobject-%s' % PYGTK_SUFFIX), - include_dirs=['tests', 'glib', - 'gobject', get_python_inc()] + - pkgc_get_include_dirs('glib-%s' % PYGTK_SUFFIX) + - pkgc_get_include_dirs('gobject-%s' % PYGTK_SUFFIX), - library_dirs=pkgc_get_library_dirs('glib%s' % PYGTK_SUFFIX) + - pkgc_get_library_dirs('gobject-%s' % PYGTK_SUFFIX)) - -ext_modules.append(testhelper) - -# Threading support -if '--disable-threading' in sys.argv: - sys.argv.remove('--disable-threading') - enable_threading = False -else: - if '--enable-threading' in sys.argv: - sys.argv.remove('--enable-threading') - try: - import thread - except ImportError: - print ('* Could not import thread module, disabling threading') - enable_threading = False - else: - enable_threading = True - -if enable_threading: - name = 'gthread-%s' % PYGTK_SUFFIX - for module in ext_modules: - raw = getoutput('pkg-config --libs-only-l %s' % name) - for arg in raw.split(): - if arg.startswith('-l'): - module.libraries.append(arg[2:]) - else: - module.extra_link_args.append(arg) - raw = getoutput('pkg-config --cflags-only-I %s' % name) - for arg in raw.split(): - if arg.startswith('-I'): - module.include_dirs.append(arg[2:]) - else: - module.extra_compile_args.append(arg) -else: - GLOBAL_MACROS.append(('DISABLE_THREADING', 1)) - -doclines = __doc__.split('\n') -options = {'bdist_wininst': {'install_script': 'pygobject_postinstall.py', - 'user_access_control': 'auto'}} - -setup(name='pygobject', - url='http://www.pygtk.org/', - version=VERSION, - license='LGPL', - platforms=['MS Windows'], - maintainer='Johan Dahlin', - maintainer_email='johan@gnome.org', - description=doclines[0], - long_description='\n'.join(doclines[2:]), - provides=['codegen', 'dsextras', 'gio', 'glib', 'gobject'], - py_modules=py_modules, - packages=packages, - ext_modules=ext_modules, - libraries=clibs, - data_files=data_files, - scripts=['pygobject_postinstall.py'], - options=options, - cmdclass={'install_lib': PyGObjectInstallLib, - 'install_data': PyGObjectInstallData, - 'build_scripts': PyGObjectBuildScripts, - 'build_clib' : build_clib, - 'build_ext': BuildExt, - 'build': PyGObjectBuild}) diff --git a/tests/Makefile.in b/tests/Makefile.in index 710030a..491490b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -196,6 +196,8 @@ PYTHON = @PYTHON@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -206,7 +208,6 @@ SHELL = @SHELL@ STRIP = @STRIP@ THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ -XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/tests/test_gi.py b/tests/test_gi.py index c84ca23..dd91cb8 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -703,6 +703,35 @@ class TestArray(unittest.TestCase): object_ = GIMarshallingTests.Object() self.assertEquals([-1, 0, 1, 2], object_.method_array_return()) + def test_array_enum_in(self): + GIMarshallingTests.array_enum_in([GIMarshallingTests.Enum.VALUE1, + GIMarshallingTests.Enum.VALUE2, + GIMarshallingTests.Enum.VALUE3]) + + def test_array_boxed_struct_in(self): + struct1 = GIMarshallingTests.BoxedStruct() + struct1.long_ = 1 + struct2 = GIMarshallingTests.BoxedStruct() + struct2.long_ = 2 + struct3 = GIMarshallingTests.BoxedStruct() + struct3.long_ = 3 + + GIMarshallingTests.array_struct_in([struct1, struct2, struct3]) + + def test_array_simple_struct_in(self): + struct1 = GIMarshallingTests.SimpleStruct() + struct1.long_ = 1 + struct2 = GIMarshallingTests.SimpleStruct() + struct2.long_ = 2 + struct3 = GIMarshallingTests.SimpleStruct() + struct3.long_ = 3 + + GIMarshallingTests.array_simple_struct_in([struct1, struct2, struct3]) + + def test_array_multi_array_key_value_in(self): + GIMarshallingTests.multi_array_key_value_in(["one", "two", "three"], + [1, 2, 3]) + def test_array_fixed_out_struct(self): struct1, struct2 = GIMarshallingTests.array_fixed_out_struct() diff --git a/tests/test_overrides.py b/tests/test_overrides.py index 2f25121..8974273 100644 --- a/tests/test_overrides.py +++ b/tests/test_overrides.py @@ -1546,7 +1546,7 @@ class TestGtk(unittest.TestCase): widget.drag_dest_get_track_motion() widget.drag_dest_set_track_motion(True) widget.drag_dest_get_target_list() - widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()])) + widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry.new('test',0, 0)])) widget.drag_dest_unset() widget.drag_highlight() @@ -1561,7 +1561,7 @@ class TestGtk(unittest.TestCase): widget.drag_source_set_icon_pixbuf(GdkPixbuf.Pixbuf()) widget.drag_source_set_icon_stock("") widget.drag_source_get_target_list() - widget.drag_source_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()])) + widget.drag_source_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry.new('test', 0, 0)])) widget.drag_source_unset() # these methods cannot be called because they require a valid drag on