OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: daniel3000 on January 30, 2007, 01:31:19 pm

Title: Trying To Compile Mb-applet-blanker.c
Post by: daniel3000 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/ (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
Title: Trying To Compile Mb-applet-blanker.c
Post by: pelrun 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.
Title: Trying To Compile Mb-applet-blanker.c
Post by: daniel3000 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
Title: Trying To Compile Mb-applet-blanker.c
Post by: pelrun 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...)
Title: Trying To Compile Mb-applet-blanker.c
Post by: Meanie 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
Title: Trying To Compile Mb-applet-blanker.c
Post by: pelrun 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...
Title: Trying To Compile Mb-applet-blanker.c
Post by: Meanie 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 ...
Title: Trying To Compile Mb-applet-blanker.c
Post by: pelrun on January 31, 2007, 11:42:46 pm
call your applet mb-applet-remote to avoid confusing others

That was my plan.
Title: Trying To Compile Mb-applet-blanker.c
Post by: Meanie 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...
Title: Trying To Compile Mb-applet-blanker.c
Post by: daniel3000 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
Title: Trying To Compile Mb-applet-blanker.c
Post by: Meanie 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] (http://index.php?act=findpost&pid=153181\")

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]