gnome-perl-introspection r35 - in trunk/Gnome2-Wnck: . lib/Gnome2 lib/Gnome2/Wnck



Author: tsch
Date: Sat Nov  8 20:10:40 2008
New Revision: 35
URL: http://svn.gnome.org/viewvc/gnome-perl-introspection?rev=35&view=rev

Log:
Adapt to the new G:O:I API and semantics, which greatly simplifying things.


Removed:
   trunk/Gnome2-Wnck/lib/Gnome2/Wnck/
Modified:
   trunk/Gnome2-Wnck/Build.PL
   trunk/Gnome2-Wnck/lib/Gnome2/Wnck.pm

Modified: trunk/Gnome2-Wnck/Build.PL
==============================================================================
--- trunk/Gnome2-Wnck/Build.PL	(original)
+++ trunk/Gnome2-Wnck/Build.PL	Sat Nov  8 20:10:40 2008
@@ -3,37 +3,15 @@
 use warnings;
 use Module::Build;
 
-my $wrapped_so = 'libwnck-1.so';
-my $idl = 'wnck.idl';
-my $wrapper_c = 'libwnck-1-i11n.c';
-my $wrapper_so = 'lib/Gnome2/Wnck/libwnck-1-i11n.so';
-my $wrapper_flags = `pkg-config --libs --cflags gobject-introspection`;
-chomp $wrapper_flags;
-
-my $cmd = "g-idl-compiler -l $wrapped_so $idl -o $wrapper_c";
-0 == system $cmd
-  or die "Generating $wrapper_c failed";
-
-$cmd = "gcc -shared $wrapper_flags $wrapper_c -o $wrapper_so";
-0 == system $cmd
-  or die "Generating $wrapper_so failed";
-
-my $pm_file = 'lib/Gnome2/Wnck.pm';
-
 my $builder = Module::Build -> new(
   module_name       => 'Gnome2::Wnck',
   license           => 'lgpl',
   dist_author       => 'Torsten Schoenfeld <kaffeetisch at gmx dot de>',
-  dist_version_from => $pm_file,
-  pm_files          => {
-      $pm_file => $pm_file,
-      $wrapper_so => $wrapper_so,
-  },
+  dist_version_from => 'lib/Gnome2/Wnck.pm',
   requires          => {
       'Glib::Object::Introspection' => 0.01,
       'Gtk2'                        => 1.00,
   },
-  add_to_cleanup    => [ 'Gnome2-Wnck-*', $wrapper_c, $wrapper_so ],
 );
 
 $builder -> create_build_script();

Modified: trunk/Gnome2-Wnck/lib/Gnome2/Wnck.pm
==============================================================================
--- trunk/Gnome2-Wnck/lib/Gnome2/Wnck.pm	(original)
+++ trunk/Gnome2-Wnck/lib/Gnome2/Wnck.pm	Sat Nov  8 20:10:40 2008
@@ -48,21 +48,7 @@
 our $VERSION = '0.01';
 
 sub import {
-  my $filename = "Gnome2/Wnck/libwnck-1-i11n.so";
-  my $full_filename = undef;
-
-  foreach my $prefix (@INC) {
-    my $tmp = "$prefix/$filename";
-    if (-f $tmp) {
-      $full_filename = $tmp;
-      last;
-    }
-  }
-
-  die "Can't find $filename in \ INC" unless defined $full_filename;
-
-  Glib::Object::Introspection -> setup("libwnck-1.so", $full_filename,
-                                       Wnck => "Gnome2::Wnck");
+  Glib::Object::Introspection -> setup(Wnck => '2.24', 'Gnome2::Wnck');
 }
 
 # --------------------------------------------------------------------------- #
@@ -81,9 +67,9 @@
 package Gnome2::Wnck::Application;
 
 sub get {
-  $Glib::Object::Introspection::AUTOLOAD =
-    "Gnome2::Wnck::Application::get";
-  return Glib::Object::Introspection::AUTOLOAD(@_);
+  shift;
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::application_get", @_); # FIXME
 }
 
 sub get_windows {
@@ -101,9 +87,9 @@
 package Gnome2::Wnck::ClassGroup;
 
 sub get {
-  $Glib::Object::Introspection::AUTOLOAD =
-    "Gnome2::Wnck::ClassGroup::get";
-  return Glib::Object::Introspection::AUTOLOAD(@_);
+  shift;
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::class_group_get", @_); # FIXME
 }
 
 sub get_windows {
@@ -129,9 +115,15 @@
 package Gnome2::Wnck::Screen;
 
 sub get {
-  $Glib::Object::Introspection::AUTOLOAD =
-    "Gnome2::Wnck::Screen::get";
-  return Glib::Object::Introspection::AUTOLOAD(@_);
+  shift;
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::screen_get", @_); # FIXME
+}
+
+sub get_default {
+  shift;
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::screen_get_default", @_); # FIXME
 }
 
 sub get_windows {
@@ -169,9 +161,14 @@
 package Gnome2::Wnck::Window;
 
 sub get {
-  $Glib::Object::Introspection::AUTOLOAD =
-    "Gnome2::Wnck::Window::get";
-  return Glib::Object::Introspection::AUTOLOAD(@_);
+  shift;
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::window_get", @_); # FIXME
+}
+
+sub create_window_action_menu {
+  return Glib::Object::Introspection::invoke(
+    "Gnome2::Wnck::create_window_action_menu", @_);
 }
 
 1;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]