~bratsche/ubuntu/maverick/gtk+2.0/menu-activation-fix

« back to all changes in this revision

Viewing changes to gdk-pixbuf/gen-color-table.pl

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-07-22 21:41:30 UTC
  • mfrom: (1.11.7 upstream) (72.1.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20100722214130-5uzyvpb9g4m0ts2c
Tags: 2.21.5-1ubuntu1
* Merge with Debian experimental, Ubuntu changes:
* debian/control.in:
  - Add introspection build-depends
  - Add Vcs-Bzr link
  - Add gir1.0-gtk-2.0 package
  - libgtk2.0-dev replaces gir-repository-dev
  - Conflict with appmenu-gtk (<< 0.1.3) to prevent menu proxy breakage
* debian/rules:
  - Build with --enable-introspection
  - Add gir1.0-gtk-2.0 package to BINARY_ARCH_PKGS
  - Add dh_girepository call
  - Disable devhelp files
* debian/dh_gtkmodules.in:
  - Remove obsolete script content
* debian/libgtk2.0-0.symbols:
  - Add Ubuntu specific symbols
* debian/libgtk2.0-dev.install.in:
  - Add gir files
* debian/libgtk2.0-doc.install.in
  - Disable devhelp files
* debian/gir1.0-gtk-2.0.install.in
  - Introspection package
* debian/patches/043_menu_proxy.patch
  - Add GtkMenuProxy support for remoting menus.
* debian/patches/062_dnd_menubar.patch:
  - Allow click on menubars for dnd
* debian/patches/063_treeview_almost_fixed.patch:
  - Add an ubuntu-almost-fixed-height-mode property, (required for
    software-center)
* debian/patches/071_no_offscreen_widgets_grabbing.patch:
  - Don't let offscreen widgets do grabbing
* debian/patches/072_indicator_menu_update.patch:
  - change by Cody Russell to send an update event on menu changes,
    should make the bluetooth indicator refresh correctly
* debian/patches/091_bugzilla_tooltip_refresh.patch:
  - Upstream bugzilla change to have better looking tooltips the gtk theme
    need to set "new-tooltip-style" to use those
* debian/watch:
  - Watch for unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
 
3
 
if (@ARGV != 1) {
4
 
    die "Usage: gen-color-table.pl rgb.txt > xpm-color-table.h\n";
5
 
}
6
 
 
7
 
open IN, $ARGV[0] || die "Cannot open $ARGV[0]: $!\n";
8
 
 
9
 
@colors = ();
10
 
while (defined($_ = <IN>)) {
11
 
    next if /^!/;
12
 
    if (!/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+(.*\S)\s+$/) {
13
 
        die "Cannot parse line $_";
14
 
    }
15
 
 
16
 
    push @colors, [$1, $2, $3, $4];
17
 
}
18
 
 
19
 
@colors = sort { lc($a->[3]) cmp lc($b->[3]) } @colors;
20
 
 
21
 
$offset = 0;
22
 
 
23
 
$date = gmtime;
24
 
 
25
 
print <<EOT;
26
 
/* xpm-color-table.h: Generated by gen-color-table.pl from rgb.txt
27
 
 *
28
 
 *  Date: $date
29
 
 *
30
 
 * Do not edit.   
31
 
 */
32
 
static const char color_names[] =
33
 
EOT
34
 
 
35
 
for $color (@colors) {
36
 
    $name = $color->[3];
37
 
 
38
 
    if ($offset != 0) {
39
 
        print qq(\n);
40
 
    }
41
 
    print qq(  "$name\\0");
42
 
 
43
 
    $color->[4] = $offset;
44
 
    $offset += length($name) + 1;
45
 
}
46
 
 
47
 
print ";\n\n";
48
 
 
49
 
print <<EOT;
50
 
typedef struct {
51
 
    guint16 name_offset;
52
 
    guchar red;
53
 
    guchar green;
54
 
    guchar blue;
55
 
} XPMColorEntry;
56
 
 
57
 
static const XPMColorEntry xColors[] = {
58
 
EOT
59
 
 
60
 
$i = 0;
61
 
for $color (@colors) {
62
 
    $red = $color->[0];
63
 
    $green = $color->[1];
64
 
    $blue = $color->[2];
65
 
    $offset = $color->[4];
66
 
 
67
 
    if ($i != 0) {
68
 
        print ",\n";
69
 
    }
70
 
    print "  { $offset, $red, $green, $blue }";
71
 
    $i++;
72
 
}
73
 
 
74
 
print "\n};\n";