Author Topic: Trying To Compile Mb-applet-blanker.c  (Read 3126 times)

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« on: January 30, 2007, 01:31:19 pm »
Hello,

I'm trying to compile the mb-applet-blanker sources (tried v0.6.1 and 0.2) from http://mail.pdaxrom.org/download/1.1.0beta3/src/ using Meanie's zgcc 3.4.5 image (i.e. onboard).

I get an error:

Code: [Select]
mb-applet-blanker.c:616: error: conflicting types for 'resize_callback'
The type in the .c file is void.
The type in some .h files in the devel image is XtCallbackList.
Using that type in the source code gave a syntax error.
I tried "int" instead: It compiled then, but when linking,
ld reported "Couldn't find -lapm", although apm libs are installed, and apm.h is available and included.


Does anyone have ideas how to solve these two issues?

Thanks a lot
daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #1 on: January 30, 2007, 08:16:11 pm »
The resize_callback problem is simply that it is being called before it is defined in mb-applet-blanker.c. The compiler uses a default prototype (with return type int), which then conflicts with the real prototype when the function definition is reached.

There is a section near the top of the file with a bunch of function prototypes (starting with reap_children), add the prototype for resize_callback in there as well.

Code: [Select]
void resize_callback(MBTrayApp *app, int w, int h);
(I've done some serious reworking of mb-applet-blanker recently, I probably should complete and release it sometime...)

As for the apm problem - check the directory containing libapm.so. There should be the library proper as well as a couple of symlinks to it, i.e.

libapm.so (symlink)
libapm.so.1 (symlink)
libapm.so.1.0.0 (library)

Make sure the symlinks are present, create them otherwise.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #2 on: January 31, 2007, 04:34:16 am »
Thank you pelrun!
Sometimes solutions are so simple.
Indeed I had to create a symling in /usr/lib:
ln -s /libapm.so.1.0.0 libamp.so
and add the correct prototype. Now it compiles.


As to our changes:
Do they have anything to do with the changes meanie made for his blanker applet in pdaXii13?
Looking forward to your release!

I'm still not sure why it doesn't work properly. The xset calls look similar as in the lightnpower.py. But I didn't look into much detail yet.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #3 on: January 31, 2007, 07:18:35 pm »
My work has nothing to do with Meanie's; in fact I'm not even sure what his does

Blanker's current incarnation is schizophrenic - it doesn't play nice at all with the blanking code in lightnpower.py (and the battery applet!), and the remote functionality is quite broken - just holding down a button a little too long will hang the Z as it spawns tens of instances of xmms!

My changes remove the redundant blanking code (calling an updated lightnpower instead of fighting against it) and significantly improve the remote capability. So it's now more of a mb-applet-remote. Once it's done it'll be capable of controlling apps other than xmms, listen to remote/jogwheel/bluetooth phone menu, allow you to hold down buttons to get different functions, work while not blanked, and control xmms by API (so only one instance of xmms is ever running).

Development got derailed when I broke my 860 back in october; I have been a bit too busy recently to resume (and my remote doesn't yet work on my new 3100...)
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Trying To Compile Mb-applet-blanker.c
« Reply #4 on: January 31, 2007, 07:38:58 pm »
my mb-applet-blanker does several things:

1. it load the lightnpower settings when it starts up so uses those settings and is in sync with those settings
2. it calls xset-wrapper instead of xset, so you can override the calls. (when you call xset twice in the applet, only the first call succeeds, so calling the xset-wrapper instead, you can make the wrapper script call xset twice. xset-wrapper also disables xscreensaver when screensaver is disabled
3. the applet also resynches the settings with lightnpower when you unplug/plugin ac power, if the power/battery applet is running, it lets it reapply the lightnpower settings and just updates its internal flags, but if battery/power applet is not running, then the blanker applet will call lightnpower instead.
4. disabled the xmms control/remote keys since it spawns many instances of xmms which brings the Z down to a grinding halt.

I will upload the code when I get home. haven't been home for quite some time now
« Last Edit: January 31, 2007, 07:39:30 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #5 on: January 31, 2007, 09:41:07 pm »
Sounds like our projects are going in orthogonal directions, which is great.

Any plans to roll together your blanker applet and the battery applet? I've always been of the opinion the functionality belongs together...
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Trying To Compile Mb-applet-blanker.c
« Reply #6 on: January 31, 2007, 10:11:14 pm »
Quote
Sounds like our projects are going in orthogonal directions, which is great.

Any plans to roll together your blanker applet and the battery applet? I've always been of the opinion the functionality belongs together...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=153120\"][{POST_SNAPBACK}][/a][/div]

yeah, I have always wondered why most of the blanker functionality was actually there. it looks like all the new functionality just got all dumped into the blanker applet. it does seem logical to merge the blanker and the battery applet, but then what about the icons? i like the fact that the battery applet changes between AC and battery icon, and also I like the way the screensaver and suspend status is shown in the blanker applet. if it wasn't for these visual effects, i probably would have merged these two applets.

since i removed the xmms/remote functionality from my blanker applet, it would probably be a good idea for you to actually call your applet mb-applet-remote to avoid confusing others ...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #7 on: January 31, 2007, 11:42:46 pm »
call your applet mb-applet-remote to avoid confusing others

That was my plan.
« Last Edit: January 31, 2007, 11:43:18 pm by pelrun »
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Trying To Compile Mb-applet-blanker.c
« Reply #8 on: January 31, 2007, 11:55:15 pm »
Quote
call your applet mb-applet-remote to avoid confusing others

That was my plan.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=153142\"][{POST_SNAPBACK}][/a][/div]

great  looking forward to see what you come up with...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Trying To Compile Mb-applet-blanker.c
« Reply #9 on: February 01, 2007, 04:52:23 am »
Great that we talked about it  
So many valuable improvements - it would be great if you merged them together.


Regarsing the merge of power and blanker applet:
I agree that there should be two different icons for them.
But it would certainly be useful if we look at the interface between the two and optimize it.

Or - can't the applets be merged into one binary, which puts two icons on the panel? That way, developemtn would be easier and more straight-forward, but the user still has two seperate icons, making it more convenient to see / work with them.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Trying To Compile Mb-applet-blanker.c
« Reply #10 on: February 01, 2007, 08:36:13 am »
Quote
Great that we talked about it   
So many valuable improvements - it would be great if you merged them together.


Regarsing the merge of power and blanker applet:
I agree that there should be two different icons for them.
But it would certainly be useful if we look at the interface between the two and optimize it.

Or - can't the applets be merged into one binary, which puts two icons on the panel? That way, developemtn would be easier and more straight-forward, but the user still has two seperate icons, making it more convenient to see / work with them.

daniel
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

well, here is the current sources for the applet:
[a href=\"http://zaurus.daemons.gr/menaie/build/hacks/mb-applet-blanker/mb-applet-blanker.c]http://zaurus.daemons.gr/menaie/build/hack...pplet-blanker.c[/url]
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K