IRC Log Viewer » #firebreath » 2010-11-17

IRC Nick Time (GMT-7) Message
taxilian 00:11 so my bet is that in about 2 hours, after I am in bed despite having stayed up ridiculously late, someone will show up with a question and nobody will be around
good night all
tempie 01:11 hi all,
i have a question about windowAttach and windowDetach
why are these functions called 2 times on windows when i close the page were a plugin lives, first detach with a window handle and the second time attach/detach with a nulled window handle
seems strange to me
DFUN 02:11 Is it possible to call a JS method out of the plugin?
or to change a text area
tempie 02:11 yup its posible
i was just dooing wrong
boost::dynamic_pointer_cast<MyPluginApi>(this->getRootJSAPI())->mypublicmethodhere("test");
did the trick
mypublicmethodhere(const char *data) triggers fireEvent("ondebug") and in javascript i attached an eventlistner on the plugin on the ondebug event
DFUN 02:11 are you sure that this calls a JS method? I thought it calls one of the registered method within the plugin, i. e. the C++ code
ok, the FireEvent is what I'm looking for
do you have an example code for the JS event listener?
nitrogenycs 02:11 the js event listener can be just a regular function
DFUN 02:11 thanks
and is doesn't need to be registered anywhere?
nitrogenycs 02:11 if (window.addEventListener) { // Opera, Mozilla, Safari, ...
plugin.addEventListener( eventName, callback );
}
else { // IE
plugin.attachEvent( 'on' + eventName, callback );
I think that's a general thing
in js
callback can be something like function () { alert("Hello"); }
you can also pass parameters to function
tempie 03:11 ok thats the same as i did, top!
DFUN 03:11 now my plugin crashes on shutdown
DFUN_ 03:11 unfortunately not even reverting and rebuilding the changes fixes it
DFUN__ 03:11 =]
nitrogenycs 03:11 I have an issue with that too
it happens since I've upgraded hg a few days ago
DFUN 03:11 I can remember something I read abouth that, yes ... but now I found something I didn't revert. That has to be it
that was ugly
DFUN 05:11 I just deleted all the weird NPAPI/ActiveX-related stuff from the specification my colleague wrote down when he started to work on the plugin without firebreath. And I can tell that it feels really relieving
nitrogenycs 05:11 ehehe
the best part is that firebreath does the weird stuff he did not put into the spec :)
DFUN 05:11 and that is even more relieving
TomL 06:11 I'd really love to see a tutorial on how firebreath devs suppose to integrate with a more responsive application (did I just say openGL game?) - I'm a bit stumped on how to properly setup the plugin in order to have frequent render updates
DFUN 06:11 on an update of FireBreath, is it sufficient to just include the existing "projects" source directory to the new framework path and run "prepXX.cmd" again?
WarGloom 06:11 it is better to run prepxx.cmd
to avoid some strange for example linking errors
neilg 07:11 If only TomL were here still, I could answer his questions! :(
tempie 07:11 i would like to hear it 2
btw is there some more info about the eventmaps than this url http://www.firebreath.org/display/documentation/classPluginCore
there are some templates like EVENTTYPE_CASE and also but not mentioned EVENTTYPE_CASE_WITHWIN
where are these function/templates/defines defined
EVENTTYPE_CASE is defined in eventsink buth the eventtype_case_???? ones where to find them and how to use them, is there some documentation of it
tempie 08:11 nobody ?? knows :(
:'(
taxilian 08:11 tempie! you're still here this time!
DFUN 08:11 :) finally
taxilian 08:11 and DFUN too
DFUN 08:11 yes, good morning
but again, my time has almost come
taxilian 08:11 any questions while I'm here?
tempie: EVENTTYPE_CASE_WITHWIN is gone; it was briefly there and then I decided to just make it go away and EVENTTYPE_CASE is the one true way to do it
tempie 08:11 :)
taxilian 08:11 where did you find references to it?
tempie 08:11 at what time zones do you guys live
taxilian 08:11 I'm in MST
-0700
DFUN 08:11 nothing urgent yet. I was wondering if the plugin could call JS methods
Germany, +1
taxilian 08:11 certainly
tempie 08:11 +2 :)
or +1
depends on summer and winter time (holland)
okay i found it in the docs
DFUN 08:11 when I tried to the plugin just crashed. There must be something I got completely wrong
taxilian 08:11 for calling JS methods you either want to go through the DOM objects (http://www.firebreath.org/display/documentation/class+FB+BrowserHost+getDOMWindow) or if you want to pass in a callback function use a JSObjectPtr (http://www.firebreath.org/display/documentation/class+FB+BrowserHost+getDOMWindow)
sounds likely =] good trick, though. what did you do?
DFUN 08:11 the time in holland is +2 from standard time??
tempie 08:11 Btw the place i found the eventtype_case_withwin : http://www.firebreath.org/display/documentation/classPluginCore#classPluginCore-Eventmapsdocumentation%3AclassFBPluginEventSinkHandleEvent
taxilian 08:11 updating it now
thanks for the heads up, and sorry for the confusion
DFUN 08:11 to get the JSObjectPtr in my Manager-class I referenced the API-class within. On destruction that caused a crash
taxilian 08:11 btw, you can use FB::ptr_cast<…> instead of boost::dynamic_pointer_cast<…> if you want
tempie 08:11 noproblem i find the project a time saver, i have tried to write a NPAPI plugin a while ago in C had little success. Then the ActiveX way i got completly lost.
taxilian 08:11 DFUN: not sure I understand
DFUN 08:11 I tried to modify a Document::Element but that had no effect to the website
taxilian 08:11 tempie: was it you seeing two attached and two detached events?
tempie 08:11 yes i found the typedef
yep
only when i close the tab or close the window
taxilian 08:11 what browser?
tempie 08:11 i tried it in Chrome on windows XP and if i recall it correctly Also IE
But for IE i'm not sue
taxilian 08:11 ok; most likely the browser is giving us that. there is no guarantee that attached and detached will happen only once
if the window goes away or changes, they will get called again
tempie 08:11 the second call comes with a NULLed pointer, so i know i should have to anything
DFUN 08:11 I don't really need the functionality and most likely got it wrong, so nevermind. Just wanted to play around a bit. tempie's observations are definitle more important.
see you
taxilian 08:11 which pointer is NULL? the src?
tempie 08:11 no the 2nd param
okay thats not very clear
taxilian 08:11 that would be the src
the object firing the event
strange; it shouldn't fire an attachedevent if that is null
what version are you using?
tempie 08:11 the one with the type FB::PluginWindow
v1.3
taxilian 08:11 latest from trunk or the release?
tempie 08:11 release
taxilian 08:11 hmm. could you try it with the latest stable nightly?
tempie 08:11 i will try it when i get home and let you know, ok?
taxilian 08:11 okay
for future reference
if you have a question and I'm not here, tell me to answer when I get back
and then check the logs later
tempie 08:11 Okay..
taxilian 08:11 it's easier if we can actually talk, but since we don't seem to ever be here at the same time, that lets me see it
the other (possibly easier) way, of course, is to just post on the mailing list
tempie 08:11 This is most of the time faster, but for later reading is the mailing list easier :)
well i'm off. Finnaly my work day finished.
taxilian 09:11 right; if someone is here to help, this is definitely faster =] one of these days I'm going to write a quick app to make the logs easily searchable
tempie 09:11 kewl, documentation is the key
taxilian 09:11 yep; if the project is helpful to you, please contribute back by updating the documentation to make it more clear
particularly on things that you had a hard time figuring out
tempie 09:11 I will certanly do...
well cu later, i have to catch the train...
taxilian 09:11 awesome =] well, take care
good luck
TomL 09:11 hi
taxilian 09:11 hey, you're back =]
neilg_ is the resident opengl game expert
TomL 09:11 I am so back, yes, thx
I'm delighted you have an expert around
neilg_ 09:11 I don't know if I'd go as far as that but... lol
taxilian 09:11 that's why I did for you
RHIP
TomL 09:11 I figured how to have some ogl sample code running in the browser, but i'm stuck with where to put the obligatory main loop
quite frankly render calls are atm done in onMouseMove, well..
taxilian 09:11 lol
neilg_ 09:11 Yeah, you don't need to do that
TomL 09:11 I tried handing the window handle to another thread, didn't work
taxilian 09:11 did you initialize opengl on the other thread?
neilg_ 09:11 If you cast PluginWindow to PluginWindowWin then you can get the HWND to the plugin window and just render using that
Taxilian is right, OpenGL has to have the initialization, contexts and rendering all done on the same thread
D3D is the same way though can be a little more forgiving
taxilian 09:11 that's how I'd do it; start another thread (you can just use the boost thread libs) and do all your rendering on that thread
TomL 09:11 I guess I might just have made the error of not initializing the context on the other thread
btw, using boost anyway
neilg_ 09:11 TomL: Window handles are global to the system so even another process can render to a window in another process so long as it knows the handle
taxilian 09:11 that would be my guess
neilg_ 09:11 This is in fact what we're going to change to (currently we render from within the plugin but it would be nicer to have a seperate process)
It's also how Chrome handles multiple tabs
Well, I don't know that for sure but I can't see any other way to do it... lol
TomL 09:11 well, you may have helped me allready, my work day is nearing to an end. might not be able to figure it out now :-)
taxilian 09:11 well, I'm going to go eat breakfast, shower, get dressed… that sort of thing =] I'll be back in a bit
TomL: if we're not around here when you need help, the mailing list is a good option
neilg_ 09:11 TomL: I guess you're from the UK then?
TomL 09:11 but just let me tell you that firebreath is really great (you do know that) and obviously well engineered, too
taxilian 09:11 there really isn't that much traffic on it, and most (nearly all) is relevant to anyone interested in learning how it works
TomL 09:11 thx for guessing that wrong
taxilian 09:11 why thanks =] we've worked hard on it
ok, be back later
TomL 09:11 I'm from Berlin/Germany
taxilian 09:11 we have a lot from Germany come in here
neilg_ 09:11 Ah, okay. nitrogenycs is also from Germany. I used to live there (in Munich) but not anymore!
taxilian 09:11 Georg (cygmatic) is also from Germany, though he's been busy and not around as much lately
neilg_ 09:11 I couldn't remember Georg's handle. lol
TomL 09:11 Oh and I was wondering why I manage to crash Firefox, I guess there was something about seperating plugins into their own processes.. guess you can still evil crash it :D
taxilian 09:11 firefox (unless you're using a beta or tweaked version) doesn't yet do OOPP
TomL 09:11 well, this does explain things ;)
taxilian 09:11 yep
okay, now I really am going to go get ready for the day
neilg_ 09:11 Have... fun?
lol
taxilian 09:11 =] the real fun starts when I start doing homework after I get ready
TomL 09:11 do have fun
I will get home now and have some of my own homework
thx guys
taxilian 09:11 np
cya
tempie 11:11 taxilian, i tested the window attached and detached after the page/browser plugin (it seems to be only a chrome issue) IE isn't triggering the attach and detach a 2nd time
i will try firefox later
taxilian 11:11 tempie: interesting. well, just something to be aware of, I guess
file an issue for me, could you?
tempie 11:11 tested firefox, calls only once the detach, so a chrome only thing
taxilian 11:11 yeah; I have some suspions as to what causes it, but it shouldn't send the attachedevent unless it actually created a pluginwindow
DriesSt 11:11 hi taxilian, I'm currently browsing the google gears code to see how they handle memory in firefox
taxilian 11:11 you know, the only other thing I've though of is that it is remotely possible that somewhere we're freeing something we didn't allocate or something we did allocate is getting freed by firefox
DriesSt 11:11 the code is quite well documented and explaining quirks as well
taxilian 11:11 that would also cause bizarre memory management issues
anything that looks like we don't have covered?
in fact, could you send me some links to code?
DriesSt 11:11 not so far
http://code.google.com/p/gears/source/browse/trunk/gears/
npapi stuff is in base
taxilian 11:11 cool
I guess there is one other option, if we can't get the NPObjectAPI to hold references properly
and this might be a reasonable-ish solution for you
even though it's a dirty hack
you could make a version of NPObjectAPI that instead of holding onto the reference stores it in an object off of window
i.e. window.__FB_OBJECT_CACHE["unique_id"] = passed_object
then in the NPObjectAPINew class (or whatever you call it) it could just request that object before using it each time
that way it doesn't ever really hold a reference to it
tempie 11:11 hmm i'm back
taxilian 11:11 welcome back =]
tempie 12:11 internet hickup.. burp
btw i had some problems compiling the nightly 1.4 r39 in vs2008
it was complaining that the uint32_t and or any other types who are normaly in stdint.h were not defined
so i added the types by hand in variant.h
and then it compiled without any problem
taxilian 12:11 hmm. that's strange; it built fine for me
there is a boost library that has all of those defines in it
boost header, rather
thanks for mentioning it; I'll try to fix that today
tempie 12:11 maybe its because i overwritten all the files with the newer one and run the prep2008
and did a complete rebuild
taxilian 12:11 hmm. that's possible, I guess; don't just overwrite the files, start with a clean directory
and remove your old build/ dir
I like to keep my projects/ folder outside of the firebreath root
tempie 12:11 yup thats probably the what was wrong, still have to figure out whats the best layout.
btw is there a subversion repository available
taxilian 12:11 there is not
at some point we may move to github, at which point there would be a read-only subversion repo in addition to the git one
but trying to use subversion for a project like this would be disasterous
tempie 12:11 ahha ok i know i had a lot of problems with subversion at work, but its just what i got used to ;)
(bad) habbit
taxilian 12:11 nothing inherently wrong with subversion, it just doesn't support distributed SCM
mercurial is really not much harder to use, though
hg clone <repository url> <folder>
then instead of just update, you need hg pull && hg update
tempie 12:11 ahha, for now i will just use the nighties
taxilian 12:11 ok. well, when you update, just remove the old folder and put the new one it it's place
keep your projects/ dir somewhere else
I have ~/code/firebreath/ and ~/code/fbprojects/
then from ~/code/, firebreath\prep2008.cmd fbprojects build preps the projects
any time you update the firebreath source tree you rpobably want to delete the build dir
let me know if that changes anything, though
tempie 12:11 ok that seems dooable
ok
taxilian 12:11 keeping your projects seperate also makes it easy to use mercurial for firebreath/ and something else for your projects if needed
a clean build on a windows xp machine with visual studio 2010 worked last night, so it should be okay
(we have a build server that automatically tries to build every 6 hours and emails us if it breaks)
well, gotta head to class now
DriesSt 12:11 ok, I prefer not to use a hack like that but I'll keep it in mind
taxilian 12:11 I totally agree; it's just the only thing I can think of that would get around the issue we have :-/
DriesSt 12:11 interesting tip on keeping projects out of the root
taxilian 12:11 if we can't make the browser reliable
yeah; I really need to put that somewhere on the wiki
… or someone else could do it for me ;-) (hint hint… :-P)
DriesSt 12:11 it must be possible to fix it, other plugins do it, right
taxilian 12:11 that's what I think
but I'm running out of ideas
DriesSt 12:11 anyway, i won't keep you from class, have fun and don't fall asleep ;)
taxilian 12:11 =] I'll try not to
but no promises
DriesSt 12:11 :)
taxilian 12:11 quick question; how long do you think it'd take you to come up with a basic replacement for CFBControl that doesn't require ATL if you didn't have to worry about the registration code?
(this question for was DriesSt)
tempie 12:11 issued bug 109 on the chrome attach/detach buggie
taxilian 12:11 tempie: cool, thanks
DriesSt 12:11 a few days, i guess
will require a lot of testing though
taxilian 12:11 what I would like to do is to build a seperate activex project that can be enabled instead of ActiveXPlugin
I think I can do the registry code
and I can certainly help wtih the activex stuff, but I'm not sure I know enough to do it all myself
it would be experimental until sufficiently tested
if you find time to work on it, that would be awesome; obviously, it's up to you =]
what I really want is a project that can be statically linked; so any project-specific CLSIDs should be gotten from a function on FactoryBase
anyway, something to think about
bbl
tempie 14:11 gooing to bed bye
taxilian 16:11 has anyone here used anything like Purify (or anything else that serves the same general purpose as Valgrind but on windows)?