]> err.no Git - libchamplain/commitdiff
The Perl bindings for champlain-gtk will be in a different package
authorEmmanuel Rodriguez <emmanuel.rodriguez@booking.com>
Tue, 15 Sep 2009 18:26:25 +0000 (20:26 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 21 Sep 2009 16:19:44 +0000 (12:19 -0400)
bindings/perl/Champlain/Makefile.PL
bindings/perl/Champlain/champlain-perl.h
bindings/perl/Champlain/examples/gtk2.pl [deleted file]
bindings/perl/Champlain/maps-gtk [deleted file]
bindings/perl/Champlain/t/Gtk2ChamplainEmbed.t [deleted file]
bindings/perl/Champlain/xs/Gtk2ChamplainEmbed.xs [deleted file]

index 09e95c526dfc76cdbdca42237bbd1c2ad9fd63c4..bf4c9e35fb5cdd3ba764e9e8cd25652c907042a1 100644 (file)
@@ -6,7 +6,7 @@ use ExtUtils::MakeMaker;
 use Cwd;
 use File::Spec;
 
-use Gtk2::CodeGen;
+use Glib::CodeGen;
 use Glib::MakeHelper;
 use ExtUtils::Depends;
 use ExtUtils::PkgConfig;
@@ -41,21 +41,6 @@ sub main {
                return;
        }
        
-       # If libchamplain-gtk is installed the GTK bindings will be generated
-       eval {
-               my %conf = ExtUtils::PkgConfig->find("champlain-gtk-$champlain_version");
-               $pkgconfig{cflags} .= $conf{cflags} . ' -DCHAMPLAINPERL_GTK';
-               $pkgconfig{libs} .= $conf{libs};
-               
-               # All XS files that start with Gtk2Champlain are for libchamplain-gtk
-               push @XS_FILES, <xs/Gtk2Champlain*.xs>;
-               push @typemaps, 'maps-gtk';
-               push @deps, 'Gtk2';
-       };
-       if (my $error = $@) {
-               warn "Ignoring the Gtk2 bindings ($error)";
-       }
-       
        $DEPENDS = ExtUtils::Depends->new('Champlain', @deps);
        
        $DEPENDS->add_pm(
@@ -64,8 +49,8 @@ sub main {
        );
 
        # Code generation
-       Gtk2::CodeGen->parse_maps('champlain', input => [ @typemaps ]);
-       Gtk2::CodeGen->write_boot(xs_files => [ @XS_FILES ]);
+       Glib::CodeGen->parse_maps('champlain', input => [ @typemaps ]);
+       Glib::CodeGen->write_boot(xs_files => [ @XS_FILES ]);
        
        
        $DEPENDS->set_inc($pkgconfig{cflags} . ' -I./build');
index b0c7d9e6957429934339d110de5a22c7c1a030e1..41d29a3aa9c1447fe46efb662c5d0b6b88fb3172 100644 (file)
@@ -2,15 +2,8 @@
 
 #include <clutter-perl.h>
 
-
 #include <champlain/champlain.h>
 
-#ifdef CHAMPLAINPERL_GTK
-#include <gtk2perl.h>
-#include <champlain-gtk/champlain-gtk.h>
-#endif
-
-
 #include "champlain-autogen.h"
 
 #endif /* _CHAMPLAIN_PERL_H_ */
diff --git a/bindings/perl/Champlain/examples/gtk2.pl b/bindings/perl/Champlain/examples/gtk2.pl
deleted file mode 100755 (executable)
index 4071d70..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Glib qw(TRUE FALSE);
-use Clutter qw(-gtk-init);
-use Gtk2 qw(-init);
-use Gtk2::SimpleList;
-use Champlain;
-
-
-exit main();
-
-
-sub main {
-       
-       my $window = Gtk2::Window->new();
-       $window->set_border_width(10);
-       $window->set_title("Champlain - Demo");
-       $window->signal_connect('destroy' => sub { Gtk2->main_quit() });
-       
-       my $vbox = Gtk2::VBox->new(FALSE, 10);  
-
-       # Create the map view
-       my $gtk2_map = Gtk2::ChamplainEmbed->new();
-       my $map = $gtk2_map->get_view();
-       $map->set_scroll_mode('kinetic');
-       $map->set_zoom_level(5);
-       $gtk2_map->set_size_request(640, 480);
-       
-       # Create the markers and marker layer
-       my $layer = create_marker_layer($map);
-       $map->add_layer($layer);
-
-
-       ##
-       # Create the top toolbar
-       my $toolbox = Gtk2::HBox->new(FALSE, 10);
-
-       my $child = Gtk2::Button->new_from_stock('gtk-zoom-in');
-       $child->signal_connect('clicked', sub {
-               $map->zoom_in();        
-       });
-       $toolbox->add($child);
-
-       $child = Gtk2::Button->new_from_stock('gtk-zoom-out');
-       $child->signal_connect('clicked', sub {
-               $map->zoom_out();       
-       });
-       $toolbox->add($child);
-
-       $child = Gtk2::Button->new_from_stock('gtk-home');
-       $child->signal_connect('clicked', sub {
-               $map->go_to(48.218611, 17.146397);
-       });
-       $toolbox->add($child);
-
-       $child = Gtk2::ToggleButton->new_with_label("Markers");
-       $child->signal_connect('toggled', sub {
-               if ($layer->get('visible')) {
-                       $layer->hide();         
-               }
-               else {
-                       $layer->show_all();             
-               }
-       });
-       $toolbox->add($child);
-       
-       $toolbox->add(create_combo_box($map));
-
-       my $spin = Gtk2::SpinButton->new_with_range(0, 20, 1);
-       $spin->set_value($map->get_zoom_level);
-       $spin->signal_connect('changed', sub {
-               $map->set_zoom_level($spin->get_value_as_int);
-       });
-       $map->signal_connect('notify::zoom-level', sub {
-               $spin->set_value($map->get_zoom_level);
-       });
-       $toolbox->add($spin);
-
-       my $image = Gtk2::Image->new_from_stock('gtk-network', 'button');
-       $map->signal_connect('notify::state', sub {
-               my $state = $map->get('state');
-               if ($state eq 'loading') {
-                       $image->show();
-               }
-               else {
-                       $image->hide();         
-               }
-       });
-       $toolbox->pack_end($image, FALSE, FALSE, 0);
-
-       
-       # Finish initializing the map view
-       $map->center_on(45.466, -73.75);
-       
-
-       my $viewport = Gtk2::Viewport->new();
-       $viewport->set_shadow_type('etched-in');
-       $viewport->add($gtk2_map);
-
-       $vbox->pack_start($toolbox, FALSE, FALSE, 0);
-       $vbox->add($viewport);
-
-       $window->add($vbox);
-       $window->show_all();
-       $image->hide();
-       
-       Gtk2->main();
-       
-       return 0;
-}
-
-
-sub create_combo_box {
-       my ($map) = @_;
-       
-
-       # Create a simple list that will be used as the data model of the ComboBox
-       my $model = Gtk2::ListStore->new(
-               'Glib::String',
-               'Glib::String',
-       );
-       my $active = 0; # Tells which map source is active
-       my $index = 0;
-       my $current_source = $map->get_map_source->get_id;
-       my $factory = Champlain::MapSourceFactory->dup_default;
-       foreach my $desc (sort { $a->name cmp $b->name } $factory->dup_list) {
-               my $iter = $model->append();
-               $model->set($iter, 
-                       0, $desc->name,
-                       1, $desc->id,
-               );
-               
-               if ($current_source eq $desc->id) {
-                       $active = $index;
-               }
-               
-               ++$index;
-       }
-
-       my $combo = Gtk2::ComboBox->new_text();
-       $combo->set_model($model);
-       $combo->set_active($active);
-       
-       
-       $combo->signal_connect('changed', sub {
-               my ($button) = @_;
-
-               # Get the ID of the map source selected
-               my $iter = $button->get_active_iter;
-               my $id = $model->get($iter, 1);
-               
-               # Create that map source
-               my $source = $factory->create($id);
-               $map->set_map_source($source);
-       });
-       
-       return $combo;
-}
-
-
-sub create_marker_layer {
-       my ($map) = @_;
-       my $layer = Champlain::Layer->new();
-
-       my $orange = Clutter::Color->new(0xf3, 0x94, 0x07, 0xbb);
-       my $white = Clutter::Color->new(0xff, 0xff, 0xff, 0xff);
-       
-       my $marker;
-       
-       $marker = Champlain::Marker->new_with_text("Montr\x{e9}al", "Airmole 14");
-       $marker->set_position(45.528178, -73.563788);
-       $marker->set_reactive(TRUE);
-       $marker->signal_connect_after("button-release-event", \&marker_button_release_cb, $map);
-       $layer->add($marker);
-
-       $marker = Champlain::Marker->new_with_text("New York", "Sans 15", $white);
-       $marker->set_position(40.77, -73.98);
-       $layer->add($marker);
-
-       $marker = Champlain::Marker->new_with_text("Bratislava", "Sans 15", $orange);
-       $marker->set_position(48.148377, 17.107311);
-       $layer->add($marker);
-
-       $layer->show();
-       return $layer;
-}
-
-
-sub marker_button_release_cb {
-       my ($marker, $event, $map) = @_;
-       return FALSE unless $event->button == 1 && $event->click_count == 1;
-
-       print "Montreal was clicked\n";
-       return TRUE;
-}
-
-
-sub map_view_button_release_cb {
-       my ($actor, $event, $map) = @_;
-       return FALSE unless $event->button == 2 && $event->click_count == 1;
-
-       my ($lat, $lon) = $map->get_coords_from_event($event);
-       printf "Map was clicked at %f, %f\n", $lat, $lon;
-       return TRUE;
-}
diff --git a/bindings/perl/Champlain/maps-gtk b/bindings/perl/Champlain/maps-gtk
deleted file mode 100644 (file)
index aece961..0000000
+++ /dev/null
@@ -1 +0,0 @@
-GTK_TYPE_CHAMPLAIN_EMBED  GtkChamplainEmbed  GtkObject  Gtk2::ChamplainEmbed
diff --git a/bindings/perl/Champlain/t/Gtk2ChamplainEmbed.t b/bindings/perl/Champlain/t/Gtk2ChamplainEmbed.t
deleted file mode 100644 (file)
index ede94be..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Clutter::TestHelper tests => 2, sub_module => 'gtk';
-use Gtk2 '-init';
-
-use Champlain ':coords';
-
-
-exit tests();
-
-
-sub tests {
-       test_all();
-       return 0;
-}
-
-sub test_all {
-
-       my $embed = Gtk2::ChamplainEmbed->new();
-       isa_ok($embed, 'Gtk2::ChamplainEmbed');
-       
-       my $view = $embed->get_view;
-       isa_ok($view, 'Champlain::View');
-}
diff --git a/bindings/perl/Champlain/xs/Gtk2ChamplainEmbed.xs b/bindings/perl/Champlain/xs/Gtk2ChamplainEmbed.xs
deleted file mode 100644 (file)
index a447e36..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "champlain-perl.h"
-
-
-MODULE = Gtk2::ChamplainEmbed  PACKAGE = Gtk2::ChamplainEmbed  PREFIX = gtk_champlain_embed_
-
-
-GtkWidget*
-gtk_champlain_embed_new (class)
-       C_ARGS: /* No args */
-
-
-ChamplainView *
-gtk_champlain_embed_get_view (GtkChamplainEmbed* embed)