summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-07 16:56:16 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-24 21:30:34 +0100
commit24d07aa63eb77616a38ff178726d0f4a0908b7dc (patch)
tree4515b672c368248a956259800d6507c23d816e26
parentc3e929c47cfbc38aae282eacbf757b14c7172590 (diff)
downloaddrakx-kbd-mouse-x11-24d07aa63eb77616a38ff178726d0f4a0908b7dc.tar
drakx-kbd-mouse-x11-24d07aa63eb77616a38ff178726d0f4a0908b7dc.tar.gz
drakx-kbd-mouse-x11-24d07aa63eb77616a38ff178726d0f4a0908b7dc.tar.bz2
drakx-kbd-mouse-x11-24d07aa63eb77616a38ff178726d0f4a0908b7dc.tar.xz
drakx-kbd-mouse-x11-24d07aa63eb77616a38ff178726d0f4a0908b7dc.zip
switch from gtk2 to gtk3
-rw-r--r--lib/Xconfig/resolution_and_depth.pm12
-rw-r--r--lib/Xconfig/test.pm16
-rw-r--r--lib/mouse.pm20
-rwxr-xr-xtools/keyboarddrake2
-rwxr-xr-xtools/mousedrake2
5 files changed, 26 insertions, 26 deletions
diff --git a/lib/Xconfig/resolution_and_depth.pm b/lib/Xconfig/resolution_and_depth.pm
index 6b8ed66..06662ce 100644
--- a/lib/Xconfig/resolution_and_depth.pm
+++ b/lib/Xconfig/resolution_and_depth.pm
@@ -3,7 +3,7 @@ package Xconfig::resolution_and_depth; # $Id: resolution_and_depth.pm 250289 200
use diagnostics;
use strict;
# perl_checker: require MDK::Common
-# perl_checker: require ugtk2
+# perl_checker: require ugtk3
use common;
@@ -338,14 +338,14 @@ sub choose_gtk {
#- $chosen_res must be one of @resolutions, so that it has a correct {ratio} field
first($filter_on_res->(@resolutions)) || $resolutions[0];
- require ugtk2;
- mygtk2->import;
- ugtk2->import(qw(:create :helpers :wrappers));
- my $W = ugtk2->new(N("Resolution"), modal => 1);
+ require ugtk3;
+ mygtk3->import;
+ ugtk3->import(qw(:create :helpers :wrappers));
+ my $W = ugtk3->new(N("Resolution"), modal => 1);
my %monitor_images_x_res = do {
my @l = qw(640 800 1024 1152 1280 1400 1600 1920 2048);
- my %h = map { $_ => ugtk2::_find_imgfile("monitor-$_.png") } @l;
+ my %h = map { $_ => ugtk3::_find_imgfile("monitor-$_.png") } @l;
#- for the other, use the biggest smaller
foreach my $x_res (uniq map { $_->{X} } @resolutions) {
diff --git a/lib/Xconfig/test.pm b/lib/Xconfig/test.pm
index a1764b3..36b0e30 100644
--- a/lib/Xconfig/test.pm
+++ b/lib/Xconfig/test.pm
@@ -88,8 +88,8 @@ sub test {
BEGIN { $::no_ugtk_init = 1 }
BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' }
require lang;
- require ugtk2; #- help perl_checker
- ugtk2->import(qw(:wrappers :helpers)); #- help perl_checker
+ require ugtk3; #- help perl_checker
+ ugtk3->import(qw(:wrappers :helpers)); #- help perl_checker
use interactive::gtk;
use run_program;
use common;
@@ -99,23 +99,23 @@ sub test {
lang::bindtextdomain();
$ENV{DISPLAY} = ":9";
- Gtk2->init;
+ Gtk3->init;
gtkset_background(200 * 257, 210 * 257, 210 * 257);
- my $text = Gtk2::Label->new;
+ my $text = Gtk3::Label->new;
my $time = 12;
Glib::Timeout->add(1000, sub {
$text->set(sprintf(translate("%s"), $time));
- $time-- or Gtk2->main_quit;
+ $time-- or Gtk3->main_quit;
1;
});
eval { #- eval it so that missing pixmap will not break the test completely
my $root = gtkroot();
- my $gc = Gtk2::Gdk::GC->new($root);
- my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png");
+ my $gc = Gtk3::Gdk::GC->new($root);
+ my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file("$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png");
my ($w, $h) = ($pixbuf->get_width, $pixbuf->get_height);
- my $pixmap = Gtk2::Gdk::Pixmap->new($root, $w, $h, $root->get_depth);
+ my $pixmap = Gtk3::Gdk::Pixmap->new($root, $w, $h, $root->get_depth);
$pixbuf->render_to_drawable($pixmap, $gc, 0, 0, 0, 0, $w, $h, 'none', 0, 0);
$root->set_back_pixmap($pixmap, 0);
$root->clear;
diff --git a/lib/mouse.pm b/lib/mouse.pm
index a01924b..5112692 100644
--- a/lib/mouse.pm
+++ b/lib/mouse.pm
@@ -483,22 +483,22 @@ sub change_mouse_live {
sub test_mouse_install {
my ($mouse, $x_protocol_changed) = @_;
- require ugtk2;
- ugtk2->import(qw(:wrappers :create));
- my $w = ugtk2->new(N("Testing the mouse"), disallow_big_help => 1);
- my $darea = Gtk2::DrawingArea->new;
+ require ugtk3;
+ ugtk3->import(qw(:wrappers :create));
+ my $w = ugtk3->new(N("Testing the mouse"), disallow_big_help => 1);
+ my $darea = Gtk3::DrawingArea->new;
$darea->set_events([ 'button_press_mask', 'button_release_mask' ]); #$darea must be unrealized.
gtkadd($w->{window},
- gtkpack(my $vbox_grab = Gtk2::VBox->new(0, 0),
+ gtkpack(my $vbox_grab = Gtk3::VBox->new(0, 0),
$darea,
gtkset_sensitive(create_okcancel($w, undef, '', 'edge'), 1)
),
);
test_mouse($mouse, $darea, $x_protocol_changed);
$w->sync; # HACK
- Gtk2::Gdk->pointer_grab($vbox_grab->window, 1, 'pointer_motion_mask', $vbox_grab->window, undef, 0);
+ Gtk3::Gdk->pointer_grab($vbox_grab->window, 1, 'pointer_motion_mask', $vbox_grab->window, undef, 0);
my $r = $w->main;
- Gtk2::Gdk->pointer_ungrab(0);
+ Gtk3::Gdk->pointer_ungrab(0);
$r;
}
@@ -565,8 +565,8 @@ sub select {
sub test_mouse {
my ($mouse, $darea, $b_x_protocol_changed) = @_;
- require ugtk2;
- ugtk2->import(qw(:wrappers));
+ require ugtk3;
+ ugtk3->import(qw(:wrappers));
my $suffix = $mouse->{nbuttons} <= 2 ? '2b' : $mouse->{nbuttons} == 3 ? '3b' : '3b+';
my %offsets = (mouse_2b_right => [ 93, 0 ], mouse_3b_right => [ 117, 0 ],
mouse_2b_middle => [ 82, 80 ], mouse_3b_middle => [ 68, 0 ], 'mouse_3b+_middle' => [ 85, 67 ]);
@@ -577,7 +577,7 @@ sub test_mouse {
if_($mouse->{nbuttons} > 2, middle => 'mouse_' . $suffix . '_middle'),
up => 'arrow_up',
down => 'arrow_down');
- my %images = map { $_ => ugtk2::gtkcreate_pixbuf("$image_files{$_}.png") } keys %image_files;
+ my %images = map { $_ => ugtk3::gtkcreate_pixbuf("$image_files{$_}.png") } keys %image_files;
my $width = $images{mouse}->get_width;
my $height = round_up($images{mouse}->get_height, 6);
diff --git a/tools/keyboarddrake b/tools/keyboarddrake
index f15fd21..8421406 100755
--- a/tools/keyboarddrake
+++ b/tools/keyboarddrake
@@ -24,7 +24,7 @@ if (my ($kb) = grep { !/^-/ } @ARGV) {
keyboard::write($keyboard);
exit 0;
} else {
- $ugtk2::wm_icon = "/usr/share/mcc/themes/default/keyboard-mdk.png";
+ $ugtk3::wm_icon = "/usr/share/mcc/themes/default/keyboard-mdk.png";
$in = 'interactive'->vnew('su');
my ($xkb_models, $model2text) = keyboard::xkb_models();
diff --git a/tools/mousedrake b/tools/mousedrake
index a583044..679c512 100755
--- a/tools/mousedrake
+++ b/tools/mousedrake
@@ -14,7 +14,7 @@ use mouse;
use c;
-$ugtk2::wm_icon = "/usr/share/mcc/themes/default/mousedrake-mdk.png";
+$ugtk3::wm_icon = "/usr/share/mcc/themes/default/mousedrake-mdk.png";
my $in = 'interactive'->vnew('su');
my $modules_conf = modules::any_conf->read;