[prev in list] [next in list] [prev in thread] [next in thread]
List: openmoko-commitlog
Subject: commitlog Digest, Vol 660, Issue 1
From: commitlog-request () lists ! openmoko ! org
Date: 2008-10-19 1:58:36
Message-ID: mailman.4731.1224381728.19587.commitlog () lists ! openmoko ! org
[Download RAW message or body]
Send commitlog mailing list submissions to
commitlog@lists.openmoko.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
commitlog-request@lists.openmoko.org
You can reach the person managing the list at
commitlog-owner@lists.openmoko.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r4723 - in
trunk/src/target/OM-2007.2/applications/openmoko-terminal2: . src
(mickey@docs.openmoko.org)
2. r4724 - in developers/werner: . pmu (werner@docs.openmoko.org)
[Attachment #4 (multipart/digest)]
Content-Transfer-Encoding: 8bit
From: mickey@docs.openmoko.org
Precedence: list
To: commitlog@lists.openmoko.org
Date: Sat, 18 Oct 2008 17:01:16 +0200
Message-ID: <E1KrDIq-0002Y3-M7@docs.openmoko.com>
Content-Type: text/plain; charset=UTF-8
Subject: r4723 - in
trunk/src/target/OM-2007.2/applications/openmoko-terminal2: . src
Message: 1
Author: mickey
Date: 2008-10-18 17:01:15 +0200 (Sat, 18 Oct 2008)
New Revision: 4723
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/Makefile.am
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
Log:
openmoko-terminal2: update to vala 0.3.5
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/Makefile.am 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/Makefile.am 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -27,7 +27,7 @@
$(NULL)
src/openmoko-terminal2.vala.stamp: $(openmoko_terminal2_VALASOURCES)
- $(VALAC) --pkg vte --basedir $(top_srcdir) $^
+ $(VALAC) --pkg vte --save-temps --basedir $(top_srcdir) $^
touch $@
openmoko_terminal2_LDADD = \
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-extract.in 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -32,7 +32,7 @@
## Release information
my $PROGRAM = "intltool-extract";
my $PACKAGE = "intltool";
-my $VERSION = "0.36.2";
+my $VERSION = "0.37.0";
## Loaded modules
use strict;
@@ -161,7 +161,8 @@
--type=TYPE Specify the file type of FILENAME. Currently supports:
"gettext/glade", "gettext/ini", "gettext/keys"
"gettext/rfc822deb", "gettext/schemas",
- "gettext/scheme", "gettext/xml", "gettext/quoted"
+ "gettext/scheme", "gettext/xml", "gettext/quoted",
+ "gettext/quotedxml"
-l, --local Writes output into current working directory
(conflicts with --update)
--update Writes output into the same directory the source file
@@ -218,6 +219,7 @@
&type_schemas if $gettext_type eq "schemas";
&type_rfc822deb if $gettext_type eq "rfc822deb";
&type_quoted if $gettext_type eq "quoted";
+ &type_quotedxml if $gettext_type eq "quotedxml";
}
sub entity_decode_minimal
@@ -731,6 +733,18 @@
}
}
+sub type_quotedxml {
+ while ($input =~ /\"(([^\"]|\\\")*[^\\\"])\"/g) {
+ my $message = $1;
+ my $before = $`;
+ $message =~ s/\\\"/\"/g;
+ $message = entity_decode($message);
+ $before =~ s/[^\n]//g;
+ $messages{$message} = [];
+ $loc{$message} = length ($before) + 2;
+ }
+}
+
sub type_glade {
### For translatable Glade XML files ###
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-merge.in 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -35,7 +35,7 @@
## Release information
my $PROGRAM = "intltool-merge";
my $PACKAGE = "intltool";
-my $VERSION = "0.36.2";
+my $VERSION = "0.37.0";
## Loaded modules
use strict;
@@ -61,6 +61,7 @@
my $SCHEMAS_STYLE_ARG = 0;
my $RFC822DEB_STYLE_ARG = 0;
my $QUOTED_STYLE_ARG = 0;
+my $QUOTEDXML_STYLE_ARG = 0;
my $QUIET_ARG = 0;
my $PASS_THROUGH_ARG = 0;
my $UTF8_ARG = 0;
@@ -81,6 +82,7 @@
"schemas-style|s" => \$SCHEMAS_STYLE_ARG,
"rfc822deb-style|r" => \$RFC822DEB_STYLE_ARG,
"quoted-style" => \$QUOTED_STYLE_ARG,
+ "quotedxml-style" => \$QUOTEDXML_STYLE_ARG,
"pass-through|p" => \$PASS_THROUGH_ARG,
"utf8|u" => \$UTF8_ARG,
"multiple-output|m" => \$MULTIPLE_OUTPUT,
@@ -148,7 +150,7 @@
&utf8_sanity_check;
&preparation;
&print_message;
- &keys_merge_translations;
+ &keys_merge_translations;
&finalize;
}
elsif ($DESKTOP_STYLE_ARG && @ARGV > 2)
@@ -174,12 +176,12 @@
&rfc822deb_merge_translations;
&finalize;
}
-elsif ($QUOTED_STYLE_ARG && @ARGV > 2)
+elsif (($QUOTED_STYLE_ARG || $QUOTEDXML_STYLE_ARG) && @ARGV > 2)
{
&utf8_sanity_check;
&preparation;
&print_message;
- "ed_merge_translations;
+ "ed_merge_translations($QUOTEDXML_STYLE_ARG);
&finalize;
}
else
@@ -219,6 +221,7 @@
-s, --schemas-style includes translations in the schemas style
-r, --rfc822deb-style includes translations in the RFC822 style
--quoted-style includes translations in the quoted string style
+ --quotedxml-style includes translations in the quoted xml string style
-x, --xml-style includes translations in the standard xml style
Other options:
@@ -292,10 +295,9 @@
{
next if /^#/;
- if (/([-a-zA-Z_@.]+)\n/)
+ for my $lang (split)
{
- my $lang = $1;
-
+ chomp ($lang);
my $po_file = $PO_DIR . "/" . $lang . ".po";
if (-e $po_file) {
$po_files_by_lang{$lang} = $po_file;
@@ -576,6 +578,7 @@
return "&" if $_ == 38;
return "'" if $_ == 39;
return "<" if $_ == 60;
+ return ">" if $_ == 62;
return chr $_;
}
@@ -1076,43 +1079,74 @@
close OUTPUT;
print "CREATED $lang/$OUTFILE\n" unless $QUIET_ARG;
}
- }
- open OUTPUT, ">$OUTFILE" or die "Cannot open $OUTFILE: $!\n";
- binmode (OUTPUT) if $^O eq 'MSWin32';
- my $tree = readXml($FILE);
- print_header($FILE, \*OUTPUT);
- parseTree(\*OUTPUT, $tree);
- close OUTPUT;
- print "CREATED $OUTFILE\n" unless $QUIET_ARG;
+ if ( ! -d "C" ) {
+ mkdir "C" or -d "C" or die "Cannot create subdirectory C: $!\n";
+ }
+ open OUTPUT, ">C/$OUTFILE" or die "Cannot open C/$OUTFILE: $!\n";
+ binmode (OUTPUT) if $^O eq 'MSWin32';
+ my $tree = readXml($FILE);
+ print_header($FILE, \*OUTPUT);
+ parseTree(\*OUTPUT, $tree);
+ close OUTPUT;
+ print "CREATED C/$OUTFILE\n" unless $QUIET_ARG;
+ } else {
+ open OUTPUT, ">$OUTFILE" or die "Cannot open $OUTFILE: $!\n";
+ binmode (OUTPUT) if $^O eq 'MSWin32';
+ my $tree = readXml($FILE);
+ print_header($FILE, \*OUTPUT);
+ parseTree(\*OUTPUT, $tree);
+ close OUTPUT;
+ print "CREATED $OUTFILE\n" unless $QUIET_ARG;
+ }
}
-sub keys_merge_translations
+sub keys_merge_translation
{
- open INPUT, "<${FILE}" or die;
- open OUTPUT, ">${OUTFILE}" or die;
+ my ($lang) = @_;
+
+ if ( ! -d $lang && $MULTIPLE_OUTPUT)
+ {
+ mkdir $lang or -d $lang or die "Cannot create subdirectory $lang: $!\n";
+ }
+
+ open INPUT, "<${FILE}" or die "Cannot open ${FILE}: $!\n";
+ open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
binmode (OUTPUT) if $^O eq 'MSWin32';
- while (<INPUT>)
+ while (<INPUT>)
{
- if (s/^(\s*)_(\w+=(.*))/$1$2/)
+ if (s/^(\s*)_(\w+=(.*))/$1$2/)
{
- my $string = $3;
+ my $string = $3;
- print OUTPUT;
+ if (!$MULTIPLE_OUTPUT)
+ {
+ print OUTPUT;
- my $non_translated_line = $_;
+ my $non_translated_line = $_;
- for my $lang (sort keys %po_files_by_lang)
+ for my $lang (sort keys %po_files_by_lang)
+ {
+ my $translation = $translations{$lang, $string};
+ next if !$translation;
+
+ $_ = $non_translated_line;
+ s/(\w+)=.*/[$lang]$1=$translation/;
+ print OUTPUT;
+ }
+ }
+ else
{
- my $translation = $translations{$lang, $string};
- next if !$translation;
+ my $non_translated_line = $_;
+ my $translation = $translations{$lang, $string};
+ $translation = $string if !$translation;
$_ = $non_translated_line;
- s/(\w+)=.*/[$lang]$1=$translation/;
+ s/(\w+)=.*/$1=$translation/;
print OUTPUT;
}
- }
- else
+ }
+ else
{
print OUTPUT;
}
@@ -1120,8 +1154,26 @@
close OUTPUT;
close INPUT;
+
+ print "CREATED $lang/$OUTFILE\n" unless $QUIET_ARG;
}
+sub keys_merge_translations
+{
+ if ($MULTIPLE_OUTPUT)
+ {
+ for my $lang (sort keys %po_files_by_lang)
+ {
+ keys_merge_translation ($lang);
+ }
+ keys_merge_translation ("C");
+ }
+ else
+ {
+ keys_merge_translation (".");
+ }
+}
+
sub desktop_merge_translations
{
open INPUT, "<${FILE}" or die;
@@ -1415,19 +1467,22 @@
sub quoted_translation
{
- my ($lang, $string) = @_;
+ my ($xml_mode, $lang, $string) = @_;
+ $string = entity_decode($string) if $xml_mode;
$string =~ s/\\\"/\"/g;
my $translation = $translations{$lang, $string};
$translation = $string if !$translation;
-
+ $translation = entity_encode($translation) if $xml_mode;
$translation =~ s/\"/\\\"/g;
return $translation
}
sub quoted_merge_translations
{
+ my ($xml_mode) = @_;
+
if (!$MULTIPLE_OUTPUT) {
print "Quoted only supports Multiple Output.\n";
exit(1);
@@ -1442,7 +1497,7 @@
binmode (OUTPUT) if $^O eq 'MSWin32';
while (<INPUT>)
{
- s/\"(([^\"]|\\\")*[^\\\"])\"/"\"" . "ed_translation($lang, $1) . \
"\""/ge; + s/\"(([^\"]|\\\")*[^\\\"])\"/"\"" . \
"ed_translation($xml_mode, $lang, $1) . "\""/ge; print OUTPUT;
}
close OUTPUT;
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/intltool-update.in 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -30,7 +30,7 @@
## Release information
my $PROGRAM = "intltool-update";
-my $VERSION = "0.36.2";
+my $VERSION = "0.37.0";
my $PACKAGE = "intltool";
## Loaded modules
@@ -334,7 +334,7 @@
push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/;
push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/;
push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/;
- }, "$SRCDIR/..";
+ }, "$SRCDIR/.." if "$SRCDIR" ne ".";
open POTFILES, $POTFILES_in or die "$PROGRAM: there's no POTFILES.in!\n";
@buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>;
@@ -434,8 +434,8 @@
last;
}
- ## N_ Q_ and _ are the three macros defined in gi8n.h
- if (/[NQ]?_ *\(QUOTEDTEXT/)
+ ## C_ N_ Q_ and _ are the macros defined in gi8n.h
+ if (/[CNQ]?_ *\(QUOTEDTEXT/)
{
if (defined isNotValidMissing (unpack("x3 A*", $file))) {
## Remove the first 3 chars and add newline
@@ -777,7 +777,7 @@
my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
push @xgettext_argument, $XGETTEXT_KEYWORDS;
my $MSGID_BUGS_ADDRESS = &FindMakevarsBugAddress;
- push @xgettext_argument, "--msgid-bugs-address\=$MSGID_BUGS_ADDRESS" if \
$MSGID_BUGS_ADDRESS; + push @xgettext_argument, \
"--msgid-bugs-address\=\"$MSGID_BUGS_ADDRESS\"" if \
$MSGID_BUGS_ADDRESS;
push @xgettext_argument, "--from-code\=$encoding" if \
($gettext_support_nonascii); push @xgettext_argument, $XGETTEXT_ARGS if \
$XGETTEXT_ARGS; my $xgettext_command = join ' ', @xgettext_argument;
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -52,8 +52,8 @@
setup_toolbar();
setup_notebook();
update_toolbar();
- idle_add( on_idle, this );
- idle_add( on_idle_first_command, this );
+ Idle.add( on_idle );
+ Idle.add( on_idle_first_command );
//window.add_filter( on_gdk_filter, this );
}
@@ -99,7 +99,7 @@
vbox.pack_start( notebook, true, true, 0 );
var terminal = new OpenMokoTerminal2.MokoTerminal();
- notebook.append_page( terminal, Image.from_stock( STOCK_INDEX, \
IconSize.LARGE_TOOLBAR ) ); + notebook.append_page( terminal, new \
Image.from_stock( STOCK_INDEX, IconSize.LARGE_TOOLBAR ) ); notebook.child_set \
(terminal, "tab-expand", true, null ); }
@@ -121,7 +121,7 @@
stdout.printf( "on_idle\n" );
notebook.switch_page += (o, page, num) => {
btn_delete.set_sensitive( notebook.get_n_pages() > 1 );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( \
(int)num ); btn_zoom_in.set_sensitive( terminal.get_font_size() < 10 ); + \
OpenMokoTerminal2.MokoTerminal terminal = (OpenMokoTerminal2.MokoTerminal) \
notebook.get_nth_page( (int)num ); btn_zoom_in.set_sensitive( \
terminal.get_font_size() < 10 ); btn_zoom_out.set_sensitive( \
terminal.get_font_size() > 1 ); };
notebook.page_removed += (o, page, num) => {
@@ -137,7 +137,7 @@
private bool on_idle_first_command()
{
stdout.printf( "on_idle_first_command\n" );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( 0 );
+ OpenMokoTerminal2.MokoTerminal terminal = (OpenMokoTerminal2.MokoTerminal) \
notebook.get_nth_page( 0 ); if ( initial_command != null )
terminal.paste_command( initial_command );
return false;
@@ -147,7 +147,7 @@
{
stdout.printf( "on_new_clicked\n" );
var terminal = new OpenMokoTerminal2.MokoTerminal();
- notebook.append_page( terminal, Image.from_stock( STOCK_INDEX, \
IconSize.LARGE_TOOLBAR ) ); + notebook.append_page( terminal, new \
Image.from_stock( STOCK_INDEX, IconSize.LARGE_TOOLBAR ) ); notebook.child_set \
(terminal, "tab-expand", true, null ); notebook.show_all();
update_toolbar();
@@ -164,7 +164,7 @@
private void on_zoom_in_clicked( Gtk.ToolButton b )
{
stdout.printf( "on_zoom_in_clicked\n" );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( \
notebook.get_current_page() ); + OpenMokoTerminal2.MokoTerminal terminal = \
(OpenMokoTerminal2.MokoTerminal) notebook.get_nth_page( notebook.get_current_page() \
); terminal.zoom_in();
update_toolbar();
}
@@ -172,7 +172,7 @@
private void on_zoom_out_clicked( Gtk.ToolButton b )
{
stdout.printf( "on_zoom_out_clicked\n" );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( \
notebook.get_current_page() ); + OpenMokoTerminal2.MokoTerminal terminal = \
(OpenMokoTerminal2.MokoTerminal) notebook.get_nth_page( notebook.get_current_page() \
); terminal.zoom_out();
update_toolbar();
}
@@ -180,7 +180,7 @@
private void on_paste_clicked( Gtk.ToolButton b )
{
stdout.printf( "on_paste_clicked\n" );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( \
notebook.get_current_page() ); + OpenMokoTerminal2.MokoTerminal terminal = \
(OpenMokoTerminal2.MokoTerminal) notebook.get_nth_page( notebook.get_current_page() \
); terminal.paste();
update_toolbar();
}
@@ -194,14 +194,15 @@
return;
}
btn_delete.set_sensitive( notebook.get_n_pages() > 1 );
- OpenMokoTerminal2.MokoTerminal terminal = notebook.get_nth_page( \
notebook.get_current_page() );
- stdout.printf( "current font size for terminal is %d\n", \
terminal.get_font_size() ); + OpenMokoTerminal2.MokoTerminal terminal = \
(OpenMokoTerminal2.MokoTerminal) notebook.get_nth_page( notebook.get_current_page() \
); + stdout.printf( "current font size for terminal is %u\n", \
terminal.get_font_size() ); btn_zoom_in.set_sensitive( terminal.get_font_size() < 10 \
); btn_zoom_out.set_sensitive( terminal.get_font_size() > 1 );
}
public void run()
{
+ // FIXME default focus needs to be on the terminal (in order to play nice \
with on-screen keyboards) show_all();
Gtk.main();
}
@@ -214,11 +215,13 @@
static int main (string[] args) {
try {
- Gtk.init_with_args(ref args.length, ref args, " - a lightweight terminal \
for the OpenMoko environment", options, null); + // FIXME revisit once \
http://bugzilla.gnome.org/show_bug.cgi?id=547135 got fixed + // \
Gtk.init_with_args( ref args, " - a lightweight terminal for the OpenMoko \
environment", options, "openmoko-terminal" ); + Gtk.init( ref args );
} catch (Error e)
{
stderr.printf("Error: %s\n", e.message);
- return 1;
+ return 1;
}
var window = new MainWindow();
Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala 2008-10-17 \
23:34:17 UTC (rev 4722)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala 2008-10-18 \
15:01:15 UTC (rev 4723) @@ -43,34 +43,34 @@
// auto-exit may become a preference at some point?
terminal.child_exited += term => { destroy(); };
terminal.eof += term => { destroy(); };
- terminal.window_title_changed += term => { Gtk.Window toplevel = \
get_toplevel(); toplevel.set_title( term.window_title ); }; + \
terminal.window_title_changed += term => { Gtk.Window toplevel = (Gtk.Window) \
get_toplevel(); toplevel.set_title( term.window_title ); }; pack_start( terminal, \
true, true, 0 );
scrollbar = new VScrollbar( terminal.adjustment );
pack_start( scrollbar, false, false, 0 );
- // yes, (ushort) is ugly. It's a vala bug and will go away soon
- var fore = new Gdk.Color() { pixel = 0, red = (ushort)0x0000, green = \
(ushort)0x0000, blue = (ushort)0x0000 };
- var back = new Gdk.Color() { pixel = 0, red = (ushort)0xffff, green = \
(ushort)0xffff, blue = (ushort)0xffff }; + var fore = Gdk.Color() { pixel = 0, \
red = 0x0000, green = 0x0000, blue = 0x0000 }; + var back = Gdk.Color() { \
pixel = 0, red = 0xffff, green = 0xffff, blue = 0xffff }; var colors = new \
Gdk.Color[] {
- new Gdk.Color() { pixel = 0, red = (ushort)0x0000, green = \
(ushort)0x0000, blue = (ushort)0x0000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x8000, green = \
(ushort)0x0000, blue = (ushort)0x0000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x0000, green = \
(ushort)0x8000, blue = (ushort)0x0000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x8000, green = \
(ushort)0x8000, blue = (ushort)0x0000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x0000, green = \
(ushort)0x0000, blue = (ushort)0x8000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x8000, green = \
(ushort)0x0000, blue = (ushort)0x8000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x0000, green = \
(ushort)0x8000, blue = (ushort)0x8000 },
- new Gdk.Color() { pixel = 0, red = (ushort)0x8000, green = \
(ushort)0x8000, blue = (ushort)0x8000 } + Gdk.Color() { pixel = 0, red = \
0x0000, green = 0x0000, blue = 0x0000 }, + Gdk.Color() { pixel = 0, red = \
0x8000, green = 0x0000, blue = 0x0000 }, + Gdk.Color() { pixel = 0, red = \
0x0000, green = 0x8000, blue = 0x0000 }, + Gdk.Color() { pixel = 0, red = \
0x8000, green = 0x8000, blue = 0x0000 }, + Gdk.Color() { pixel = 0, red = \
0x0000, green = 0x0000, blue = 0x8000 }, + Gdk.Color() { pixel = 0, red = \
0x8000, green = 0x0000, blue = 0x8000 }, + Gdk.Color() { pixel = 0, red = \
0x0000, green = 0x8000, blue = 0x8000 }, + Gdk.Color() { pixel = 0, red = \
0x8000, green = 0x8000, blue = 0x8000 } };
- terminal.set_colors( ref fore, ref back, ref colors[0], 8 );
+ terminal.set_colors( fore, back, colors );
update_font();
terminal.set_scrollback_lines( 1000 );
terminal.set_mouse_autohide( true );
terminal.set_cursor_blinks( true );
terminal.set_backspace_binding( TerminalEraseBinding.ASCII_DELETE);
- terminal.fork_command( null, null, null, Environment.get_variable( "HOME" ), \
true, true, true ); +
+ terminal.fork_command( "/bin/sh", new string[]{}, new string[]{}, \
Environment.get_variable( "HOME" ), true, true, true ); }
public uint get_font_size()
@@ -80,7 +80,7 @@
public void update_font()
{
- string font = "%s %d".printf( fontname, fontsize );
+ string font = "%s %u".printf( fontname, fontsize );
terminal.set_font_from_string_full( font, TerminalAntiAlias.FORCE_ENABLE );
}
Content-Transfer-Encoding: 8bit
From: werner@docs.openmoko.org
Precedence: list
To: commitlog@lists.openmoko.org
Date: Sun, 19 Oct 2008 03:58:02 +0200
Message-ID: <E1KrNYQ-00036i-1q@docs.openmoko.com>
Content-Type: text/plain; charset=UTF-8
Subject: r4724 - in developers/werner: . pmu
Message: 2
Author: werner
Date: 2008-10-19 03:58:00 +0200 (Sun, 19 Oct 2008)
New Revision: 4724
Added:
developers/werner/pmu/
developers/werner/pmu/Makefile
developers/werner/pmu/main.c
developers/werner/pmu/pmu.c
developers/werner/pmu/pmu.h
Log:
Utility to directly read/write PMU registers.
Added: developers/werner/pmu/Makefile
===================================================================
--- developers/werner/pmu/Makefile (rev 0)
+++ developers/werner/pmu/Makefile 2008-10-19 01:58:00 UTC (rev 4724)
@@ -0,0 +1,25 @@
+CC=arm-angstrom-linux-gnueabi-gcc
+
+CFLAGS=-Wall -Wshadow -g -O
+
+OBJS=main.o pmu.o
+
+.PHONY: all clean dep depend spotless
+
+all: pmu
+
+pmu: $(OBJS)
+
+dep depend:
+ $(CPP) $(CFLAGS) -MM -MG *.c >.depend || \
+ { rm -f .depend; exit 1; }
+
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif
+
+clean:
+ rm -f $(OBJS) .depend
+
+spotless: clean
+ rm -f pmu
Added: developers/werner/pmu/main.c
===================================================================
--- developers/werner/pmu/main.c (rev 0)
+++ developers/werner/pmu/main.c 2008-10-19 01:58:00 UTC (rev 4724)
@@ -0,0 +1,63 @@
+/*
+ * main.c - PMU command line processing
+ *
+ * Copyright (C) 2008 by OpenMoko, Inc.
+ * Written by Werner Almesberger <werner@openmoko.org>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "pmu.h"
+
+
+static void usage(const char *name)
+{
+ fprintf(stderr,
+ "usage: %s reg[=value] ...\n\n"
+ " Register address and values are in hex.\n", name);
+ exit(1);
+}
+
+
+static void do_arg(int pmu, const char *name, const char *arg)
+{
+ unsigned long reg, value;
+ char *end;
+
+ reg = strtoul(arg, &end, 16);
+ if (reg & ~0xffUL)
+ usage(name);
+ if (!*end) {
+ printf("0x%02x\n", pmu_read(pmu, reg));
+ return;
+ }
+ if (*end != '=')
+ usage(name);
+ value = strtoul(end+1, &end, 16);
+ if (*end)
+ usage(name);
+ if (value & ~0xffUL)
+ usage(name);
+ pmu_write(pmu, reg, value);
+}
+
+
+int main(int argc, char **argv)
+{
+ int pmu, i;
+
+ if (argc == 1)
+ usage(*argv);
+ pmu = pmu_open();
+ for (i = 1; i != argc; i++)
+ do_arg(pmu, argv[0], argv[i]);
+ return 0;
+}
Added: developers/werner/pmu/pmu.c
===================================================================
--- developers/werner/pmu/pmu.c (rev 0)
+++ developers/werner/pmu/pmu.c 2008-10-19 01:58:00 UTC (rev 4724)
@@ -0,0 +1,78 @@
+/*
+ * pmu.c - Read/write PMU registers
+ *
+ * Copyright (C) 2008 by OpenMoko, Inc.
+ * Written by Werner Almesberger <werner@openmoko.org>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-dev.h>
+
+#include "pmu.h"
+
+
+#define I2C_DEVICE "/dev/i2c-0"
+#define I2C_ADDRESS 0x73
+
+
+uint8_t pmu_read(int fd, uint8_t reg)
+{
+ uint8_t res;
+ struct i2c_smbus_ioctl_data msg = {
+ .read_write = I2C_SMBUS_READ,
+ .command = reg,
+ .size = I2C_SMBUS_BYTE_DATA,
+ .data = (void *) &res,
+ };
+
+ if (ioctl(fd, I2C_SMBUS, (void *) &msg) < 0) {
+ perror("ioctl(I2C_SMBUS)");
+ exit(1);
+ }
+ return res;
+}
+
+
+void pmu_write(int fd, uint8_t reg, uint8_t value)
+{
+ struct i2c_smbus_ioctl_data msg = {
+ .read_write = I2C_SMBUS_WRITE,
+ .command = reg,
+ .size = I2C_SMBUS_BYTE_DATA,
+ .data = (void *) &value,
+ };
+
+ if (ioctl(fd, I2C_SMBUS, (void *) &msg) < 0) {
+ perror("ioctl(I2C_SMBUS)");
+ exit(1);
+ }
+}
+
+
+int pmu_open(void)
+{
+ int fd;
+
+ fd = open(I2C_DEVICE, O_RDWR);
+ if (fd < 0) {
+ perror(I2C_DEVICE);
+ exit(1);
+ }
+ if (ioctl(fd, I2C_SLAVE_FORCE, I2C_ADDRESS) < 0) {
+ perror("ioctl(I2C_SLAVE_FORCE)");
+ exit(1);
+ }
+ return fd;
+}
Added: developers/werner/pmu/pmu.h
===================================================================
--- developers/werner/pmu/pmu.h (rev 0)
+++ developers/werner/pmu/pmu.h 2008-10-19 01:58:00 UTC (rev 4724)
@@ -0,0 +1,24 @@
+/*
+ * pmu.h - Read/write PMU registers
+ *
+ * Copyright (C) 2008 by OpenMoko, Inc.
+ * Written by Werner Almesberger <werner@openmoko.org>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef PMU_H
+#define PMU_H
+
+#include <stdint.h>
+
+
+uint8_t pmu_read(int fd, uint8_t reg);
+void pmu_write(int fd, uint8_t reg, uint8_t value);
+int pmu_open(void);
+
+#endif /* !PMU_H */
--===============1684249646==--
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic