OK
Rating:
1.00
Thread Listing » AWN Applets
Question - Can an applet disable effects?
#15205 by mosburger (1.0000) posted on 9:22am Wednesday, October 31st, 2007
Quick question - is there any way that an applet can disable effects?
[Q]



I ask because I have a couple of applet ideas which involve clicking on specific spots on the icon itself. Obviously, that's going to be very difficult for a user to do if the icon is bouncing all over the place!
[Q]



The only idea I have is to create an applet that doesn't inherit from AwnAppletSimple, which seems like kind of a pain. I'm hoping there's some other way to disable effects with the effects framework.
[Q]



Thanks!
[Q]
Score: 0 points
Any particular reason?
#15209 by moonbeam (1.0000) posted on 9:45am Wednesday, October 31st, 2007
( no avatar )
I think the relevant C interfaces are.
[Q]



void
awn_effects_init(GObject *obj, AwnEffects *fx);
[Q]




awn_effect_start(AwnEffects *fx, const AwnEffect effect);
[Q]




void
awn_effect_stop(AwnEffects *fx, const AwnEffect effect);
[Q]



void
awn_effects_finalize(AwnEffects *fx);
[Q]




I think you'd just start the none effect. and don't stop it.
Not sure if other effects might override that though.
[Q]




Score: 0 points
Any particular reason?
#15210 by mhr3 (0.9971) posted on 9:48am Wednesday, October 31st, 2007
moonbeam said:

I think you'd just start the none effect. and don't stop it.
Not sure if other effects might override that though.
[Q]



No, starting none effect has no effect at all. You need to call awn_unregister_effects, but this function is currently not exported for python, but it shouldn't be a problem, just noone asked for it yet. :)
[Q]

Score: 0 points
Any particular reason?
#15212 by mosburger (1.0000) posted on 9:48am Wednesday, October 31st, 2007
I'd kinda like it in Python... I've done C applets and Python applets, and Python is *WAY EASIER* :)
[Q]
Score: 0 points
Any particular reason?
#15214 by moonbeam (1.0000) posted on 9:52am Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
No, starting none effect has no effect at all. You need to call awn_unregister_effects, but this function is currently not exported for python, but it shouldn't be a problem, just noone asked for it yet. :)
[Q]



btw, I noticed that
void awn_draw_icons(AwnEffects*, cairo_t*, GdkPixbuf*, GdkPixbuf*);
[Q]



is being exported. I think this might be asking for problems. At the very least I'd put a note discouraging it's use - I think its use might lead to exactly the same mysterious crashes issue we were seeing with awn-applet-simple.
[Q]







Score: 0 points
Any particular reason?
#15216 by mhr3 (0.9971) posted on 9:54am Wednesday, October 31st, 2007
moonbeam said:
is being exported. I think this might be asking for problems. At the very least I'd put a note discouraging it's use - I think its use might lead to exactly the same mysterious crashes issue we were seeing with awn-applet-simple.
[Q]



For python? No it ain't.
For C? Of course, how else would applet-simple use it?
[Q]

Score: 0 points
Any particular reason?
#15225 by moonbeam (1.0000) posted on 11:55am Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
For python? No it ain't.
For C? Of course, how else would applet-simple use it?
[Q]



Yes... but applet-simple sends in copies of pixbuf and makes sure the reflections are valid pixbufs now. None of this is done if an applet uses this interface directly. I just point it out because in the previous incarnation of applet-simple applets are using the interfaces safely (including python applets) and they were having random crashes. I'm willing to bet the same thing would start happening if applets (python or C) start using this interface.
[Q]




Score: 0 points
Any particular reason?
#15231 by mhr3 (0.9971) posted on 12:14pm Wednesday, October 31st, 2007
moonbeam said:
Yes... but applet-simple sends in copies of pixbuf and makes sure the reflections are valid pixbufs now. None of this is done if an applet uses this interface directly. I just point it out because in the previous incarnation of applet-simple applets are using the interfaces safely (including python applets) and they were having random crashes. I'm willing to bet the same thing would start happening if applets (python or C) start using this interface.
[Q]



Well, as I said, python applets can't use the interface directly, and if C applet wants to use it, it should be aware that passing invalid pixbufs can cause problems...
[Q]

Score: 0 points
Any particular reason?
#15232 by mosburger (1.0000) posted on 12:17pm Wednesday, October 31st, 2007
So, erm... this has all been very enlightening and everything but...
[Q]



*wince*
[Q]



do you think I'll be able to get a way to disable the effects anytime soon? In trunk? I'd be eternally grateful! :)
[Q]
Score: 0 points
Any particular reason?
#15238 by mhr3 (0.9971) posted on 12:31pm Wednesday, October 31st, 2007
mosburger said:
do you think I'll be able to get a way to disable the effects anytime soon? In trunk? I'd be eternally grateful! :)
[Q]



Done in trunk R139, please try it, I didn't test it.
[Q]

Score: 0 points
Any particular reason?
#15242 by mosburger (1.0000) posted on 12:45pm Wednesday, October 31st, 2007
Thanks - might be a day or two, though, I've got a bunch of stuff going on at work and I probably shouldn't even be tempting myself by reading this forum. :/
[Q]
Score: 0 points
Any particular reason?
#15243 by malept (1.0000) posted on 12:45pm Wednesday, October 31st, 2007
( no avatar )
The naming's a bit redundant. awn.awn_register_effects() should be awn.register_effects(), etc.
[Q]



Also, I'm trying to figure out how a python developer gets the GObject "obj" for awn_register_effects().
[Q]

--
/
Score: 0 points
Any particular reason?
#15244 by isaac_j87 (1.0000) posted on 12:46pm Wednesday, October 31st, 2007
mhr3 said:
Done in trunk R139, please try it, I didn't test it.
[Q]



I'll test it with the weather applet.
[Q]



Can you give an example?
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#15251 by mhr3 (0.9971) posted on 1:04pm Wednesday, October 31st, 2007
isaac_j87 said:
Can you give an example?
[Q]



self = instance of AwnAppletSimple
[Q]



 

awn.awn_register_effects(self, self.get_effects())
awn.awn_unregister_effects(self.get_effects())
[Q]
 



Note: this doesn't disable effects usage, you can still use start_effect, the applet will just stop starting/stopping effects on mouseover/-out.
[Q]



malept said:
Also, I'm trying to figure out how a python developer gets the GObject "obj" for awn_register_effects().
[Q]



Just like that ^^, Gtk* is derived from GObject (and AwnAppletSimple is also derived from GtkWidget).
[Q]



malept said:
The naming's a bit redundant. awn.awn_register_effects() should be awn.register_effects(), etc.
[Q]



Yea, you're right, but since all effect functions are like this, I'll leave it for now.
[Q]

Score: 0 points
Any particular reason?
#15252 by malept (1.0000) posted on 1:08pm Wednesday, October 31st, 2007
( no avatar )
so can AwnApplet be inputted into obj?
I think you should change the parameter type/name so that it's easier to see how the function works, in lieu of documentation.
[Q]

--
/
Score: 0 points
Any particular reason?
#15256 by mhr3 (0.9971) posted on 1:14pm Wednesday, October 31st, 2007
malept said:
so can AwnApplet be inputted into obj?
I think you should change the parameter type/name so that it's easier to see how the function works, in lieu of documentation.
[Q]



Yes, it can. And the function is already documented in awn-effects.h - maybe this should be exported to wiki, to have it on one place.
[Q]

Score: 0 points
Any particular reason?
#15258 by malept (1.0000) posted on 1:20pm Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
Yes, it can. And the function is already documented in awn-effects.h - maybe this should be exported to wiki, to have it on one place.
[Q]






Also, given the way that register_effects works, I think it would be better if it were bound as a method of both awn.Applet and awn.AppletSimple.
[Q]

--
/
Score: 0 points
Any particular reason?
#15260 by isaac_j87 (1.0000) posted on 1:22pm Wednesday, October 31st, 2007
 
mhr3 said:

awn.awn_register_effects(self, self.get_effects())
awn.awn_unregister_effects(self.get_effects())
[Q]
 



Thanks!!
[Q]



Just tried it out and it works great.
[Q]



One request, can you add this to the libawn-draw-effects branch! thanks :)
[Q]

--
-Isaac

*Edited at 1:24pm, 10/31/07
Score: 0 points
Any particular reason?
#15263 by mhr3 (0.9971) posted on 1:30pm Wednesday, October 31st, 2007
malept said:
Also, given the way that register_effects works, I think it would be better if it were bound as a method of both awn.Applet and awn.AppletSimple.
[Q]



It can only be used with AppletSimple, can you paste code how to bind it only to it?
[Q]

Score: 0 points
Any particular reason?
#15264 by malept (1.0000) posted on 1:33pm Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
It can only be used with AppletSimple, can you paste code how to bind it only to it?
[Q]



mhr3 said:
Yes, it can. And the function is already documented in awn-effects.h - maybe this should be exported to wiki, to have it on one place.
[Q]



I'm rather confused now.
[Q]

--
/
Score: 0 points
Any particular reason?
#15266 by mhr3 (0.9971) posted on 1:36pm Wednesday, October 31st, 2007
malept said:
I'm rather confused now.
[Q]



I meant that it can only be used with AppletSimple from python, cause AwnEffects struct doesn't have proper bindings, it'd need to be changed to GObject derived class.
[Q]



*Edited at 1:37pm, 10/31/07
Score: 0 points
Any particular reason?
#15267 by malept (1.0000) posted on 1:44pm Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
I meant that it can only be used with AppletSimple from python, cause AwnEffects struct doesn't have proper bindings, it'd need to be changed to GObject derived class.
[Q]



Actually, you only have to declare it as a Boxed struct.
[Q]



Here's the definition to bind to awn.AppletSimple:
[Q]




--
/
Score: 0 points
Any particular reason?
#15269 by mhr3 (0.9971) posted on 1:49pm Wednesday, October 31st, 2007
malept said:
Here's the definition to bind to awn.AppletSimple:
[Q]



Thanks, will commit in a while.
[Q]



malept said:
Actually, you only have to declare it as a Boxed struct.
[Q]



Any sample on that?
[Q]

Score: 0 points
Any particular reason?
#15270 by malept (1.0000) posted on 1:50pm Wednesday, October 31st, 2007
( no avatar )
mhr3 said:
Any sample on that?
[Q]



See desktop-agnostic's AwnDesktopItem in libawn/awn-desktop-item.h or AwnConfigClient in libawn/awn-config-client.h
[Q]

--
/
Score: 0 points
Any particular reason?
#15274 by mhr3 (0.9971) posted on 2:07pm Wednesday, October 31st, 2007
mhr3 said:
But AwnDesktopItem is based from GnomeDesktopItem/EggDesktopFile, which are existing GObjects. What would I return for the get_type() call?
[Q]



Nevermind, I see it now in the AwnConfigClient, thanks.
[Q]

Score: 0 points
Any particular reason?
#15276 by malept (1.0000) posted on 2:10pm Wednesday, October 31st, 2007
( no avatar )
Sorry, I meant EggDesktopFile instead of AwnDesktopItem. I had to implement GBoxed support for it.
[Q]

--
/
Score: 0 points
Any particular reason?
#15283 by mhr3 (0.9971) posted on 2:38pm Wednesday, October 31st, 2007
 
mhr3 said:

awn.awn_register_effects(self, self.get_effects())
awn.awn_unregister_effects(self.get_effects())
[Q]
 



So awn_register_effects is changed in R140.
[Q]



self.register_effects(self.get_effects())
[Q]



Unregister function remains unchanged.
[Q]

Score: 0 points
Any particular reason?
#32841 by Josemari (0.9992) posted on 5:20am Thursday, May 31st, 2012
( no avatar )
Absolutely everyone is longing for a designer watch but constantly restrained by the limited financial institution account. In that situation, cheap patek philippe why not try out the associated replica watch of higher excellent? best rolex model It truly is the precise copy with the authentic model with every single detail cautiously crafted breitling watches copy . By the primary sight at the counterfeit watch, you are susceptible to mistaken it a genuine piece.
[Q]

Score: 0 points
Any particular reason?
#33688 by Josemari (0.9992) posted on 6:51am Saturday, June 02nd, 2012
( no avatar )
To marriages in the previous year of tea-length wedding dresses identical with beach wedding, but for now can be designed for all wedding occasion just more focused on the motives and accents on skirt, hot evening dresses and need to know now that strapless neckline is best-seller and favorite to combine tea-length skirt hot sale wedding dresses affordable evening dresses . Tea-length wedding dresses which in 2011 create a more innovative and beautiful with various modifications.
[Q]

Score: 0 points
Any particular reason?
Thread Listing » AWN Applets » Question - Can an applet disable effects?

Post A Reply:

Powered by Metaforum ©2004-2012
Get your own Free AJAX Forum Messageboard by visiting the offical site.
.