IRC Log Viewer » #firebreath » 2010-12-21

IRC Nick Time (GMT-7) Message
Taleb 01:12 hi
i have a question
Rayappan 05:12 hi Anybody developing for mac.. I have some novice doubts on how to draw on the plugins..
I would like to use cocoa CG or core animation..
iaincollin 05:12 amackera is the expert on that, will be able to help when he's back
Rayappan 05:12 ok thanks iaicollin
iaincollin 05:12 the guys are very helpful, they are usually get online in a couple of hours or so :)
Rayappan 05:12 ok thanks :)
I am new to mac .. I am windows developer
iaincollin 05:12 taxilian has some super-helpful articles on his blog http://colonelpanic.net/2010/11/firebreath-tips-drawing-on-windows/
Rayappan 05:12 ok thanks :)
may I know which platform do you develop..?
iaincollin 05:12 yeah, I'm fairly new to Windows development too (always avoided Windows specifc C++ in the past [from a Unix / Mac OS background) but liked C#)
this has been my first Windows C++ project actually
Rayappan 05:12 :) and the just opposit for me :)
its my forst objective C / c/c++ for mac :)
For me its enough if I am supplied with a HWND.. I dont know how about mac ;)
iaincollin 05:12 I think the guys (amakera specifically) has been looking at opengl support too
*has/have
The wiki page isn't complete but think it may have some worthwhile reading in the mean time http://www.firebreath.org/display/documentation/Mac+Plugins
gtg, bbl
Rayappan 06:12 Thanks iaincollins
neilg_ 07:12 Rayappan: You want to get the HWND?
That's easy, cast the PluginWindow to a PluginWindowWin - and that has the HWND
We do that with our plugin, we render using either Direct3D or OpenGL
neilg_ 07:12 Wait, I just read further up... I've just realized you're aiming for the Mac. My help wasn't useful at all!
Rayappan 07:12 Hi Neil, I was on another page till now.. just now saw ur message
Thanks for the comments..
Actually I need something like this...
I would like to create a NSView on a secondary thread..and I want to attach that view to this plugin, I hope that normal drawing will work for this window from its thread..
I dont know whether its possible .. and I dont know how about the mouse and key board events for a window on another thread ..
while the main thread is in browser
neilg_ 07:12 I haven't gotten our plugin working on the Mac yet but I think you can't do it exactly like that
I believe you essentially get a "port" - coordinates within a window that tells you where you can render. And you get messages telling you when you should render.
I can only be slighly helpful here because I haven't written any code to do it, I've just read about it
Looking at the PluginWindowMacCocoa headers it looks like that's correct
Rayappan 07:12 ok
Can we detach the plugin from the browser some how..in firebreath..
I mean plugin window goes floating or fullscreen
neilg_ 07:12 So it looks like you cast your PluginWindow to a PluginWindowMacCocoa (there are classes that derive from this base class) and then use getWindowPosition(), getWindowClipping(), getWindowHeight() and getWindowWidth()
Well, you could always create your own window that isn't part of the browser
Rayappan 07:12 ok fine..
neilg_ 07:12 From what I've read it looks like the NPAPI interface on the Mac just isn't very useful for anybody wanting to display graphics
Rayappan 07:12 and is there any magic in firebreath, that these floating windows can be placed in the plugin position in browser...
neilg_ 07:12 The best people to get more information from are amackera and taxilian (I believe amackera is the main guy working on the Mac side of FireBreath) - I can only help you by reading the headers and remembering what I read before we switched to FireBreath (we already had a NPAPI plugin, we switched to FireBreath to get IE support... but it's a really fantastic framework!)
Rayappan 08:12 yes its really fantastic..
I just created a NPAPI pluin which is actually not drawing anything...and it worked great in all browsers in mac.. the plugin actually share the mac desktop to remote users
neilg_ 08:12 I don't really know how you'd do that. It seems like you'd then be duplicating the current way you have to render anyway.
Have you read this doc?
http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066
Rayappan 08:12 I have used firebreath fro it
ok tahnks neilg
no I ahve not read it yet
thanks for sharing
Now my requiremet is a developing a desktop viewer plugin for mac :) ehere I need windowning and drawing :(
neilg_ 08:12 Yup. I'd recommend reading through that document. I'm currently porting our game engine to the Mac and documents like this have really helped
This one specifically was very useful: http://developer.apple.com/library/mac/#documentation/Porting/Conceptual/win32porting/win32porting.html
Rayappan 08:12 ok :)thanks alot
neilg_ 08:12 It sounds like what you're doing is very similar to what I need to do... I just haven't done it yet!
Rayappan 08:12 Actually I am from win32 background
neilg_ 08:12 Me too. Well, Win32 and consoles! The mac is quite different. :)
Rayappan 08:12 yes yes we both are doing same thing :)
yes yes I am developing mac for first time in my 7 years development :)
oh the win32 to mac porting article is really good.. thanks man!
neilg_ 08:12 No problem!
taxilian 08:12 Rayappan: most of the info is on that Mac Plugins page on the wiki; if you have specific questions I can try to answer them, but amackera is really the one who knows the most about mac drawing
I dont' actually use any the drawing APIs in the plugins I work with
iaincollins: any chance you'd be willing to share your wininet code? I would like to add POST support to browserstreams as well as file upload support, and it sounds like you've at least tackled a part of that
iaincollins 08:12 taxilian: oh sure
I actually found WinHTTP to be pretty nice, once I'd gotten over the Hungarian notation in the documentation ;)
taxilian 08:12 awesome =] if you get a second, just email it to me or something
lol
yeah, Microsoft tends to do that a lot...
I actually already had libcurl and openssl stuff for windows going… sorry I would have given it to you if I'd known you were working with it
iaincollins 08:12 oh really? cool!
taxilian 08:12 also a library that uses them
it's all in the 1.4 branch
iaincollins 08:12 ooh neato
taxilian 08:12 not that it helps you now =]
Rayappan 09:12 hi taxillian ..
iaincollins 09:12 hehe, good to know it's not impassable :) I couldn't work out how to build FB with libcurl in a day so ducked it
Rayappan 09:12 thanks for the response
I have a question..
I would like to create a NSView on a secondary thread..and I want to attach that view to this plugin, I hope that normal drawing will work for this window from its thread..
is it possible
taxilian 09:12 Rayappan: it's going to end up working a bit different on different browsers
Rayappan 09:12 ok
taxilian 09:12 have you read the Mac Plugins page that (neilg_, I think) linked you?
Rayappan 09:12 this one from ur blog..
http://colonelpanic.net/2010/11/firebreath-tips-drawing-on-windows/
taxilian 09:12 yeah, that doesn't help you a whole lot on mac, though =] http://www.firebreath.org/display/documentation/Mac+Plugins
amackera just updated that page yesterday
it's not 100% complete, but it has a lot of good info in it
Rayappan 09:12 :) I am ok so far the document goes..:) waiting for the rest :)
taxilian 09:12 ok, just wanted to make sure you'd read that
so you understand that there are multiple drawing models?
I *think* you can use CoreGraphics on all of them, but not 100% certain
Rayappan 09:12 yes yes..I dont need quick draw..
taxilian 09:12 and you don't need CoreAnimation, sounds like, so that helps
so bascially you're going to get a PluginWindow of whatever type it negotiated
Rayappan 09:12 yes..I am ok with core graphics..actually my control is a desktop sharing viewer for online meetings
taxilian 09:12 ooh, the expert
amackera, fix his issues :-P
Rayappan: you'll get one of these objects: https://github.com/firebreath/FireBreath/tree/master/src/PluginWindow/Mac
so you can look at the versions you expect to see to see what you need to get
Rayappan 09:12 ok will do
amackera 09:12 Heyy what's the problem?
Rayappan 09:12 Hi amackera..I am a windows programmer..I am new to mac..
I want to develop a browser plugin for mac
I have a doubt, can I create a NSView in a secondary thread with run loop..and attach this window to the plugin ..
amackera 09:12 Hmm
taxilian 09:12 I'll be back on later; gotta go shower and then head to work
amackera 09:12 ttyl!
Rayappan: I am not sure about this, I've never tried to do it
Rayappan: I think that it will be problematic... all Mac plugins are windowless but I'm not 100% sure why
I believe it's due to a limitation in Mac OS X (or a design decision)
Having said that it might be possible, I'm not sure :S
Rayappan 09:12 ok thanks for the info..:)
may I know where should I start for drawing my pluging using core graphics ..
hopefully wehn we get ur doc regarding mac plugin completed ..
amackera 09:12 Rayappan: Yes, that doc is still a work in progress (I will be filling it out over the course of the week though)
Rayappan 09:12 'ok :)
iaincollins 10:12 taxilian_away: http://iaincollins.com/WinHttpClient.zip - It's pretty basic usage (POST, GET, Session (cookie) support, HTTP Auth) but might be vaguely useful
oh and, oops I think the connect & request timeouts are hard coded at 5000 milliseconds in that example, but is easy enough to find where that is.
taxilian 11:12 iaincollins: sounds like most of what I need
amackera 11:12 <-- total noob: just spend 10 minutes trying to debug symbol not found compile time errors that just needed the boot:: namespace
heh, boost::
taxilian 11:12 lol
amackera 11:12 I think the only thing missing from our loggin abstraction is a decent way to tell the logger where to dump the logfile
logging*
and by decent i mean not a hard-coded string in the source file
taxilian 11:12 wait... that doesn't qualify as "decent"?
that should probably go in the factory, I would think
since factory is also kinda a configuration factory =]
taxilian 12:12 somehow my std::string is getting released while still inside a variant... this is really weird
Rayappan 12:12 hi..
taxilian 12:12 howdy
Rayappan 12:12 http://pastebin.com/scfUHeu7
taxilian 12:12 http://www.firebreath.org/display/documentation/Using+Libraries.
http://www.firebreath.org/display/documentation/Using+Libraries
Rayappan 12:12 ok
taxilian 13:12 glad I could help =]
iaincollins|away 14:12 taxilian: am not really here, but if feel free to outline what you are looking for can try and come up with a half decent implimentation of it
(also, not forgotten about the IRC logs thing, aiming at finally doing that on Thursday :)
taxilian 14:12 iaincollins: basically I just need to extend BrowserStream to support POST
and I need a (seperate) API that supports uploading files via POST and sending progress updates probably via an event; that one will need to use WinHTTP on all windows browsers
there is already a class that does this with libcurl and openssl in 1.4 called HttpClient (it's in src/libs/HTTPService)
the interface might need to be tweaked, though
iaincollins|away: and if you do have time to do the logs thing, that would be awesome!
FB_GitHubBot 14:12 FireBreath: master Richard Bateman * 5f0163e (14 files in 8 dirs): - Moved the setAPI (creates root JSAPI object) to after params are passed in on IE ... - http://bit.ly/f4ms2C
taxilian 16:12 does anyone see a problem if I make static init get called sooner and static finit later in the lifecycle?
neilg_ 16:12 Nothing springs to mind
taxilian 16:12 cool. I *might* be able to get permission to open source (to some extent, anyway) the plugin I'm working on for Facebook
taxilian 16:12 anyone here used opengl on linux in a plugin yet?
kylehuff 17:12 nope; but I can test something if you like.
taxilian 17:12 oh, I was just wondering if anyone knew the answer to someone's question on StackOverflow is all
taxilian 17:12 grr. did something and suddenly the npapi half of my plugin doesn't load
no idea why
didn't change the resources or anything
doesn't even hit the entrypoints