Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2009, 07:49 PM   #106
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by hansel View Post
Hi,

I just upgraded the package for Lgob: the Lua binding for GTK+, Glib, GDK and Pango. This version has (probably) less bugs and more features Thanks again to Lucas Hermann Negri for this great Lua binding!

The new version can be downloaded here: https://dev.mobileread.com/dist/hans...liad-0.1.9.ipk. This version is based on the sources at http://downloads.tuxfamily.org/oproj...9.11.1.tar.bz2
Hello,

As fast test, I've noted a crash with this new lgob-iliad release:

Code:
root@ereader:/media/card/Programs/Toolbox$ lua _files/Toolbox.lua  | ./_files/xx  -p
   0.001: ./_files/xx: started (debug=0, forward=1)
lua: _files/modules/sysinfo.lua:265: The GObject doesn't have the property sort_column_id!
stack traceback:
	[C]: in function 'set_sort_column_id'
	_files/modules/sysinfo.lua:265: in function 'ui_init'
	_files/modules/sysinfo.lua:357: in main chunk
	[C]: in function 'dofile'
	_files/Toolbox.lua:60: in function <_files/Toolbox.lua:60>
	[C]: in function 'main'
	_files/Toolbox.lua:87: in main chunk
	[C]: ?
  53.046: ./_files/xx: Done
The mentioned line shows:
Code:
col:set_sort_column_id(i-1)
while "col" is defined as:
Code:
local col = gtk.TreeViewColumn.new_with_attributes(coldef[1], coldef[2], "text", i-1)
It worked in v0.1.8.

EDIT: just discovered that examples/Navigator.lua also has this problem, so the regression comes from lgob-0.11.1.

Thanks,
Iņigo

Last edited by Iņigo; 11-08-2009 at 07:54 PM.
Iņigo is offline   Reply With Quote
Old 11-09-2009, 05:42 PM   #107
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by Iņigo View Post
Hello,

As fast test, I've noted a crash with this new lgob-iliad release:
Thanks for the report an the details. I mailed Lucas, and wil post a new release when the bug is solved. Please revert to the previous ipk until then...
For this you may need to uninstall the new version first (with the command ipkg remove lua5.1-iliad lgob-iliad): just installing the old version with ipkg will not work because of the lower version number)
hansel is offline   Reply With Quote
Advert
Old 11-09-2009, 10:55 PM   #108
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Can I use pipe in Lua script?

I want to write a lua script which calls a command and redirect the output of that command back to lua script. In C, I use FILE *p = popen(). I wonder if I can do the same thing easily in lua script. Thanx for help.
ericshliao is offline   Reply With Quote
Old 11-10-2009, 04:14 AM   #109
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by ericshliao View Post
In C, I use FILE *p = popen(). I wonder...
It's called io.popen()
Code:
  local f = io.popen("ls -l")        -- runs command
  local buf = f:read("*a")          -- read output of command
  f:close()
  print(buf)
hansel is offline   Reply With Quote
Old 11-10-2009, 01:17 PM   #110
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Quote:
Originally Posted by hansel View Post
It's called io.popen()
Code:
  local f = io.popen("ls -l")        -- runs command
  local buf = f:read("*a")          -- read output of command
  f:close()
  print(buf)
Thanx. I find io.popen() now. I looked for them in the wrong section.

added:
another question:
how do I get the size of buf?

added 2:
I am trying using the length operator #.

Last edited by ericshliao; 11-10-2009 at 01:38 PM.
ericshliao is offline   Reply With Quote
Advert
Old 11-10-2009, 03:38 PM   #111
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
gdk_pixbuf_loader_write() not available in lgob?

It's quite strange. I can't call gdk_pixbuf_loader_write using the form:
Code:
local gpldr = gdk.PixbufLoader.new()	
local success = gdk.PixbufLoader.write(gpldr, file_buf, ret, nil)
or
Code:
local gpldr = gdk.PixbufLoader.new()	
local success = gpldr:write(file_buf, ret, nil)
So I checked with Navigator.lua and pixbuf.def and found it strange (as the attached image). In pixbuf.def, there is an entry for gdk_pixbuf_loader_write(), but not listed on Navigator.lua.
Attached Thumbnails
Click image for larger version

Name:	Debian5-2009-11-11-03-32-32.png
Views:	378
Size:	171.1 KB
ID:	38811  
ericshliao is offline   Reply With Quote
Old 11-11-2009, 02:59 AM   #112
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Post

Quote:
Originally Posted by ericshliao View Post
So I checked with Navigator.lua and pixbuf.def and found it strange (as the attached image). In pixbuf.def, there is an entry for gdk_pixbuf_loader_write(), but not listed on Navigator.lua.
When building lgob, the log file (./lgob-9.09/gdk/log) shows that gdk_pixbuf_loader_write() is not handled (no code is generated)

This is (probably) because of the second parameter

Code:
defFunction('gdk_pixbuf_loader_write',
        {
                class = 'GdkPixbufLoader',
                since = '0.1',
                args = {'GObject* none', 'unhandled none', 'gsize none', 'GError** full'},
                ret = 'boolean none'
        }
)
This is (probably) caused by the fact that lgob's code generator does not understand the corresponding type (yet)

Code:
gboolean  gdk_pixbuf_loader_write  (
  GdkPixbufLoader *loader,
  const guchar *buf,
  gsize count,
  GError **error);
I'll check this with Lgob's author...

Edit: I just got a replay form Lucas: The analyse was correct, it will be fixed soon in a Lgob update. Il update the Iliad package after that...

Last edited by hansel; 11-11-2009 at 02:12 PM.
hansel is offline   Reply With Quote
Old 11-11-2009, 01:38 PM   #113
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Post

Quote:
Originally Posted by ericshliao View Post
another question:
how do I get the size of buf?
I am trying using the length operator #.
The # operator or string.len() probably both do what you want. Beware that these do not stop on '\0'...

Code:
> a='xxx\0yyy'
> print(a)
xxx
> print(#a)
7
> print(string.len(a))
7
hansel is offline   Reply With Quote
Old 11-14-2009, 02:26 PM   #114
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Update: lgob-iliad-0.1.11.ipk

I've just build a new version of lgob-iliad: lgob-iliad-0.1.11.ipk. It can be downloaded at: https://dev.mobileread.com/dist/hans...iad-0.1.11.ipk

It (should) solve the issues with gtk.TreeViewColumn.set_sort_column_id() [see message 106] and gdk.PixbufLoader.write() [see message 111]

This build is based on lgob-9.11.2

As always: feedback is welcome...
hansel is offline   Reply With Quote
Old 11-14-2009, 04:12 PM   #115
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
I just tried lgob9.11.2 on Debian5. When I execute a example, I got the following error message:
Quote:
iliaddev@Vigor8:/tmp/lgob-9.11.2/examples$ lua Viewport.lua
lua: [string "glib.handle_log('Gtk')"]:1: attempt to call field 'handle_log' (a nil value)
stack traceback:
[string "glib.handle_log('Gtk')"]:1: in main chunk
[C]: ?
[C]: in function 'require'
Viewport.lua:3: in main chunk
[C]: ?
ericshliao is offline   Reply With Quote
Old 11-14-2009, 06:19 PM   #116
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by ericshliao View Post
I just tried lgob9.11.2 on Debian5. When I execute a example, I got the following error message:
It works for me: Ubuntu, GOBJECT=2.20.1, GDK=2.16.1, PANGO=1.24.1, GTK=2.16.1

You didn't forget make install, did you?
hansel is offline   Reply With Quote
Old 11-14-2009, 10:33 PM   #117
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Quote:
Originally Posted by hansel View Post
You didn't forget make install, did you?
I think that I did do a make install for each directory in lgob. In case I missed one, I repeated "make install" again. The error still exists.
ericshliao is offline   Reply With Quote
Old 11-15-2009, 01:58 AM   #118
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by ericshliao View Post
I think that I did do a make install for each directory in lgob. In case I missed one, I repeated "make install" again. The error still exists.
I looked at Lgob again, but I see no reason for a missing handle_log()?!?! It was changed since lgob-9.09, but there are no specific version dependencies for this function...
  • It is implemented in gobject: can you see it in lgob-9.11.2/gobject/src/iface.c?
  • Maybe you have some older gobject.so somewhere in your Lua path (the default install goes to /usr/local/lib/lua/5.1/lgob/gobject.so)
  • Otherwise, you might have have to 'use the force'

Last edited by hansel; 11-15-2009 at 02:06 AM.
hansel is offline   Reply With Quote
Old 11-15-2009, 02:19 AM   #119
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Thanx.
The problem is solved.
I found old lgob libs in /usr/lib. After removing them, and doing "make install" again, the problem disappeared.
ericshliao is offline   Reply With Quote
Old 11-15-2009, 03:38 AM   #120
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
lgob-iliad0.1.11 is working on my iLiad. I put a experiement djvu viewer here: https://www.mobileread.com/forums/sho...67&postcount=2
ericshliao is offline   Reply With Quote
Reply

Tags
gtk+, iliad, lgob, lua, networking, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pandigital announce the black Novel Nate the great News 0 08-18-2010 06:21 PM
iLiad China iLiad users can get developer package. ericshliao iRex Developer's Corner 35 03-20-2010 06:21 AM
iLiad Announce: Glade4Lua, develop graphical apps for the Iliad hansel iRex Developer's Corner 1 10-27-2009 06:00 PM
Sony to announce colour e-book ? markiehill News 11 08-22-2009 01:45 PM
Proud to announce our new moderator! Alexander Turcic Announcements 5 12-09-2003 12:18 AM


All times are GMT -4. The time now is 12:55 AM.


MobileRead.com is a privately owned, operated and funded community.