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

IRC Nick Time (GMT-7) Message
dougma 00:08 taxilian_away: re ScheduleOnMainThread:
boost::shared_ptr<ObjectType> obj(get_object_sharedptr());
host->ScheduleOnMainThread(obj, boost::bind(&ObjectType::method, obj, arg1, arg2));
so, param1 is stored as a weak pointer? but the obj can't be released because the bind will bind obj as a strong pointer...
dougma 00:08 i suppose if you bound obj.get() that would work better?
so if there's a problem i think it's just in the comments. :)
dougma 02:08 on npapi (ff5/win), seekable streams created by BrowserHost::createStream don't send OnStreamCompleted.
Is that intentional?
IE is ok.
sorry, OnStreamCompleted = SteamCompletedEvent
*StreamCompletedEvent.
Guest63371 05:08 hi. my plugin got listed in safari. But not in chrome. why?
nomuna 06:08 Hi folks ... Does anybody know how to write to the status bar of the browser from the plugin? I need to get a message to the browser among other stuff.
I have been using throw FB::script_error("My Error Message"). But it doesn't work anymore due to a bug in the browsers.
linearray 06:08 like so? http://www.codeproject.com/KB/scripting/jsstatus.aspx
nomuna 06:08 Yeah like that. I know that I have the FB::BrowserHostPtr& host object. How do I use it? How do I set/change the value of a variable... have you done anything like that?
dougma 06:08 make an event, attach to it on the webpage, fire it from your plugin
nomuna 06:08 Yeah that's a thought. Thank you...
But still. It doesn't satisfy my curiosity. :D
How can I do what I asked? Any idea?
dougma 06:08 getDOMWindow(), then the set the status property
nomuna 06:08 host.getDOMWindow()? I am looking for a header where BrowserHostPtr is defined/explained can you point me in the direction?
dougma 06:08 !wiki getDOMWindow
FireBreathBot 06:08 7 results found. Note: Results limited to 8
"class FB ActiveX ActiveXBrowserHost getDOMWindow": http://goo.gl/HCvrl
"class FB BrowserHost getDOMWindow": http://goo.gl/5Q6L8
"class FB Npapi NpapiBrowserHost getDOMWindow": http://goo.gl/EyJ49
"Tips and Tricks": http://goo.gl/sOA8M
"Plugin Lifecycle": http://goo.gl/nVhKS
"Features": http://goo.gl/xXK1q
"Version History": http://goo.gl/lgWpo
dougma 06:08 most browsers don't show the status bar anymore
which is good... people writing to the status ruined it :)
nomuna 06:08 Thanks a lot. I'll look into it. Yeah I saw that... just collecting data you know.
Ok. I promise I won't do it.
dougma 06:08 :)
nomuna 07:08 Listen. if I return a string (empty string or a string object which was with NULL intialized) from my method to javascript and wanna check if it is null or whatever how do I do it... Do I have to cast it to javascript string with the FB::variant thingees?
dougma 07:08 no
nomuna 07:08 Do I get a String like "\0" in the javascript code? :D
dougma 07:08 declare your api method as returning FB::variant
return null
in javascript you will get a null ref
or whatever they call it :)
not a string.
return std::string("") and you will get an empty string.
nomuna 07:08 You mean I can return null and check in the javascript code if (myreturnval == undefined)?
dougma 07:08 yes. if you want.
taxilian 09:08 nomuna: actually if you return null then in the javascript you can check if myreturnval === null
null and undefined are different values
if you return FB::FBNull() or FB::FBVoid() you'll get null or undefined
return NULL and you actually get 0
nomuna 09:08 taxilian: thanks a lot...
I have been reading your blog entry "Asynchronous Javascript Calls".
I have written a plugin in which i pass a program on the OS the url I get from the javascript. The program is started using the fork... Should I be using InvoceAsync?
InvokeAsync I mean...
taxilian 09:08 I'm not sure what InvokeAsync has to do with a forked process...
nomuna 09:08 It starts a program on the OS and I wait in the plugin code for exit code etc. I think I am blocking thus the JavaScript call. IMHO. What do you think.
?
taxilian 09:08 if you're ever waiting in plugin core for something to exit, you should do the waiting on another thread
and then it would probably make sense to use invokeasync, but the important thing is the thread, not the invokeasync
nomuna 09:08 So I should use InvokeAsync, start a thread for the process and use a callback for getting the result. Correct?
taxilian 09:08 InvokeAsync has nothing to do with starting a new thread
you should start a new thread and pass the callback function to it
nomuna 09:08 I know.
taxilian 09:08 and then when it's done you should probably use invokeasync, but that is really of secondary importance
nomuna 09:08 Just like you wrote in your blog (with boost and stuff)
taxilian 09:08 right
when invoking something that you don't care about the return value, use invokeasync
when you do, use invoke
invoke doesn't quite perform as well because it will wait for the call to complete before returning
but in your case it won't make a big difference
nomuna 10:08 Here is the general idea (I hope I understood you correctly...)
JavaScript -> plugin -> wrap in thread ( Fork using execvp("ls -la && sleep 15s" ) etc.), if went OK -> call the successCallback; else -> callErrorCallback.
taxilian 10:08 right
nomuna 10:08 OK. I am glad I got it. :D
taxilian 10:08 I usually have one callback and I pass a bool indicating if it succeeded or not, but that's just preference
nomuna 10:08 pass boolean to the javascript callBack you mean...
taxilian 10:08 yes
nomuna 10:08 Thank you. I have another question. The plugin I am working on is to run on Windows/Mac and Linux. I had to parse some plist (xml) files on mac using libxml2.
But I saw that Cocoa has some datastructures which can read the plist files. Is there a way to use ObjectiveC/Cocoa code in the plugin? I mean the stub is generated as C++. How do make the framework to compile objectivec files and use it in the MyPluginAPI.cpp. Is it possible? Am I making myself clear?
taxilian 10:08 !findfile WebViewMac.mm
FireBreathBot 10:08 Found 1 matching file(s) in the master branch. First 1 are:
src/libs/WebView/Mac/WebViewMac.mm http://goo.gl/NCB0i
taxilian 10:08 that is an example of a C++ class that uses objective c
it has an abstract base class interface so that I can use it from C++
amackera 10:08 hey all :)
taxilian 10:08 .....
he lives!
*faints*
amackera 10:08 haha
i'm back! :D
taxilian 10:08 I've heard that before… :-P
long time no see, my friend. welcome back =]
amackera 10:08 updating my brain to FireBreath 1.6 :)
taxilian 10:08 hehe. were you on 1.5?
amackera 10:08 not even, still rocking 1.4
our plugin has had no love for a while now :S
taxilian 10:08 I wondered =]
definitely time to upgrade
nomuna 10:08 taxilian: Thanks a lot. Great plugin BTW.
taxilian 10:08 nomuna: technically, if there is a great plugin it would have to be yours, since FireBreath is a framework, but thanks ;-)
amackera: I've started contemplating a FireBreath 2.0
nomuna 10:08 I mean great FRAMEWORK... :D
taxilian 10:08 though I don't think it would be in the next month or two
amackera 10:08 niiice
what are the plans?
taxilian 10:08 one of the core ideas would be that we would completely redo the cmake logic; instead of firebreath including a project, the project would include firebreath
and then call macros and/or functions to make sure everything needed was added
no more opening FireBreath.xcodeproj or FireBreath.sln, it would be your plugin's project file
but we'd redo how drawing models are selected as well
and possibly add support for NSViews
amackera 10:08 that would simplify the early learning curve
nice
taxilian 10:08 also entirely deprecate using Carbon events; I actually have an event translator in the codebase now (written by Eric, who refactored the PluginWindowMac classes in 1.5) that will convert most carbon events to cocoa
amackera 10:08 i saw that, very cool
taxilian 10:08 so the framework will ask you "What event model(s) do you want?" and if you say just Cocoa it'll give you cocoa events
anyway, I have some other ideas as well, but that's some of the core pieces. over the next month I'll probably switch to a full time position instead of 2 part time positions, and much may depend on which company I end up with
sabotaged|wk 10:08 anyone ever seen regsvr32 on the plugin fail with "exit code 0x5"?
taxilian 10:08 0x5? nope, that's new
I'll brb; changing computers
someone-noone 10:08 "instead of firebreath including a project, the project would include firebreath"
:pray:
taxilian 10:08 lol
someone-noone 10:08 this is the feature #1 in my wishlist
NSView feature will also make life easier… at least for beginner
taxilian 10:08 well, the problem is NSView support will be imperfect at best
may require some tweaks to make things work
someone-noone 10:08 do you mean event support?
taxilian 10:08 events will be the biggest thing, yes
someone-noone 10:08 this is one of the tasks that i'm working at now with medium priority. So if i finish it soon i will share event solution
taxilian 10:08 I've actually got it about 75% solved for an NSView
!findfile WebViewMac.mm
FireBreathBot 10:08 Found 1 matching file(s) in the master branch. First 1 are:
src/libs/WebView/Mac/WebViewMac.mm http://goo.gl/NCB0i
taxilian 10:08 but it's not (yet) perfect
someone-noone 10:08 cool!
so, plugins will become windowed!
?
taxilian 10:08 no
but it will be possible to pretend they are to some extent
however
opengl will not work
and some other things won't either
basically all I'm doing is making an offscreen NSWindow and then at 30 frames / second I render it into a CGContextREf
would probably be possible to do it with a CALayer instead
someone-noone 10:08 [[NSWindow contentView] setLayer:]
do you know about it/
?
taxilian 10:08 I suspected there was something along those lines
I haven't started trying to play with it yet
someone-noone 10:08 i just wanted to show that it's definitely possible
taxilian 10:08 good to know
that might even make opengl possible, but I'm not sure
these are all things I want to figure out at some point
but doing it all myself is somewhat difficult
someone-noone 10:08 i will help you with opengl
taxilian 10:08 sounds good to me =]
if amackera is really back and able to donate a few bits of code that'd help a lot too
amackera 10:08 :)
taxilian 10:08 in particular, I could really use some sample code (even if not fully working) of using opengl to draw offscreen and blit into a CGContext
similarly to draw into a hDC
amackera 10:08 sure i have code that does exactly that
taxilian 10:08 I know you do
amackera 10:08 hah
:D
someone-noone 10:08 :)
taxilian 10:08 but that doesn't help me, because I don't have it =]
amackera 10:08 lolll
taxilian 10:08 I haven't seen you in 6 months :-P
(for those who don't know, amackera built the original pluginwindowmac classes and implemented windowless support on windows)
as well as helped with a lot of other misc odds and ends
amackera 10:08 *bows*
taxilian 10:08 and then he DISPPEARED WITHOUT A TRACE!
;-)
amackera 10:08 haha
taxilian: I have a cmake question for you
taxilian 10:08 okay
amackera 10:08 I am trying to link a static library with my project
taxilian 11:08 so on the topic of FireBreath 2.0, I envision a day when you get an event that says something like "NegotiateDrawingModel" and you call into the window and say "I want to use OpenGL" and it sets up the context and everything for you to draw into the browser
!wiki Libraries
amackera 11:08 I put the path of the static library in target_link_libraries() of my projectDef.cmake
FireBreathBot 11:08 8 results found. Note: Results limited to 8
"Using Libraries": http://goo.gl/cUVa6
"Re: Feedback": http://goo.gl/xZWWc
"Building on Mac OS X": http://goo.gl/iQ1mh
"Documentation To-Do": http://goo.gl/XzBGF
"Ideas": http://goo.gl/7QuAp
"FireBreath 1.5.0RC1 Released!": http://goo.gl/lppMa
"Helpful Links": http://goo.gl/vDlMu
"FireBreath 1.5.0 Released!": http://goo.gl/xzf0Y
taxilian 11:08 ;-)
okay
amackera 11:08 oo
someone-noone 11:08 that would be great
amackera 11:08 but the build fails with undefined symbols
taxilian 11:08 are the symbols from your static library?
amackera 11:08 other libraries seem to link just fine
yes
taxilian 11:08 windows? mac?
amackera 11:08 windows
VS2010, cmake 1.8.5
taxilian 11:08 check the project properties and make sure the library is set up right
though I'm betting it's really 2.8.5 you're running
amackera 11:08 hah yea
sorry
taxilian 11:08 I'd try getting it working with visual studio directly first and make sure the library even works; then try to figure out what is different
re: fb 2.0: so then if CoreAnimation is available it would use that. if not, it would draw offscreen and blit to CoreGraphics (on mac)
on windows if it's windowed it uses the HWND
if windowless it does drawing offscreen and blits to the hDC
amackera 11:08 taxilian: I have not yet figured out a reliable way to do this
for windows offscreen drawing
taxilian 11:08 similarly mac you can set it to force windowless and it will use CG if it's on a browser that doesn't composite CA
the problem is opengl?
windows you would ideally eventually also be able to specify that you want directx and have that set up for you as well
amackera 11:08 taxilian: I'm not sure if the problem is OGL or my method of blitting with hDC
taxilian 11:08 amackera: well, I have code to blit to an hDC reliably, would you like it?
amackera 11:08 o that would be really nice
a trade! haha
taxilian 11:08 oh, and another mode would just be a "blit mode" where it periodically asks you for a pixel buffer and blits however it feels is best
I also have CG blitting code
windows: https://gist.github.com/1068352
mac: https://gist.github.com/1099740
gphysics2014 15:08 I know this is bad programming practice, but I need to delete a file created by another program, from the c drive using my plugin. I am using remove(filename); to do so. This works fine in windows xp but does not work in windows 7. Is there a way to allow my plugin to remove a file from the C: drive in windows 7. Get it to run with administrative access?
taxilian 15:08 nope
however, you could potentially launch an external program and have it request elevation
it'll show a UAC dialog to the user, but it should be possible
gphysics2014 15:08 That was exactly my plan if it wasn't possible. I think i'll write a simple visual basic program to do this and call it with shell execute. Thanks.
taxilian 15:08 I would strongly recommend against shell execute
gphysics2014 15:08 Is there a better way to call an external .exe file?
taxilian 15:08 you also might have to register the exe you'll be calling as "allowed to run elevated" to even be able to request elevation, since in IE on vista and windows7 you'll be in low integrity mode
yeah, CreateProcessEx is probably the best call to use
gphysics2014 15:08 Thanks. I just looked at CreateProcessEx. Looks Good. Registering the exe is fine. This is for a lab and only needs to be installed on about 10 computers so i can manually set the program to run as admin by defualt.
taxilian 15:08 you could also just launch the browser as an administrator
and turn off UAC
gphysics2014 15:08 OK.
Guest80781 22:08 Hi. My plugin got listed in safari and firefox but not in google chrome. Can anyone help me?
taxilian 22:08 what OS?
Guest80781 22:08 Mac OS 10.6.7
taxilian 22:08 hmm. so when you go to about:plugins in chrome it doesn't show up?
Guest80781 22:08 yes
taxilian 22:08 hmm. do you mind sending me your PluginConfig in a pastebin?
Guest80781 22:08 sure. 1 min
taxilian 22:08 .pb
FireBreathBot 22:08 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin. http://fpaste.org, https://pzt.me/, and https://gist.github.com are all good options
Guest80781 22:08 http://fpaste.org/pTwX/
taxilian 22:08 hmm. I don't see any problems offhand. what version of FireBreath are you using?
Guest80781 22:08 1.6
taxilian 22:08 hmm. could you try it with 1.5 and see if that makes a difference? It is possible we broke something and nobody has noticed yet; doesn't seem likely, but it's the easiest thing to try
you tried completely quitting chrome and opening again, I assume?
Guest80781 22:08 yes
taxilian 22:08 try 1.5; I need to put my son to bed, and I don't know how long I'll be. If I don't make it back again tonight I will be online most of the day tomorrow (GMT-0600)