diff options
author | Romain Bouvier <skunnyk@alteroot.org> | 2020-04-24 12:09:09 +0200 |
---|---|---|
committer | Romain Bouvier <skunnyk@alteroot.org> | 2020-04-24 12:12:12 +0200 |
commit | 19c3566a50f0b062d06b055e785e2ad08ec40f3b (patch) | |
tree | 22ca94bf9f9ad2201be7aca59abc21ecde423fcb | |
parent | 7b6d095d6479b285e6569e6ff9d574aadbfa3a75 (diff) | |
download | xfconf-19c3566a50f0b062d06b055e785e2ad08ec40f3b.tar.gz |
Remove xfconf perl binding
- Disable by default since 4.14
- Not sure anybody use it, haven't seen any evolution since 4.6
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac.in | 59 | ||||
-rw-r--r-- | po/POTFILES.skip | 3 | ||||
-rw-r--r-- | xfconf-perl/Makefile.PL.in | 104 | ||||
-rw-r--r-- | xfconf-perl/Makefile.am | 33 | ||||
-rw-r--r-- | xfconf-perl/Xfconf.pm.in | 103 | ||||
-rw-r--r-- | xfconf-perl/copyright.pod | 4 | ||||
-rw-r--r-- | xfconf-perl/doctypes | 0 | ||||
-rw-r--r-- | xfconf-perl/xfconfperl.h | 28 | ||||
-rw-r--r-- | xfconf-perl/xfconfperl.maps | 2 | ||||
-rw-r--r-- | xfconf-perl/xs/Makefile.am | 17 | ||||
-rw-r--r-- | xfconf-perl/xs/Xfconf.xs | 52 | ||||
-rw-r--r-- | xfconf-perl/xs/XfconfBinding.xs | 69 | ||||
-rw-r--r-- | xfconf-perl/xs/XfconfChannel.xs | 220 | ||||
-rw-r--r-- | xfconf-perl/xs_files | 3 |
16 files changed, 7 insertions, 695 deletions
@@ -75,6 +75,9 @@ tests/t-get-properties tests/test-xdg_config_home xfconf/xfconf-dbus-bindings.h xfconf/libxfconf-0.pc +xfconf/Xfconf-0.gir +xfconf/Xfconf-0.typelib +xfconf/libxfconf-0.vapi xfconf-perl/Makefile.PL xfconf-perl/Xfconf.pm xfconf-query/xfconf-query diff --git a/Makefile.am b/Makefile.am index f0e0405..de6f5e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,6 @@ SUBDIRS = \ xfconf \ xfconfd \ xfconf-query \ - xfconf-perl \ po \ docs \ tests @@ -35,6 +34,5 @@ EXTRA_DIST = \ DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ - --disable-perl-bindings \ --enable-introspection \ --disable-vala diff --git a/configure.ac.in b/configure.ac.in index ef00e16..d241ed4 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -3,7 +3,7 @@ dnl dnl xfconf - dbus-based configuration daemon and library for xfce dnl dnl Copyright (c) 2007-2011 Brian Tarricone <bjt23@cornell.edu> -dnl Copyright (c) 2011-2019 Xfce Development Team <xfce4-dev@xfce.org> +dnl Copyright (c) 2011-2020 Xfce Development Team <xfce4-dev@xfce.org> dnl dnl version info @@ -20,7 +20,7 @@ m4_define([xfconf_version], [xfconf_version_major().xfconf_version_minor().xfcon m4_define([xfconf_default_debug], [ifelse(xfconf_version_tag(), [git], [yes], [minimum])]) dnl init autoconf -AC_INIT([xfconf], [xfconf_version], [http://bugzilla.xfce.org/]) +AC_INIT([xfconf], [xfconf_version], [https://bugzilla.xfce.org/]) AC_CONFIG_MACRO_DIRS([m4]) AC_PREREQ([2.50]) @@ -92,58 +92,11 @@ XDT_CHECK_PACKAGE([GLIB], [gobject-2.0], [2.42.0]) XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.42.0]) XDT_CHECK_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.42.0]) XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.42.0]) -XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0]) +XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.14.0]) -dnl check for perl bindings for --disable-perl-bindings and make-exo-alias.pl +dnl check for make-exo-alias.pl AC_PATH_PROGS([PERL], [perl5.8 perl5.6 perl5 perl]) -dnl see if we can build the perl bindings -AC_ARG_ENABLE([perl-bindings], - [AC_HELP_STRING([--disable-perl-bindings], - [Don't try to build the perl bindings (default=auto)])], - [use_perl=$enableval], [use_perl=no]) -PERL_GLIB_REQUIRED_VERSION=1.020 -PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION=0.300 -PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION=1.000 -if test "x$use_perl" != "xno"; then - if test "$PERL"; then - # we need Glib, as well as a few support modules - AC_MSG_CHECKING([for perl modules: ExtUtils::Depends, ExtUtils::PkgConfig, Glib]) - if `$PERL -e "use Glib '$PERL_GLIB_REQUIRED_VERSION'; \ - use ExtUtils::Depends '$PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION'; \ - use ExtUtils::PkgConfig '$PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION';" \ - >/dev/null 2>&1` - then - have_perl=yes - AC_MSG_RESULT([yes]) - else - have_perl=no - AC_MSG_RESULT([no]) - echo ' -*** Required perl modules not found to build perl bindings. Requirements are: -*** -*** ExtUtils::Depends '"$PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION"' -*** ExtUtils::PkgConfig '"$PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION"' -*** Glib '"$PERL_GLIB_REQUIRED_VERSION"' -*** -*** Please install the required dependencies and run '"$0"' again. -' - fi - fi -fi -AM_CONDITIONAL([BUILD_PERL_BINDINGS], [test "x$have_perl" = "xyes"]) -AC_SUBST([PERL_GLIB_REQUIRED_VERSION]) -AC_SUBST([PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION]) -AC_SUBST([PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION]) - -dnl Options to pass when configuring Perl bindings -AC_ARG_WITH([perl-options], - [AC_HELP_STRING([--with-perl-options=OPTIONS], - [options to pass on command-line when generating Perl bindings build file])], - [perl_makeopts="$withval"], [perl_makeopts=""]) -PERL_MAKE_OPTIONS="$perl_makeopts" -AC_SUBST(PERL_MAKE_OPTIONS) - dnl check alignment for struct returns AC_DEFUN([BT_GLIB_CHECK_ALIGNOF], [ @@ -259,10 +212,6 @@ tests/object-bindings/Makefile tests/property-changed-signal/Makefile xfconf/Makefile xfconf/libxfconf-0.pc -xfconf-perl/Makefile.PL -xfconf-perl/Makefile -xfconf-perl/Xfconf.pm -xfconf-perl/xs/Makefile xfconf-query/Makefile xfconfd/Makefile gsettings-backend/Makefile diff --git a/po/POTFILES.skip b/po/POTFILES.skip deleted file mode 100644 index 9056295..0000000 --- a/po/POTFILES.skip +++ /dev/null @@ -1,3 +0,0 @@ -xfconf-perl/xs/Xfconf.c -xfconf-perl/xs/XfconfBinding.c -xfconf-perl/xs/XfconfChannel.c diff --git a/xfconf-perl/Makefile.PL.in b/xfconf-perl/Makefile.PL.in deleted file mode 100644 index b0d8e1e..0000000 --- a/xfconf-perl/Makefile.PL.in +++ /dev/null @@ -1,104 +0,0 @@ -# -# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Glade/Makefile.PL,v 1.21 2008/09/07 20:05:50 kaffeetisch Exp $ -# - -use strict; -use 5.008; -use Cwd; -use File::Spec; -use ExtUtils::MakeMaker; - -# minimum required version of dependancies we need to build -our %build_reqs = ( - 'perl-ExtUtils-Depends' => '@PERL_EXTUTILS_DEPENDS_REQUIRED_VERSION@', - 'perl-ExtUtils-PkgConfig' => '@PERL_EXTUTILS_PKGCONFIG_REQUIRED_VERSION@', - 'perl-Glib' => '@PERL_GLIB_REQUIRED_VERSION@', # for Glib::MakeHelper - 'DBus' => '@DBUS_REQUIRED_VERSION@', -); - -our %pre_reqs = ( - Glib:: => $build_reqs{'perl-Glib'}, - ExtUtils::Depends:: => $build_reqs{'perl-ExtUtils-Depends'}, - ExtUtils::PkgConfig:: => $build_reqs{'perl-ExtUtils-PkgConfig'}, -); - -# Writing a fake Makefile ensures that CPAN will pick up the correct -# dependencies and install them. -unless(eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';" - . "use ExtUtils::PkgConfig '$build_reqs{'perl-ExtUtils-PkgConfig'}';" - . "use Glib::MakeHelper;" - . "use Glib::CodeGen;" - # just seeing if Glib is available isn't enough, make sure - # it's recent enough, too - . "use Glib '$build_reqs{'perl-Glib'}';" - . "1") -{ - warn "$@\n"; - WriteMakefile( - PREREQ_FATAL => 1, - PREREQ_PM => \%pre_reqs, - ); - exit 1; # not reached -} - -# If the package can't be found, warn and exit with status 0 to indicate to -# CPAN testers that their system is not supported. -our %pkgcfg; -unless(eval { %pkgcfg = ExtUtils::PkgConfig->find(' dbus-1 >= '.$build_reqs{DBus}); - 1; }) -{ - warn $@; - exit 0; -} - -require Glib::CodeGen; - -mkdir('build', 0777); - -my @xs_files = (); -my @xs_lists = 'xs_files'; -foreach my $file (@xs_lists) { - my @names = Glib::MakeHelper->read_source_list_file($file); - print "Loaded ".scalar(@names)." xs files from $file\n"; - push(@xs_files, @names); -} - -Glib::CodeGen->parse_maps('xfconfperl', - input => 'xfconfperl.maps'); -Glib::CodeGen->write_boot(xs_files =>\@xs_files, - ignore => '(^[^:]+$)|(^Xfce4::Xfconf$)'); - -my $cwd = cwd(); -# this seems not really portable, but works... i think. subversion's native -# perl bindings do it this way, anyway. -my $libxfconf_cflags = "-I$cwd/.. -I".$ENV{'top_builddir'}; -my $libxfconf_libs = "-L$cwd/../common/.libs -L$cwd/../xfconf/.libs " - ."-lxfconf-gvaluefuncs -lxfconf-0"; - -our $xfconf = ExtUtils::Depends->new('Xfconf', 'Glib'); -$xfconf->set_inc($pkgcfg{cflags} . " -I. -Ibuild " . $libxfconf_cflags); -$xfconf->set_libs($libxfconf_libs . " " . $pkgcfg{libs}); -$xfconf->add_pm('Xfconf.pm' => '$(INST_LIBDIR)/Xfconf.pm'); -#$xfconf->add_pm('Array.pm' => '$(INST_LIBDIR)/Xfconf/Array.pm'); -$xfconf->add_xs(@xs_files); -$xfconf->add_typemaps(map {File::Spec->catfile($cwd,$_)} qw(build/xfconfperl.typemap) ); - -$xfconf->install(qw(xfconfperl.h build/xfconfperl-autogen.h)); -$xfconf->save_config('build/IFiles.pm'); - -WriteMakefile( - FIRST_MAKEFILE => 'Makefile.perl', - NAME => 'Xfce4::Xfconf', - VERSION_FROM => 'Xfconf.pm', - ABSTRACT_FROM => 'Xfconf.pm', - PREREQ_PM => \%pre_reqs, - XSPROTOARG => '-noprototypes', - $xfconf->get_makefile_vars, -); - - -sub MY::postamble -{ - return Glib::MakeHelper->postamble_clean() - . Glib::MakeHelper->postamble_docs_full(DEPENDS => $xfconf) -} diff --git a/xfconf-perl/Makefile.am b/xfconf-perl/Makefile.am deleted file mode 100644 index 23307ed..0000000 --- a/xfconf-perl/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -@SET_MAKE@ - -SUBDIRS = \ - xs - -xfconf_perl_files = \ - copyright.pod \ - doctypes \ - xfconfperl.h \ - xfconfperl.maps \ - xs_files - -EXTRA_DIST = \ - $(xfconf_perl_files) - -if BUILD_PERL_BINDINGS -Makefile.perl: Makefile.PL xs_files xfconfperl.maps Makefile - if test "$(top_srcdir)" != "$(top_builddir)"; then \ - for f in $(xfconf_perl_files); do \ - test -f $$f || $(LN_S) $(srcdir)/$$f $$f; \ - done; \ - fi - top_builddir="$(top_srcdir)" $(PERL) Makefile.PL PREFIX="$(prefix)" $(PERL_MAKE_OPTIONS) - -all-local: Makefile.perl - $(MAKE) -f Makefile.perl - -install-exec-local: - $(MAKE) -f Makefile.perl install DESTDIR=$(DESTDIR) - -distclean-local: - $(MAKE) -f Makefile.perl realclean -endif diff --git a/xfconf-perl/Xfconf.pm.in b/xfconf-perl/Xfconf.pm.in deleted file mode 100644 index 4eeebd0..0000000 --- a/xfconf-perl/Xfconf.pm.in +++ /dev/null @@ -1,103 +0,0 @@ -# -# Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> -# -# 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; version 2 of the License ONLY. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -{ package Xfce4::Xfconf; - use 5.008; - use strict; - use warnings; - - use Glib; - - require DynaLoader; - - our $VERSION = '@VERSION@'; - - our @ISA = qw(DynaLoader); - - sub import { - my $class = shift; - $class->VERSION(@_); - } - - # this next bit causes problems on darwin, hence the conditional - sub dl_load_flags { - return $^O eq 'darwin' ? 0x00 : 0x01; - } - - # and we're off - Xfce4::Xfconf->bootstrap($VERSION); -} - -1; -__END__ - -=head1 NAME - -Xfconf - Perl interface to the Xfconf configuration system. - -=head1 SYNOPSIS - - use Xfce4::Xfconf; - - my $channel = Xfce4::Xfconf::Channel->new('FooChannel'); - my $value = $channel->get_string('/general/foo-property'); - -=head1 ABSTRACT - -Perl bindings to the Xfconf confgiuration system. This module allows -you to access settings stored in Xfconf using perl. - -=head1 DESCRIPTION - -The Xfce4::Xfconf module allows perl developers to make use of the -Xfconf configuration system to store and retrieve settings for perl -applications. Learn more about Xfce and Xfconf at http://xfce.org/. - -The Xfconf API reference is very useful when writing apps using xfconf-perl. -The call signatures will not always be identical, but one can get a good idea -of what the different functions and classes do: -http://mocha.xfce.org/~kelnos/xfconf/docs-current/ - -To discuss xfconf-perl, please join the Xfce Development Discussion list. -Instructions can be found at http://foo-projects.org/mailman/listinfo/xfce4-dev - -Finally, the xfconf-perl website is located at: -http://xfce.org/ - -=head1 AUTHORS - - Brian Tarricone <bjt23@cornell.edu> - -=head1 COPYRIGHT AND LICENSE - -Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu>. - -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 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 -Library 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., 59 Temple Place - Suite 330, -Boston, MA 02111-1307 USA. - -=cut diff --git a/xfconf-perl/copyright.pod b/xfconf-perl/copyright.pod deleted file mode 100644 index f771c41..0000000 --- a/xfconf-perl/copyright.pod +++ /dev/null @@ -1,4 +0,0 @@ -Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> - -This software is licensed under the GNU Lesser General Public License, -version 2.1 ONLY. diff --git a/xfconf-perl/doctypes b/xfconf-perl/doctypes deleted file mode 100644 index e69de29..0000000 --- a/xfconf-perl/doctypes +++ /dev/null diff --git a/xfconf-perl/xfconfperl.h b/xfconf-perl/xfconfperl.h deleted file mode 100644 index 8efda59..0000000 --- a/xfconf-perl/xfconfperl.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * xfconf-perl - * - * Copyright (c) 2009 Brian Tarricone <brian@tarricone.org> - * - * 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; version 2 - * of the License ONLY. - * - * 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 __XFCONFPERL_H__ -#define __XFCONFPERL_H__ - -#include <gperl.h> -#include <xfconf/xfconf.h> -#include <xfconfperl-autogen.h> - -#endif /* !__XFCONFPERL_H__ */ diff --git a/xfconf-perl/xfconfperl.maps b/xfconf-perl/xfconfperl.maps deleted file mode 100644 index 77c1357..0000000 --- a/xfconf-perl/xfconfperl.maps +++ /dev/null @@ -1,2 +0,0 @@ -XFCONF_TYPE_CHANNEL XfconfChannel GObject Xfce4::Xfconf::Channel -XFCONF_ERROR XFCONF_TYPE_ERROR GError Xfce4::Xfconf::Error diff --git a/xfconf-perl/xs/Makefile.am b/xfconf-perl/xs/Makefile.am deleted file mode 100644 index 41e37f0..0000000 --- a/xfconf-perl/xs/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -xfconf_perl_xs_files = \ - Xfconf.xs \ - XfconfBinding.xs \ - XfconfChannel.xs - -EXTRA_DIST = \ - $(xfconf_perl_xs_files) - -if BUILD_PERL_BINDINGS -all-local: - if test "$(top_srcdir)" != "$(top_builddir)"; then \ - for f in $(xfconf_perl_xs_files); do \ - test -f $$f || $(LN_S) $(srcdir)/$$f $$f; \ - done; \ - fi -endif diff --git a/xfconf-perl/xs/Xfconf.xs b/xfconf-perl/xs/Xfconf.xs deleted file mode 100644 index e5c48ad..0000000 --- a/xfconf-perl/xs/Xfconf.xs +++ /dev/null @@ -1,52 +0,0 @@ -/* NOTE: THIS FILE WAS POSSIBLY AUTO-GENERATED! */ - -/* - * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> - * - * 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; version 2 of the License ONLY. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xfconfperl.h" - - -MODULE = Xfce4::Xfconf PACKAGE = Xfce4::Xfconf PREFIX = xfconf_ -PROTOTYPES: ENABLE - -BOOT: - { -#include "register.xsh" -#include "boot.xsh" - - gperl_handle_logs_for("Xfconf"); - } - -gboolean -xfconf_init(class=NULL) - PREINIT: - GError *error = NULL; - CODE: - RETVAL = xfconf_init(&error); - if(!RETVAL) - gperl_croak_gerror(NULL, error); - -void -xfconf_shutdown(class=NULL) - C_ARGS: - /* void */ - -#void -#xfconf_named_struct_register(struct_name, n_members, member_types) -# const gchar * struct_name -# guint n_members -# const GType * member_types diff --git a/xfconf-perl/xs/XfconfBinding.xs b/xfconf-perl/xs/XfconfBinding.xs deleted file mode 100644 index 2a4cff5..0000000 --- a/xfconf-perl/xs/XfconfBinding.xs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> - * - * 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; version 2 of the License ONLY. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xfconfperl.h" - -#include <common/xfconf-gvaluefuncs.h> -#include <common/xfconf-common-private.h> - -MODULE = Xfce4::Xfconf::Binding PACKAGE = Xfce4::Xfconf::Binding PREFIX = xfconf_g_property_ -PROTOTYPES: ENABLE - -gulong -xfconf_g_property_bind(channel, xfconf_property, xfconf_property_type, object, object_property) - XfconfChannel * channel - const gchar *xfconf_property - const gchar *xfconf_property_type - GObject *object - const gchar *object_property - CODE: - RETVAL = 0; - - if(!g_ascii_strcasecmp(xfconf_property_type, "gdkcolor")) { - RETVAL = xfconf_g_property_bind_gdkcolor(channel, xfconf_property, - object, object_property); - } else { - GType xfconf_gtype = _xfconf_gtype_from_string(xfconf_property_type); - if(xfconf_gtype == G_TYPE_INVALID) - croak("Xfce4::Xfconf::Binding::bind(): can't determine xfconf property type from \"%s\"", xfconf_property_type); - if(xfconf_gtype == G_TYPE_NONE || xfconf_gtype == G_TYPE_PTR_ARRAY) - croak("Xfce4::Xfconf::Binding::bind(): invalid xfconf property type \"%s\" for binding", xfconf_property_type); - RETVAL = xfconf_g_property_bind(channel, xfconf_property, xfconf_gtype, - object, object_property); - } - -void -xfconf_g_property_unbind(...) - CODE: - if(items != 1 && items != 4) - croak("Usage: Xfce4::Xfconf::Binding::unbind(id) or ::unbind(channel) or ::unbind(object) or ::unbind(channel, xfconf_property, object, object_property)"); - - if(items == 1) { - GObject *channel_or_object; - - if((channel_or_object = SvGObject_ornull(ST(0)))) - xfconf_g_property_unbind_all(channel_or_object); - else if(SvIOK(ST(0))) - xfconf_g_property_unbind(SvIV(ST(0))); - } else if(items == 4) { - XfconfChannel *channel = SvXfconfChannel(ST(0)); - const gchar *xfconf_property = SvGChar(ST(1)); - GObject *object = SvGObject(ST(2)); - const gchar *object_property = SvGChar(ST(3)); - - xfconf_g_property_unbind_by_property(channel, xfconf_property, object, object_property); - } diff --git a/xfconf-perl/xs/XfconfChannel.xs b/xfconf-perl/xs/XfconfChannel.xs deleted file mode 100644 index 8bac211..0000000 --- a/xfconf-perl/xs/XfconfChannel.xs +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu> - * - * 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; version 2 of the License ONLY. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xfconfperl.h" - -#include <common/xfconf-gvaluefuncs.h> -#include <common/xfconf-common-private.h> - - -static void -xfconf_perl_ghashtable_to_hv(gpointer key, - gpointer valuep, - gpointer data) -{ - GValue *value = (GValue *)valuep; - HV *hv = (HV *)data; - SV *val_sv = gperl_sv_from_value(value); - - hv_store(hv, (const char *)key, strlen(key), val_sv, 0); -} - -MODULE = Xfce4::Xfconf::Channel PACKAGE = Xfce4::Xfconf::Channel PREFIX = xfconf_channel_ -PROTOTYPES: ENABLE - -XfconfChannel * -xfconf_channel_new(class, channel_name) - const gchar * channel_name - C_ARGS: - channel_name - -XfconfChannel * -xfconf_channel_new_with_property_base(class, channel_name, property_base) - const gchar * channel_name - const gchar * property_base - C_ARGS: - channel_name, - property_base - -gboolean -xfconf_channel_has_property(channel, property) - XfconfChannel * channel - const gchar * property - -gboolean -xfconf_channel_is_property_locked(channel, property) - XfconfChannel * channel - const gchar * property - -void -xfconf_channel_reset_property(channel, property_base, recursive=FALSE) - XfconfChannel * channel - const gchar * property_base - gboolean recursive - -HV * -xfconf_channel_get_properties(channel, property_base=NULL) - XfconfChannel * channel - const gchar * property_base - PREINIT: - GHashTable *properties = NULL; - CODE: - properties = xfconf_channel_get_properties(channel, property_base); - if(!properties) - RETVAL = (HV *)&PL_sv_undef; - else { - RETVAL = newHV(); - g_hash_table_foreach(properties, - xfconf_perl_ghashtable_to_hv, - RETVAL); - sv_2mortal((SV *)RETVAL); - g_hash_table_destroy(properties); - } - ST(0) = (SV *)RETVAL; /* why isn't xsubpp doing this for us? */ - -void -xfconf_channel_get_property(channel, property, default_value=NULL) - XfconfChannel * channel - const gchar * property - SV * default_value - PREINIT: - GValue val = { 0, }; - PPCODE: - if(!xfconf_channel_get_property(channel, property, &val)) { - XPUSHs((default_value ? default_value : &PL_sv_undef)); - } else if(G_VALUE_TYPE(&val) == G_TYPE_PTR_ARRAY) { - GPtrArray *arr = g_value_get_boxed(&val); - gint i; - - EXTEND(SP, arr->len); - for(i = 0; i < arr->len; ++i) { - GValue *arrval = g_ptr_array_index(arr, i); - PUSHs(sv_2mortal(gperl_sv_from_value(arrval))); - } - g_value_unset(&val); - } else { - XPUSHs(gperl_sv_from_value(&val)); - g_value_unset(&val); - } - -gboolean -_set_property(channel, property, value, arraytypes=NULL) - XfconfChannel * channel - const gchar * property - SV * value - SV * arraytypes - ALIAS: - set_uchar = 0 - set_char = 1 - set_uint16 = 2 - set_int16 = 3 - set_uint = 4 - set_int = 5 - set_uint64 = 6 - set_int64 = 7 - set_float = 8 - set_double = 9 - set_bool = 10 - set_string = 11 - set_array = 12 - PREINIT: - GType gtype = G_TYPE_INVALID; - GValue val = { 0 , }; - CODE: - RETVAL = FALSE; - switch(ix) { - case 0: gtype = G_TYPE_UCHAR; break; - case 1: gtype = G_TYPE_CHAR; break; - case 2: gtype = XFCONF_TYPE_UINT16; break; - case 3: gtype = XFCONF_TYPE_INT16; break; - case 4: gtype = G_TYPE_UINT; break; - case 5: gtype = G_TYPE_INT; break; - case 6: gtype = G_TYPE_UINT64; break; - case 7: gtype = G_TYPE_INT64; break; - case 8: gtype = G_TYPE_FLOAT; break; - case 9: gtype = G_TYPE_DOUBLE; break; - case 10: gtype = G_TYPE_BOOLEAN; break; - case 11: gtype = G_TYPE_STRING; break; - case 12: gtype = G_TYPE_PTR_ARRAY; break; - } - - if(gtype != G_TYPE_PTR_ARRAY) { - g_value_init(&val, gtype); - gperl_value_from_sv(&val, value); - RETVAL = xfconf_channel_set_property(channel, property, &val); - g_value_unset(&val); - } else { - GPtrArray *arr; - AV *av_values, *av_types; - gint num_elements, i; - - if(!SvROK(value) || (arraytypes && !SvROK(arraytypes))) - croak("Usage: Xfce4::Xfconf::Channel::set_array($property, \\@values, \\@types=NULL)"); - - av_values = (AV *)SvRV(value); - av_types = arraytypes ? (AV *)SvRV(arraytypes) : NULL; - - if(av_len(av_values) != av_len(av_types)) - croak("Xfce4::Xfconf::Channel::set_array(): values array is not the same size as the types array"); - - num_elements = av_len(av_values) + 1; - arr = g_ptr_array_sized_new(num_elements); - for(i = 0; i < num_elements; ++i) { - SV **val_sv = av_fetch(av_values, i, 0); - GValue *arrval; - - gtype = G_TYPE_INVALID; - - if(!val_sv || !*val_sv || !SvOK(*val_sv) || SvROK(*val_sv)) { - xfconf_array_free(arr); - croak("Xfce4::Xfconf::Channel::set_array(): invalid value at index %d", i); - } - - if(av_types) { - SV **type_sv = av_fetch(av_types, i, 0); - if(type_sv && *type_sv && SvOK(*type_sv)) - gtype = _xfconf_gtype_from_string(SvGChar(*type_sv)); - } - - if(gtype == G_TYPE_INVALID) { - if(av_types) - warn("Xfce4::Xfconf::Channel::set_array(): unable to determine type at index %d; guessing", i); - if(SvNOKp(*val_sv)) - gtype = G_TYPE_DOUBLE; - else if(SvIOKp(*val_sv)) - gtype = G_TYPE_INT; - else - gtype = G_TYPE_STRING; - } - - if(gtype == G_TYPE_NONE || gtype == G_TYPE_PTR_ARRAY) { - xfconf_array_free(arr); - croak("Xfce4::Xfconf::Channel::set_array(): value cannot be of type 'empty' or 'array' at index %d", i); - } - - arrval = g_new0(GValue, 1); - g_value_init(arrval, gtype); - gperl_value_from_sv(arrval, *val_sv); - - g_ptr_array_add(arr, arrval); - } - - RETVAL = xfconf_channel_set_arrayv(channel, property, arr); - xfconf_array_free(arr); - } - /* why isn't xsubpp doing this for us? */ - ST(0) = sv_2mortal(boolSV(RETVAL)); diff --git a/xfconf-perl/xs_files b/xfconf-perl/xs_files deleted file mode 100644 index 6a9ec2e..0000000 --- a/xfconf-perl/xs_files +++ /dev/null @@ -1,3 +0,0 @@ -xs/Xfconf.xs -xs/XfconfBinding.xs -xs/XfconfChannel.xs |