|IRC Nick||Time (GMT-7)||Message|
how can I make a "fullscreen" button on my plugin on Mac with CG?
i mean I don't need an actual button, I'm interested in the way how to make a pluginwindow fullscreen
|kun||09:02||someone there for help?|
|kun||09:02||I just wanna know which method is called when the browser will be closed or the plugin will be reloaded???|
kun: have a look at that
|kun||09:02||thanks I will have a look ;)|
|reichi||09:02||in general you should at least read the "Using FireBreath" section|
|kun||09:02||I did..but not the section with the lifecycle^^|
|taxilian||10:02||mkoch: to do fullscreen with your plugin you'll have to create a new window and draw to that|
|nirvdrum||13:02||Out of curiosity, do any of you do Mac plugin contract work?|
|taxilian||13:02||I have in the past, but I'm swamped right now
what do you have going on?
|nirvdrum||13:02||I need to port something I wrote in NPAPI on Windows, but it's currently pretty tied to the Win32 API.
I don't know Cocoa well enough to know what's involved.
|taxilian||13:02||wrote in NPAPI? not FireBreath?|
|nirvdrum||13:02||Sorry, in Firebreath.
But it's not targeted at IE.
|taxilian||13:02||oh, good. my feelings are no longer hurt ;-)|
|nirvdrum||13:02||That was really what I meant.|
|taxilian||13:02||I could probably help you figure out the path to take, but I don't have a lot of time|
|nirvdrum||13:02||But basically I need to be able to capture the entire rendered canvas of a page.
I came up with this crazy approach for Windows: http://nirvdrum.com/2010/03/25/how-to-take-full-page-or-full-canvas-screenshots-in-windows.html
|taxilian||13:02||I didn't realize you didn't have mogotest working on mac yet|
|nirvdrum||13:02||I was putting it off. Mac doesn't run on EC2.|
|nirvdrum||13:02||If I could get Safari on Windows going, I could probably stave it off even longer.
But that's been a nightmare.
|taxilian||13:02||Hmm. I have a strong suspicion that it's not going to be terribly simple on Mac either
first of all, it's not going to be easy to figure out which page you're on
|nirvdrum||13:02||The issue on Windows is Selenium can't drive Safari.|
|taxilian||13:02||on Mac you don't have any direct link between your plugin and the drawing context of your page|
|nirvdrum||13:02||Some security restriction. On Mac you don't have it, apparently.|
|taxilian||13:02||it's not like windows where you can just go up the chain from child to parent|
|nirvdrum||13:02||taxilian: Even if It can guarantee it'll only ever be a single tab?|
|taxilian||13:02||what you probably can do is enumerate running apps and find the window for Safari
then you can try to decend through the heirerchy
so it might be doable, but it's going to be a bit tricky
|nirvdrum||13:02||It's been a while since I looked, but I thought NPAPI had a way of fetching a drawing context.|
|taxilian||13:02||and in point of fact being in a plugin won't actually buy you anything; it might be easier to do it from an external applciation
sure it does
|taxilian||13:02||that drawing context just has nothing to do with the actual context of the page
you draw to a CGContext which is just an in-memory buffer
which gets rendered to the real contenxt
|nirvdrum||13:02||The point of it being a plugin is I drive the browser with Selenium first, then I inject some JS to load the plugin and capture.
It's a lot easier to do it basically in process (even if the plugin container actually runs out of process).
|taxilian||13:02||if you are willing to restrict it to 32 bit versions of safari there are some hacks you can do that might give you that, but I wouldn't expect it to last many more versions of mac os|
|taxilian||13:02||anyway, it's going to be a "fun" project, I suspect
but I'm sure you'll figure something out
|nirvdrum||13:02||Thanks for the encouragement :-P|
no problem :-P
always happy to help a friend
this might be interesting reading; it captures a full screen: http://developer.apple.com/library/mac/#samplecode/ScreenSnapshot/Listings/ScreenSnapshot_ScreenSnapshotAppDelegate_m.html#//apple_ref/doc/uid/DTS40011158-ScreenSnapshot_ScreenSnapshotAppDelegate_m-DontLinkElementID_9
what you want to do might be similar in principle
I search the way to port an existing game coded in C++ and using DirectX into a web browser, a little like Unity Engine Web Plugin. Is it something possible with FireBreath please ?
and has been done before
may or may not be easy
depends on how well your game is written; if it is like most games, it'll be a pain
|eKyNoX||14:02||old game but famous :)
1998 / 1999
1998 / 1999
|taxilian||14:02||the main things that make it difficult for most games: 1) you dont' own the process, so you can't rely on things like the cwd being valid
2) your process in IE may be in low integrity mode, so you can't write to most places on the hard drive, only "safe" parts of the user's profile
3) your process may have several instances of your plugin running at the same time
4) your process is not shut down between instances, so if you aren't cleaning up your globals you may be a heap of trouble
those things apply to all plugins, of course, but game code is notoriously bad at things like that
|eKyNoX||14:02||2, 3 and 4, that's ok :)
1, what's cwd ?
|taxilian||14:02||current working directory|
opengl also ? I figure FireBreath works like a tunnel between OS and browsers
I have to read anyway :)
|taxilian||14:02||firebreath is just a framework to let you tie into the APIs that the browsers expose
it simplifies a lot
but on windows you can get the raw HWND of your plugin
if you need your own winproc you can create a child window of that window
|eKyNoX||14:02||raw HWND ?
|taxilian||14:02||as opposed to mac where you can't actually get the window, you just get a context to draw to|
|eKyNoX||14:02||sounds good, I did not see any other peoples proposing a framework like that|
|taxilian||14:02||there are two "competitors" to FireBreath; JUCE and qtbrowserplugin|
|eKyNoX||14:02||So thank u|
|taxilian||14:02||neither is as extensive as FireBreath, but you're welcome to look at them
and of course you could do it by hand and just write the NPAPI and ActiveX code yourself, but I really don't recommend that =]
I'll study the possibilities, and on my way, to learn c++ syntax. My main language is C# (did not choosen my professor)
|taxilian||14:02||your biggest challenge will be picking up C++, then|
I like challenges :P
Thanks for all this informations
Another (missed) question, what about the network ? The game I would like to port is an existing MMO. Does the framework got some network functions ? Or way to use the existing ones ?
|taxilian||14:02||it's just C++; you can access system APIs or use whatever network stack you want
there are some tools for making HTTP requests through the browser
and boost is used heavily so you can use boost::asio if you'd like
|eKyNoX||14:02||Ok, game using a lot of UDP
Thanks again :)
|FireBreathBot||15:02||Commit 902bfda on firebreath-1.6 by Richard Bateman: "Fixed bug in JSAPIAuto attributes" http://goo.gl/sdjnC
Commit a32b6d2 on firebreath-1.6 by Neil Forrest: "Added firing of MouseScrollEvent on windows.
Commit 58005b2 on firebreath-1.6 by Richard Bateman: "Merge pull request #40 from neilforrest/master
Commit 5286eec on firebreath-1.6 by Christian Hofstaedtler: "FIREBREATH-158: Delay initialization log until after InitLog..." http://goo.gl/DVCXx
Commit 03956b9 on firebreath-1.6 by Richard Bateman: "Merge pull request #41 from zeha/no_log4cpus_complaints
Commit 007361a on firebreath-1.6 by Richard Bateman: "FIREBREATH-156: fixed 10.4 mac os SDK build bugs" http://goo.gl/kNxTY
Commit 007361a on master by Richard Bateman: "FIREBREATH-156: fixed 10.4 mac os SDK build bugs" http://goo.gl/kNxTY
|jshanab||19:02||I want to add Mac to my plugin and am looking at the BasicMediaPlayer and the auto generated np_macmain.cpp. BasicMediaPlayer does not have this file, do i need it, is it for NPAPI only and BasicMediaPlayer doesn't do mozilla?|
|taxilian||22:02||jshanab: np_macmain.cpp no longer needs to be in your project
FireBreathBot: tell jshanab np_macmain.cpp no longer needs to be in your project