IRC Log Viewer » #firebreath » 2011-01-11

IRC Nick Time (GMT-7) Message
taxilian 09:01 good morning all
DFUN 10:01 hi there
taxilian, on 2010/11/25 you already answered a question of me, but I'm no smarter now...
Now I need to know how I can synchronously call a JS function from the plugin
taxilian 10:01 get a JSObject
and call Invoke
DFUN 10:01 you wrote "Just pass the function in as a FB::JSObject and call Invoke("", FB::variant_list_of(arg1)(arg2));"
ok, but how do I get the JS method into the plugin as a JSObject
taxilian 10:01 how do you get it in as an int?
just have a JSAPI method with a parameter that is const FB::JSObjectPtr&
DFUN 10:01 I don't know
taxilian 10:01 ok; stepping back a bit, then
to add a new method to your JSAPI, you create a method on the class and then you register it
DFUN 10:01 I only know the other way
taxilian 10:01 whatever types you use in that method, JSAPI will try to convert the input into that type
so if you have: int doSomething(const int num, const FB::JSObjectPtr& callback) { … }
then the return type will be an int, and it will accept an integer and a callback as input
then you register it in the constructor with registerMethod("methodName", make_method(this, &MyPluginAPI::doSomething))
look in FBTestPlugin for more examples
does that make sense?
DFUN 10:01 That's what I did to call plugin methods out of JS in the browser
taxilian 10:01 the only thing to know about a JSObject that differs from what you'd expect is that you need to pass in the shared_ptr; there is a typedef called FB::JSObjectPtr for this
right
so the plugin method just has to accept a FB::JSObjectPtr
store that, and when you need to call it back call ->Invoke on it
DFUN 10:01 all right. I will try that.
...tomorrow.
taxilian 10:01 hehe. okay
There is an example in FBTestPlugin of doing a callback, i think
hang on a sec
DFUN 10:01 Thanks a lot. I will have a look an it, too.
taxilian 10:01 https://github.com/firebreath/FireBreath/blob/master/examples/FBTestPlugin/ThreadRunnerAPI.cpp
addMethod does it
then in threadRun you can see it do a synchronous invoke
DFUN 10:01 perfect. That should be enough for me to copy :)
taxilian 10:01 yep
just remember, when it comes to accepting things into a JSAPI method
if it seems hard, you're probably doing it wrong :-P
DFUN 10:01 :) great guideline
ok, bye bye then. See you tomorrow
taxilian 10:01 grr. anyone want to help me write up some docs? I can help keep you honest, I just need someone to help with the typing and formatting...
wolfmanfx 14:01 hoi i have question regarding the object tag parameter: Are the supported?
like the data attribute
taxilian 14:01 sorry, I don't understand your question
what exactly do you want to do?
wolfmanfx 14:01 <object data="
<object data="uhr.svg" type="image/svg+xml" width="200" height="200">
<param name="src" value="uhr.svg">
Ihr Browser kann das Objekt leider nicht anzeigen!
</object>
taxilian 14:01 well, I don't know what will happen if you just try to do that; the browser may have something it tries to do with it
however, you can get the value of the param "src" very easiliy
and in the latest 1.4 you can get the value of "data" as well
wolfmanfx 14:01 ah i am using 1.4 (a few days old)
taxilian 14:01 you may want to update… I just pushed a bugfix =] you can get the values, but I don't know if the browser does anything automatically to handle data or not
wolfmanfx 14:01 btw i am now using boost::interprocess named_mutex to sync file ops working like a charm
:)
taxilian 14:01 awesome =]
wolfmanfx 14:01 i am trying to finish it up
with passing the vfs file (my binary virtual file system) to the plugin
through an param or data attribute
but do not know when i get this attribute
or do i have to query it myself
taxilian 14:01 you have to query it yourself
host->getDOMElement()->getStringAttribute("data") should do it, I think
wolfmanfx 15:01 i updated firebreath now getting compile errors firebreath\src\activexcore\jsapi_idispatchex.h(52): error C2661: 'FB::JSFunction::JSFunction' : no overloaded function takes 2 arguments
taxilian 15:01 seriously? grr.. hang on, I'll fix it
wolfmanfx 15:01 yep
i checked github
taxilian 15:01 try now
FB_GitHubBot 15:01 FireBreath: master Richard Bateman * e6dfc0a (1 files in 1 dirs): Fixed build error w/ ActiveX - http://bit.ly/fnXGqD
wolfmanfx 15:01 line 470 is also an error
taxilian 15:01 hang on, working on building it...
wolfmanfx 15:01 np
:)
taxilian 15:01 I must have forgotten to try it on windows; was developing on mac
wolfmanfx 15:01 this stuff always happens without an build server
taxilian 15:01 actually, I have a build server… email notifications just haven't been working lately
not sure why
wolfmanfx 15:01 ah
using bambo?
taxilian 15:01 hudson
ahh, found the problem. next time I should be notified
almost there...
wolfmanfx 15:01 i fixed it here :) so no rush
taxilian 15:01 hehe. well, this fix is the "correct" fix. it shouldn't be creating function objects there anyomre
wolfmanfx 15:01 ah thought you just forgot to add the third param
:S
FB_GitHubBot 15:01 FireBreath: master Richard Bateman * 41df62b (1 files in 1 dirs): Fixed another build error w/ ActiveX - http://bit.ly/h4aTz0
taxilian 15:01 there
wolfmanfx 15:01 super thx
taxilian 15:01 I think it's time to update boost...
wolfmanfx 15:01 is a new version out?
taxilian 15:01 yeah; 1.45
firebreath is on 1.44
wolfmanfx 15:01 yep i see alot interprocess bug fixes
taxilian 15:01 so you're a fan of updating? =] I'm also going to add some missing libs
in fact, maybe I'll keep everything and just strip out a few things
rather than being inclusive, I may decide to be exclusive
wolfmanfx 15:01 yeah i like to using trunk stuff :)
what i like on firebreath is the inclusion of the boost_thread project
this helps a lot to get started fast
taxilian 15:01 =] we started out trying to avoid using any external dependencies, but boost is so useful we've been relying on it more and more
wolfmanfx 15:01 boost is nice but the main problem is that the boost libs rely on other boost libs so its always a fight to remove unneeded headers
taxilian 15:01 yeah
that's why I try to trim down what I allow in
for example, the spirit library is 19M; I don't think we need that in FireBreath
there are things we could do with it, of course, but...
wolfmanfx 15:01 ^^
define firebreath grammar
taxilian 15:01 lol. to what purpose? to create a meta-language for creating firebreath JSAPI classes?
it's not that hard to make them from scratch
wolfmanfx 15:01 i was just joking :)
taxilian 15:01 =]
wolfmanfx 15:01 so rebuild everything and the plugin is working again :)
taxilian 15:01 good good =]
taxilian 15:01 any requests for boost libraries to include that aren't there yet?
as long as I'm upgrading us to 1.45?
wolfmanfx 15:01 keep interprocess
taxilian 15:01 lol. no worries there
wolfmanfx 15:01 :)
taxilian 15:01 the only one I'm considering removing is spirit, just because it's huge
taxilian 16:01 just gotta test it, think I'm done
and this time I made scripts for it as I went, so updating boost shouldn't be so time consuming in the future
FB_GitHubBot 16:01 FireBreath: master Richard Bateman * 6ae079a (1 files in 1 dirs): Updated boost to boost 1.45.0 - http://bit.ly/i0D1C1
taxilian 16:01 btw, cmake accepted my patch… now we're only months away from not having to do scary hack things on mac
sabotaged|wk 17:01 hmm why would gen_templates\resource.h not make it to gen\resouce.h after running cmake? i did a clean build on 1.4
gen\resource.h rather
wait let me double check something first
taxilian 17:01 because it's changed
it is now global/resource.h
it was mentioned in my "breaking changes" email to the list....
sabotaged|wk there are one or two others as well
win/win_common.h is just win_common.h
sabotaged|wk 17:01 oh
taxilian 17:01 win/targetver.h now win_targetver.h
sabotaged|wk 17:01 ok
taxilian 17:01 be back in about 20 minutes
taxilian 18:01 I would really like it if some of you were to respond to that thread on the mailing list… ;-) (hint hint). Be honest, don't just do it to be nice to me
thanks