summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.perl_checker401logstatsplain
-rw-r--r--ChangeLog1206398logstatsplain
-rw-r--r--MANIFEST14882logstatsplain
-rw-r--r--778logstatsplain
-rw-r--r--META.yml414logstatsplain
-rw-r--r--Makefile.PL5223logstatsplain
-rw-r--r--NEWS49050logstatsplain
-rw-r--r--README.transifex314logstatsplain
-rw-r--r--README.zeroconf1404logstatsplain
-rwxr-xr-xgurpmi3717logstatsplain
-rw-r--r--gurpmi.desktop.in260logstatsplain
-rw-r--r--gurpmi.pm4870logstatsplain
-rwxr-xr-xgurpmi215204logstatsplain
-rw-r--r--inst.list87logstatsplain
d---------po2384logstatsplain
d---------pod600logstatsplain
-rw-r--r--rpm-find-leaves1180logstatsplain
-rw-r--r--rurpme623logstatsplain
-rw-r--r--rurpmi659logstatsplain
-rw-r--r--skip.list134logstatsplain
d---------t2393logstatsplain
-rw-r--r--urpm.pm14759logstatsplain
d---------urpm1141logstatsplain
-rwxr-xr-xurpme6882logstatsplain
-rwxr-xr-xurpmf11526logstatsplain
-rwxr-xr-xurpmi27838logstatsplain
-rw-r--r--urpmi-repository-http.service469logstatsplain
-rwxr-xr-xurpmi.addmedia7257logstatsplain
-rw-r--r--urpmi.bash-completion7407logstatsplain
-rwxr-xr-xurpmi.removemedia2539logstatsplain
-rw-r--r--urpmi.schema4309logstatsplain
-rwxr-xr-xurpmi.update4298logstatsplain
-rwxr-xr-xurpmq22394logstatsplain
>, X => 800, Y => 600, Depth => 15 }, { bios => 790, X => 1024, Y => 768, Depth => 15 }, { bios => 793, X => 1280, Y => 1024, Depth => 15 }, { bios => 785, X => 640, Y => 480, Depth => 16 }, { bios => 788, X => 800, Y => 600, Depth => 16 }, { bios => 791, X => 1024, Y => 768, Depth => 16 }, { bios => 794, X => 1280, Y => 1024, Depth => 16 }, ); sub from_bios { my ($bios) = @_; find { $_->{bios} == $bios } @bios_vga_modes; } sub size2default_resolution { my ($size) = @_; #- size in inch if (arch() =~ /ppc/) { require detect_devices; return "1024x768" if detect_devices::get_mac_model() =~ /^PowerBook|^iMac/; } my %monitorSize2resolution = ( 13 => "640x480", 14 => "800x600", 15 => "800x600", 16 => "1024x768", 17 => "1024x768", 18 => "1024x768", 19 => "1280x1024", 20 => "1280x1024", 21 => "1600x1200", 22 => "1600x1200", ); $monitorSize2resolution{round($size)} || ($size < 13 ? "640x480" : "1600x1200"); } sub to_string { my ($resolution) = @_; $resolution or return; $resolution->{X} ? sprintf("%sx%s %dbpp", @$resolution{'X', 'Y', 'Depth'}) : 'frame-buffer'; } sub allowed { my ($card) = @_; my ($prefered_depth, @depths, @resolutions, @resolution_and_depth); my $using_xf4 = Xconfig::card::using_xf4($card); if ($using_xf4 ? $card->{Driver} eq 'fbdev' : $card->{server} eq 'FBDev') { push @resolution_and_depth, grep { $_->{Depth} == 16 } @bios_vga_modes; } elsif ($using_xf4 && $card->{Driver} eq 'fglrx') { $prefered_depth = 24; push @depths, 24; } elsif ($using_xf4) { if ($card->{use_DRI_GLX}) { $prefered_depth = 16; push @depths, 16, 24; } if ($card->{BoardName} eq 'RIVA128') { @depths = qw(8 15 24) } #- X doesn't even start in 16bpp for RIVA128 } elsif ($card->{use_UTAH_GLX}) { $prefered_depth = 16; push @depths, 16; } else { if ($card->{server} eq 'Sun24') { push @depths, 24, 8, 2 } elsif ($card->{server} eq 'Sun') { push @depths, 8, 2 } elsif ($card->{server} eq 'SunMono') { push @depths, 2 } elsif ($card->{server} eq 'VGA16') { push @depths, 8; push @resolutions, '640x480' } elsif ($card->{BoardName} =~ /SiS/) { push @depths, 24, 16, 8 } elsif ($card->{BoardName} eq 'S3 Trio3D') { push @depths, 24, 16, 8 } } if (!@resolution_and_depth || @depths || @resolutions) { @depths = grep { !($using_xf4 && /32/) } (our @depths_available) if !@depths; @resolutions = @Xconfig::xfreeX::resolutions if !@resolutions; push @resolution_and_depth, map { my $Depth = $_; map { m/(\d+)x(\d+)/ && { X => $1, Y => $2, Depth => $Depth } } @resolutions; } @depths; } $prefered_depth, @resolution_and_depth; } # ($card->{VideoRam} || ($card->{server} eq 'FBDev' ? 2048 : 32768)) sub filter_using_VideoRam { my ($VideoRam, @resolutions) = @_; my $mem = 1024 * $VideoRam; grep { $_->{X} * $_->{Y} * $_->{Depth}/8 <= $mem } @resolutions; } sub filter_using_HorizSync { my ($HorizSync, @resolutions) = @_; my $hsync = max(split(/[,-]/, $HorizSync)); grep { ($min_hsync4x_res{$_->{X}} || 0) <= $hsync } @resolutions; } sub choose { my ($in, $default_resolution, @resolutions) = @_; my $resolution = $default_resolution || {}; $in->ask_from(N("Resolutions"), "", [ { val => \$resolution, type => 'list', sort => 0, list => [ sort { $a->{X} <=> $b->{X} } @resolutions ], format => sub { "$_[0]{X}x$_[0]{Y} $_[0]{Depth}bpp" }, } ]) or return; $resolution; } sub choices { my ($_raw_X, $resolution_wanted, $card, $monitor) = @_; $resolution_wanted ||= {}; my ($prefered_depth, @resolutions) = allowed($card); @resolutions = filter_using_HorizSync($monitor->{HorizSync}, @resolutions) if $monitor->{HorizSync}; @resolutions = filter_using_VideoRam($card->{VideoRam}, @resolutions) if $card->{VideoRam}; my $x_res = do { my $res = $resolution_wanted->{X} || ($monitor->{ModelName} =~ /^Flat Panel (\d+x\d+)$/ ? $1 : size2default_resolution($monitor->{size} || 14)); my $x_res = first(split 'x', $res); #- take the first available resolution <= the wanted resolution max map { if_($_->{X} <= $x_res, $_->{X}) } @resolutions; }; my @matching = grep { $_->{X} eq $x_res } @resolutions; my @Depths = map { $_->{Depth} } @matching; my $Depth = $resolution_wanted->{Depth}; $Depth = $prefered_depth if !$Depth || !member($Depth, @Depths); $Depth = max(@Depths) if !$Depth || !member($Depth, @Depths); #- finding it in @resolutions (well @matching) #- (that way, we check it exists, and we get field "bios" for fbdev) my @default_resolutions = sort { $b->{Y} <=> $a->{Y} } grep { $_->{Depth} eq $Depth } @matching; my $default_resolution = (find { $resolution_wanted->{Y} eq $_->{Y} } @default_resolutions) || $default_resolutions[0]; $default_resolution, @resolutions; } sub configure { my ($in, $raw_X, $card, $monitor, $b_auto) = @_; my ($default_resolution, @resolutions) = choices($raw_X, $raw_X->get_resolution, $card, $monitor); if ($b_auto) { #- use $default_resolution if (Xconfig::card::using_xf4($card) && $card->{Driver} eq 'fglrx') { $default_resolution = first(find { $default_resolution->{Y} eq $_->{Y} && $_->{Depth} == 24 } $default_resolution, @resolutions); $default_resolution ||= first(find { $_->{Depth} == 24 } $default_resolution, @resolutions); } } elsif ($in->isa('interactive::gtk')) { $default_resolution = choose_gtk($in, $card, $default_resolution, @resolutions) or return; } else { $default_resolution = choose($in, $default_resolution, @resolutions) or return; } $raw_X->set_resolution($default_resolution); $default_resolution; } sub configure_auto_install { my ($raw_X, $card, $monitor, $old_X) = @_; my $resolution_wanted = { X => $old_X->{resolution_wanted}, Depth => $old_X->{default_depth} }; my ($default_resolution) = choices($raw_X, $resolution_wanted, $card, $monitor); $default_resolution or die "you selected an unusable depth"; $raw_X->set_resolution($default_resolution); $default_resolution; } sub choose_gtk { my ($in, $card, $default_resolution, @resolutions) = @_; my ($chosen_x_res, $chosen_y_res, $chosen_Depth) = @$default_resolution{'X', 'Y', 'Depth'}; $chosen_x_res ||= 640; my %x_res2depth; push @{$x_res2depth{$_->{X}}}, $_->{Depth} foreach @resolutions; my %depth2x_res; push @{$depth2x_res{$_->{Depth}}}, $_->{X} foreach @resolutions; require ugtk2;