diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:37:17 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:37:18 +0900 |
commit | 0c71eb0d62ed72700f38b67e4d75e0b62be8749e (patch) | |
tree | 0c742035fdf0898240583cec23be0b045aa4e77f /gi | |
parent | e5d66a3d89168db811dff9a9436f91fe44d74f0f (diff) | |
download | pygobject2-0c71eb0d62ed72700f38b67e4d75e0b62be8749e.tar.gz pygobject2-0c71eb0d62ed72700f38b67e4d75e0b62be8749e.tar.bz2 pygobject2-0c71eb0d62ed72700f38b67e4d75e0b62be8749e.zip |
Imported Upstream version 2.90.2
Change-Id: Ic589bde4a220ca70927f90d377aaa2da70b920fd
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi')
-rw-r--r-- | gi/_gobject/Makefile.am | 5 | ||||
-rw-r--r-- | gi/_gobject/Makefile.in | 56 | ||||
-rw-r--r-- | gi/overrides/GLib.py | 50 | ||||
-rw-r--r-- | gi/pygi-info.c | 8 |
4 files changed, 97 insertions, 22 deletions
diff --git a/gi/_gobject/Makefile.am b/gi/_gobject/Makefile.am index 7e15d4c..a31085f 100644 --- a/gi/_gobject/Makefile.am +++ b/gi/_gobject/Makefile.am @@ -1,5 +1,8 @@ AUTOMAKE_OPTIONS = 1.7 -PLATFORM_VERSION = 2.0 +PLATFORM_VERSION = 3.0 + +pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION) +pkginclude_HEADERS = pygobject.h pkgpyexecdir = $(pyexecdir) diff --git a/gi/_gobject/Makefile.in b/gi/_gobject/Makefile.in index 5412d0c..c16a340 100644 --- a/gi/_gobject/Makefile.in +++ b/gi/_gobject/Makefile.in @@ -15,9 +15,9 @@ @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd @@ -38,8 +38,8 @@ host_triplet = @host@ @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 = $(pygobject_PYTHON) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in +DIST_COMMON = $(pkginclude_HEADERS) $(pygobject_PYTHON) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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 \ @@ -74,7 +74,7 @@ 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)$(pygobjectdir)" \ - "$(DESTDIR)$(pygobjectdir)" + "$(DESTDIR)$(pygobjectdir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(pygobject_LTLIBRARIES) am__DEPENDENCIES_1 = _gobject_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @@ -127,9 +127,11 @@ am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(_gobject_la_SOURCES) DIST_SOURCES = $(am___gobject_la_SOURCES_DIST) py_compile = $(top_srcdir)/py-compile +HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ @@ -286,7 +288,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.7 -PLATFORM_VERSION = 2.0 +PLATFORM_VERSION = 3.0 +pkginclude_HEADERS = pygobject.h # gobject python scripts pygobjectdir = $(pkgpyexecdir)/gi/_gobject @@ -544,6 +547,26 @@ uninstall-pygobjectPYTHON: cd "$(DESTDIR)$(pygobjectdir)" && rm -f $$filesc || exit $$?; \ echo " ( cd '$(DESTDIR)$(pygobjectdir)' && rm -f" $$fileso ")"; \ cd "$(DESTDIR)$(pygobjectdir)" && rm -f $$fileso +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -630,9 +653,9 @@ distdir: $(DISTFILES) check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(pygobjectdir)" "$(DESTDIR)$(pygobjectdir)"; do \ + for dir in "$(DESTDIR)$(pygobjectdir)" "$(DESTDIR)$(pygobjectdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -683,7 +706,8 @@ info: info-am info-am: -install-data-am: install-pygobjectLTLIBRARIES install-pygobjectPYTHON +install-data-am: install-pkgincludeHEADERS \ + install-pygobjectLTLIBRARIES install-pygobjectPYTHON install-dvi: install-dvi-am @@ -729,7 +753,8 @@ ps: ps-am ps-am: -uninstall-am: uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON +uninstall-am: uninstall-pkgincludeHEADERS \ + uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON .MAKE: check-am install-am install-strip @@ -741,12 +766,13 @@ uninstall-am: uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am \ - install-pygobjectLTLIBRARIES install-pygobjectPYTHON \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ + install-pdf-am install-pkgincludeHEADERS install-ps \ + install-ps-am install-pygobjectLTLIBRARIES \ + install-pygobjectPYTHON install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS \ uninstall-pygobjectLTLIBRARIES uninstall-pygobjectPYTHON diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py index e42f854..f3abe28 100644 --- a/gi/overrides/GLib.py +++ b/gi/overrides/GLib.py @@ -221,6 +221,56 @@ class Variant(GLib.Variant): raise NotImplementedError('unsupported GVariant type ' + self.get_type_string()) + @classmethod + def split_signature(klass, signature): + '''Return a list of the element signatures of the topmost signature tuple. + + If the signature is not a tuple, it returns one element with the entire + signature. If the signature is an empty tuple, the result is []. + + This is useful for e. g. iterating over method parameters which are + passed as a single Variant. + ''' + if signature == '()': + return [] + + if not signature.startswith('('): + return [signature] + + result = [] + head = '' + tail = signature[1:-1] # eat the surrounding ( ) + while tail: + c = tail[0] + head += c + tail = tail[1:] + + if c in ('m', 'a'): + # prefixes, keep collecting + continue + if c in ('(', '{'): + # consume until corresponding )/} + level = 1 + up = c + if up == '(': + down = ')' + else: + down = '}' + while level > 0: + c = tail[0] + head += c + tail = tail[1:] + if c == up: + level += 1 + elif c == down: + level -= 1 + + # otherwise we have a simple type + result.append(head) + head = '' + + return result + # # Pythonic iterators # diff --git a/gi/pygi-info.c b/gi/pygi-info.c index 007b609..30e1956 100644 --- a/gi/pygi-info.c +++ b/gi/pygi-info.c @@ -430,12 +430,8 @@ _pygi_g_type_info_size (GITypeInfo *type_info) case GI_TYPE_TAG_DOUBLE: case GI_TYPE_TAG_GTYPE: case GI_TYPE_TAG_UNICHAR: - if (g_type_info_is_pointer (type_info)) { - size = sizeof (gpointer); - } else { - size = _pygi_g_type_tag_size (type_tag); - g_assert (size > 0); - } + size = _pygi_g_type_tag_size (type_tag); + g_assert (size > 0); break; case GI_TYPE_TAG_INTERFACE: { |