IRC Log Viewer » #firebreath » 2011-03-10

IRC Nick Time (GMT-7) Message
gargle 07:03 Hi
someone here ?
nitrogenycs 07:03 no
welcome :) you have a question?
gargle 07:03 yes, I make a firefox plugin under mac, and when I try to use NPString, there is an error
NPString is already used in fireBreath ?
(error : const struct NPString has no member named UTF8Characters)
nitrogenycs 07:03 is npstring your own class?
there's an NPString in the NPAPI
gargle 07:03 no, mozilla one
saiaman 07:03 hello everyone
nitrogenycs 07:03 hey saiaman
saiaman 07:03 fine nitro ?
nitrogenycs 07:03 gargle: why do you want to use an NPString anywhere?
gargle 07:03 hi saiaman
nitrogenycs 07:03 sure, a bit tired maybe
and you?
saiaman 07:03 tired trying to find out a solution to change homepage of firefox while running
nitrogenycs 07:03 is it that important?
gargle 07:03 I must use NS_GetSpecialDirectory, and the include use NPString
yes :/
saiaman 07:03 gargle : what's your final goal ?
gargle 07:03 i make a FF plugin which use the sound card, and save audio configuration on the computer
nitrogenycs 07:03 gargle: can you copy the problematic piece of code and the compiler error you get to a site like pastebin.com?
saiaman 07:03 hmm ok gargle seems interesting
i will be interested in the part using FF to write this
gargle 07:03 litlle difficult to copy code & result, this is on the other computer
I have done a plugin on M$ (not using firebreath) which do it. And I wouldlike to port it on Firebreath ...
i use the include nsDirectoryServiceUtils.h
saiaman 07:03 nice
if you have some "pieces" of code, showing how to use it .... i'm very interested because it seems to be the way i can modify the homepage of FF while it's running
gargle 07:03 write here ?
#include "nsDirectoryServiceUtils.h" ... nsIFile * dbFile; nsString aPath; nsresult rv = NS_GetSpecialDirectory("Home",&dbFile); rv = dbFile->Append(NS_LITERAL_STRING(".MyFolder")); dbFile->GetPath(aPath); CreateDirectory(aPath.get(),NULL); // create folder if don't exist
saiaman 07:03 euh : pastebin ?
gargle 07:03 http://pastebin.com/rieAJX6p
like that ?
saiaman 07:03 thanks :)
in fact i'll present my problem : when firefox is loaded if i change the pref.js file it does'nt detect modifications
maybe you have some infos about such things ?
gargle 07:03 I think only a stop/start could solve, because it's a litlle like add an extension
saiaman 07:03 in fact my prob is that FF , while closing, writes its current config in pref.js
even if i change pref.js while running it's override because FF hasn't seen the homepage modification
gargle 07:03 what do you change in pref.js ?
because XPCOM could access to a lot of FF parameters, when running
you work under microsoft or other ?
saiaman 07:03 microsoft
sorry was away
work under M$
gargle 07:03 ok, np
Do you look after XPCOM functions ?
saiaman 07:03 and i want to change "browser.startup.homepage
yeah but i don't know how to : from my FB plugin, access this functions ...... without a big warn
got to be away 5 minutes, i'll be back
thanks gargle for your help, you seem to know a lot about ff
gargle 07:03 you make an extension ? because if you JAR it, there is no more warning message
saiaman 08:03 i don't make extension
in fact i explain
my plugin, is an helper for us in order to update our softwares etc...
but i want to be enable to change users homepage from plugin
gargle 08:03 ok, I understand
strange that you get the warning. Gow do you deploy you plugin ?
-G +H
saiaman 08:03 i don't have the warning but i've only tried with javascript
tony__ 08:03 Hi Nitrogencys :)
Ni neilg_
neilg_ 08:03 Hi
gargle 08:03 javascript need to be JAR
saiaman 08:03 trying to get autorisation to access components in navigator
i try to access @mozilla.org/preferences-service;1
:(
i don't know a lot about FF and xpcom .... so i don't know how to access this from my plugin
gargle 08:03 2 min, i search an exemple
saiaman 08:03 :$ thanks so much
gargle 08:03 look this : https://developer.mozilla.org/en/nsIPrefService
there are functions in C++ to modify FF prefs
saiaman 08:03 hmm interesting
so in order to include this functionnalities in my plugin i have to add SDK to my project right ?
gargle 08:03 yes, xulrunner-sdk
saiaman 08:03 waouw
:s i wish i was a C++ god
lol
gargle 08:03 http://doxygen.db48x.net/mozilla-full/html/da/d7b/interfacensIPrefBranch.html ;)
saiaman 09:03 g'morning taxilian :)
taxilian 09:03 Keep in mind the reason FireBreath doesnt use any of those functions is they are mozilla only
ns* functions and includes will not work on ie, chrome, safari, etc
Saiaman: really if you want to change the homepage yiu may want to write an extension instead of or in addition to your plugin
nitrogenycs 09:03 taxilian: I found something interesting regarding v8
there's v8 allowing you to interface v8 with python without any efforts really. Just pass your python objects in or go the opposite way
*pyv8
taxilian 09:03 Cool
nitrogenycs 09:03 there's even a little dom implementation etc
so when the fb-v8 bridge is done you can go a step further and make the browser and python talk together through v8
I will start the project on github in a few mins
taxilian 09:03 Cool
nitrogenycs 09:03 does fbv8 suit you as project name?
taxilian 09:03 Well i gotta get ready for the day and eat and go to class
Sounds fine to me
nitrogenycs 09:03 okay
taxilian 09:03 Im terrible at naming things
:)
Be back in a ho ur
nitrogenycs 09:03 k
tony__ 09:03 hi .. can I get the CGContextRef for mac by FB::PluginWindow *wnd to PluginWindowMacCocoaCG and calling the getContext() method..?
can I get the CGContextRef for mac by casting FB::PluginWindow *wnd to PluginWindowMacCocoaCG and calling the getContext() method..?
kryssi 09:03 Has anyone been loading firebreath dynamically, that is with $(document.body).append("<object ....") ?
I'm having problems with that in Internet Explorer
during startup everything is fine and I can call object's methods and properties but after that the plugin object doesn't recognize any properties or methods
neilg_ 09:03 tony__: That seems like the right thing to do
Though I haven't used the CoreGraphics plugin at alll
kryssi: Sure you're not replacing your plugin object with something else? Or is your plugin causing an exception? Either one of those could explain it...
tony__ 09:03 Thanks neilg_
kryssi 09:03 neilg_: no exceptions are raised
it works on firefox but not on IE
neilg_ 09:03 Are you sure? I don't mean in C++. A JS exception with your object could cause that problem.
Oh, wait, I missed the first part of what you wrote
kryssi 09:03 neilg_: I'm sure I'm not replacing the plugin anywhere in js, I've debugged it, tried to store untouched global reference but no luck
neilg_: in onload event I can read the version property of the plugin
when page loads I cannot anymore
neilg_ 09:03 The way I have it working is to place the plugin object inside of a div
By default the div has no HTML
Then I add the HTML to insert the object using innerHTML
kryssi 09:03 neilg_: I just did that and it works, it seems like jquery append is not working in this case
neilg_ 09:03 I don't know what to say then, could well be a jquery issue with IE then
kryssi 09:03 neilg_: this doesn't work:
$(document.body).append('<object id="coreplugin" type="application/x-coredata-liveedit" width="100" height="100">' + paramhtml + '</object>');
but this works:
document.getElementById('plugincontainer').innerHTML = '<object id="coreplugin" type="application/x-coredata-liveedit" width="100" height="100">' + paramhtml + '</object>';
neilg_ 09:03 Right, that's how I have it working across all browsers
Aviv 09:03 hey guys
anyone here?
neilg_ 09:03 No! :)
Aviv 09:03 haha
how are you Neil?
kryssi 10:03 Just got exception from FB::SimpleStreamHelper::onStreamCompleted in 1.4.1 stream = NULL
class variable stream is used but I think that the local stream parameter should be used
taxilian 10:03 tony__: what version of FireBreath are you using?
kryssi: they should be the same thing
taxilian 10:03 I guess I didn't come back fast enough =]
neilg_: just for your information, kryssi's problem stems from the fact that when you use jquery to create an html element wtih .append it creates the element first, then injects it into the DOM
this causes UIDeactivate to be called on the plugin, which shuts it down
it's a known issue, but the easy workaround is to create the object tag by assigning it to innerhtml
neilg_ 10:03 Ah... That's good to know
I'd only used innerHTML which is why I hadn't seen that strange behaviour!
taxilian 10:03 or even $("#parentDiv").html("<object….>") would probably work
right
I hope to fix that some day
but it's not a simple fix
it will require a semi-major refactor of the activex code
neilg_ 10:03 Does anybody know what needs to be done to get OpenGL working on the Mac using Core Animation?
I have a CAOpenGLLayer, I tried to add it to the layer that FB creates using [layer addSubLayer: myLayer] but... not enough apparently
nitrogenycs 10:03 taxilian: how do I build e.g. the libraries src/libs?
taxilian: I have a repository with v8 and a test plugin ready. The test plugin does a add_firebreath_library(fbv8) in pluginconfig.cmake
taxilian: this doesn't fail, but it also doesn't fail if I do add_firebreath_library('balbalsdsd')
taxilian 10:03 neilg_: if you don't figure it out today, tomorrow I'll be working with Eric and I could ask him
nitrogenycs: where did you put fbv8?
nitrogenycs 10:03 second, I'll make a commit
neilg_ 10:03 taxilian: Thanks, that would be awesome. I'm only half committed to getting it done today, I've just been asked to set up a mac showing off our games for a PAX East event tonight so...
taxilian 10:03 looks like you basically just create a CAOpenGLLayer and call addSublayer on the main layer to add it
what browser are you on?
nitrogenycs 10:03 taxilian: here you go https://github.com/Nitrogenycs/fbv8
oh wait, I need to push first
done
taxilian 10:03 ok… not sure how this works, I confess
what does this repo have?
nitrogenycs 10:03 the readme should tell you how it works
there's the firebreath and v8 directories
which are just externals
include and src are currently empty
in tests I made a test plugin
taxilian 10:03 ugh. wonder how hard it would be to make it so we could build v8 using cmake instead of scons *shudder*
I have to confess, I've never come across libraries that were harder to build than Google's libraries
nitrogenycs 11:03 for me it was quite easy except a little quirk with 64/32-bit mode
because I have everything already installed :)
taxilian 11:03 at least this one can be built with the latest python, looks like
nitrogenycs 11:03 do you use msvc 2008?
if yes, I can send you the binaries
taxilian 11:03 omaha you have to downgrade to 2.4
I usually use 2010, but I have 2008 installed
nitrogenycs 11:03 I need yet to upgrade
taxilian 11:03 it would greatly simplify things if we could make a cmake build configuration for v8
mixing build systems is annoying
however, we don't have to do that now
wait 'til we see if it's useful enough to be worth the trouble
nitrogenycs 11:03 well, I don't want to use this v8 anyway
taxilian 11:03 oh?
nitrogenycs 11:03 I will use the v8 I'm starting in python
that's already built for me :)
starting = importing
taxilian 11:03 so the way that a firebreath library works is it expects the library to be the name of the directory where it is found
and you can set a list of library directories (I hope; untested)
nitrogenycs 11:03 ok, so I better create a folder fbv8 and move src and include there
taxilian 11:03 yeah
in fact, best would be to either have this set up to check out directly into fb_root/src/libs/fbv8 *or* to have a directory inside fbv8 that can be a libs dir
that has a fbv8 subdirectory
nitrogenycs 11:03 ok, so if I put an fbv8 folder at the toplevel of this repo and it holds the src, include and cmakelists.txt this should be fine right?
hmm no, then the deps are gone
the idea was that you can checkout this repo right into a fb_root/src/libs/fbv8 folder
taxilian 11:03 okay
nitrogenycs 11:03 but I can change this
taxilian 11:03 then you probably want to restructure this ab it
I would recommend having a fbv8-test project (or something similar)
that has the submodules for firebreath and v8
nitrogenycs 11:03 yeah
taxilian 11:03 then have a fbv8 project that just has the src, include, and a CMakeLists.txt
nitrogenycs 11:03 will do
well, we'll need a deps directory or similar
taxilian 11:03 how do you mean?
nitrogenycs 11:03 or do you want the user to supply the v8 libs?
taxilian 11:03 unless we can build it with cmake, probably so
for now, anyway
nitrogenycs 11:03 ok
taxilian 11:03 but we can use cmake to help figure out where they went
or even have a dir inside that we try to download them automatically or something
what are the dependencies?
nitrogenycs 11:03 I assume the dependencies will only be v8
and firebreath of course
taxilian 11:03 right; but to build v8, what are the dependencies?
nitrogenycs 11:03 none I think
I just checked out from their git mirror and hit the build button
taxilian 11:03 I guess this depends on how you want to do this; we could actually have cmake check for scons to be installed
and then create a custom project to build the binaries for you using scons
you'd build it from visual studio, but that step would just automatically use scons to build
nitrogenycs 11:03 ya, that's the icing for the cake :)
taxilian 11:03 hehe. we can hit that later; for now, just require the user to do it
nitrogenycs 11:03 you can build v8 in two modes, static and shared
taxilian 11:03 I would vote for static by default on this
but I hate dealing with shared libraries in plugins
nitrogenycs 11:03 well, I am not yet sure how this will work out, but I'd like the user to pass some kind of "pointer to the v8 engine" into the fbv8 library
taxilian 11:03 better would be to have a default place to look for it
convention over configuration
nitrogenycs 11:03 no, this needs to be done at runtime
taxilian 11:03 oh, I misunderstood
nitrogenycs 11:03 e.g. in python I do import pyv8. This loads a .dll which has v8 linked into it statically
so I can e.g. create a new context from python
taxilian 11:03 hmm. I guess we could do it that way, but wouldn't you just want v8 to be running in the majority of cases?
nitrogenycs 11:03 I want to pass this context or whatever it will be into fbv8
taxilian 11:03 (keep talking, I may disappear and reappear; switching classrooms. I'll get the messages still)
nitrogenycs 11:03 yes, I'd probably want to run v8 in most cases. But my python process is different from my plugin process. I need the v8 engine to reside in my python process
hmmmmmmm
damn
if the v8 engine is in the python process and firebreath in the plugin process then I cannot pass data directly between them, I always need ipc
Aviv 11:03 hey guys
i have a quick question
what is the best way to publish plugins?
nitrogenycs 11:03 aviv: what do you mean with publish?
Aviv 11:03 lets say you open FireFox on a clean machine
and go to a website that has flash content
FireFox will automatically recognize that flash is missing
and you will have an option to install flash through FireFox
I want to have the same functionality with my FireBreath plugin
taxilian 11:03 Aviv: I'm not actually sure if it's possible to do that; I've never seen firefox download and run an installer for anything but flash
nitrogenycs 11:03 aviv: towards the bottom of the page is a list of options: http://www.firebreath.org/display/documentation/Deploying+and+updating+your+plugin
taxilian 11:03 yeah; that's all the options we know of
my preference on windows is to create an MSI
which will install for all browsers
nitrogenycs 11:03 aviv: personally I provide a link/image to my installer which the user downloads and runs and that's it
Aviv 11:03 right I agree
but here is the thing
taxilian 11:03 you detect if the plugin is installed using javascript and then give them a download link and using js to wait and do a callback when the plugin appears
Aviv 11:03 I have a specific plugin that is only used for my website
and I don't want to bother the user and to make him have to download and install an MSI
instead, I want the plugin to be installed as seamlessly as possible
taxilian 11:03 Aviv: well, you could write 4 different installers
one firefox xpi
one chrome crx
an IE cab
and then a MSI for those users who are on safari
Aviv 11:03 fantastic. will do
thank you so much guys
taxilian 11:03 but I dont' recommend it
you'll spend more time testing installers than you will doing anything else
Aviv 11:03 why is that?
taxilian 11:03 trust me, I've gone down that route
Aviv 11:03 yeah that makes sense
however its a very simply plugin
taxilian 11:03 there are 100 things that can go wrong with each method
if you just use a simple MSI, then it works everywhere
and installs for everything
an xpi only installs for firefox, only works there
a crx only works and installs for chrome
a cab is sometimes flaky and only works on IE, though that one you can package an MSI and make it install for everything
if anything goes wrong you have no way to find out what happened
totally up to you, but my experience (and I've gone down both routes) is that it's far better to just install with an MSI
also a MSI doesn't require you to refresh the page or restart the browser
Aviv 11:03 right. makes sense.
nitrogenycs_ 11:03 msi is also easier for the user, he's used to downloading and executing installers
unlike installing via browser-specific methods
Aviv 11:03 i actually wont be needing a IE plugin since we use ClickOnce on IE
taxilian 11:03 nitrogenycs_: well, you'd be surprised how many users get lost on simple things… :-P
nitrogenycs 11:03 :) I know
argh, this v8 thing bothers me
taxilian 11:03 Aviv: like I said, it's up to you; I just think you'll waste an awful lot of time on it
even at Facebook they tried doing the individual installers for each browser and finally threw it out to use a single MSI
they do use it in conjunction with Omaha, though
taxilian 11:03 nitrogenycs: whats bothering you about v8?
(sorry I'm slow; we're having a class discussion)
it happens sometimes when the professor doesn't show up....
Aviv 12:03 anyone knows how I wrap a FireBreath plugin in a XPI FireFox extension?
taxilian 12:03 there are docs on it
on mozilla's site
I don't remember offhand
dan2: you're using firefox extensions, do you ahve that info (or a link) handy?
stuartmorgan 12:03 neilg_: are you calling setNeedsDisplay?
neilg_: that's the most common problem I've seen with people new to writing CA plugins
neilg_ 12:03 I... don't think so.
stuartmorgan 12:03 Yeah, then it'll never draw
(unless NSOpenGLLayer does something different than most CALayers)
neilg_ 12:03 So I need to call that on all the layers?
taxilian 12:03 neilg_: if you wanted to be particularly kind, you could put all this information on the mac plugins page on the wiki after you figure it out =]
neilg_ 12:03 I'm creating my own and adding it to the one FB creates
stuartmorgan 12:03 neilg_: I think just the layer you are drawing to
neilg_ 12:03 I absolutely will. I plan on creating a small project that does this for Win & Mac (somebody else can figure out Linux!)
taxilian 12:03 hmm. though interestingly I'm not finding that call in any of our CA code
neilg_ 12:03 Cool, thanks Stuart - I'll try that
taxilian 12:03 let me know how it works
stuartmorgan 12:03 I'm by no means a CA expert, I've just seen people confused by having a layer that implements a drawing callback but not ever seeing it called
neilg_: you should also make sure your layer is sized correctly of course
neilg_ 12:03 Ah! So... Yes, I am calling setNeedsDisplay on my layer
taxilian 12:03 yeah; that is definitely one thing. neilg_: you know you have to draw when notified, not just whenever, right?
neilg_ 12:03 I thought it was the other way around? That I could draw when I wanted and then notify the browser?
taxilian 12:03 stuart will correct me if I'm wrong, I hope, but I believe you tell the browser when you need to draw and then it calls and tells you to do so
stuartmorgan 12:03 Not for CA
taxilian 12:03 lol. which, his or mine? =]
stuartmorgan 12:03 For CA, you draw as you see fit. For ICA, you draw as you see fit then call invalidate
neilg_ is correct
taxilian 12:03 interesting
okay
good to know
stuartmorgan 12:03 taxilian: what you are describing is right for CG
(yes, it kind of sucks, but adding a different invalidating call for ICA wouldn't really have been better)
taxilian 12:03 hmm. that doesn't make sense with what Eric has described on his architecture.. .though I may have misunderstood
it may be different for OGL
stuartmorgan 12:03 The theory when CA was designed was that drawing was totally disconnected between the browser and the plugin
taxilian 12:03 http://developer.apple.com/library/mac/#documentation/graphicsimaging/Reference/CAOpenGLLayer_class/Introduction/Introduction.html
we're drawing when drawInCGLContext is called
neilg_ 12:03 When you say "we"... do you mean FB or do you mean another project you're using FB with?
taxilian 12:03 if I'm reading the code correctly; my ObjC is a little rusty
stuartmorgan 12:03 taxilian: what drives that call though?
taxilian 12:03 I mean a project I'm using FB with
stuartmorgan: nothing in our code, according to Grep
I believe it's CoreAnimation itself
dan2 12:03 taxilian, sure
taxilian, what do you need a link to?
taxilian 12:03 Aviv is trying to figure out how to package a npapi plugin .dll inside an XPI
stuartmorgan 12:03 taxilian: how would CA know when you want to draw?
taxilian 12:03 wondered if you would know how to do that
dan2 12:03 taxilian, that's a piece of cake
stuartmorgan 12:03 The way CALayer normally works is that you implement a draw callback, and then when something like setNeedsDisplay is called, the callback is called
taxilian 12:03 stuartmorgan: I'm not sure; I'll have to wait 'til Eric pops online and double check with him. I could be missing something
dan2 12:03 taxilian, https://developer.mozilla.org/en/Shipping_a_plugin_as_a_Toolkit_bundle
taxilian 12:03 that makes sense
Aviv: did you see that?
stuartmorgan 12:03 Maybe the GL layer is driven by a display link timer, but that seems like it would be odd, since you might not be animating anything
taxilian 12:03 dan2: thanks
stuartmorgan: makes sense; I think you call setNeedsDisplay and then draw when it calls drawInCGLContext
stuartmorgan 12:03 oh I see; CAOpenGLLayer has two modes
So it can work either way
taxilian: are you setting asynchronous to YES?
neilg_ 12:03 I know we're setting asynchronous to NO
taxilian 12:03 looks like it, yes
stuartmorgan 12:03 So that explains it
taxilian 12:03 mlayer.asynchronous = YES;
mlayer.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
mlayer.needsDisplayOnBoundsChange = YES;
stuartmorgan 12:03 taxilian: so you get callbacks, according to the canDraw... response
taxilian 12:03 I'll have to find out more tomorrow; neilg_: in the mean time you could try doing it that way just to see if it makes a difference
stuartmorgan 12:03 when asynchronous is NO, you have to call setNeedsDisplay like a normal CALayer
taxilian 12:03 yeah, we're now firmly beyond where I know enough to talk intelligently =] it makes more sense, though. maybe it'll help neilg_ figure things out =]
stuartmorgan 12:03 neilg_: if you are already calling setNeedsDisplay whenever you want to draw, then I'd check that your frame is right
taxilian 12:03 does anyone know if any modern browsers still use the main entrypoint on mac?
taxilian 12:03 bbl
neilg_ 13:03 Yep, I'll have to look at that. As a test I've had the plugin creating a window and a view of the correct size and then setting the CAOpenGLLayer to it. Now I'm trying to make it attach the CAOpenGLLayer to the CALayer created by FB. I'll get there soon (I hope!)
nitrogenycs 13:03 taxilian_away: I have maybe a better alternative to directly embedding v8
nitrogenycs 14:03 taxilian_away: I hope you return soon, I need to tell you about my world domination plan
sabotaged|wk 14:03 hmm.. if i'm writing to the plugin with cross process in windows, and i get a onWindowDetached event
is it dangerous to keep writing after onWindowDetached returns?
neilg_ 15:03 What do you mean by "writing"?
sabotaged|wk 15:03 oops -- i mean i'm drawing to a HWND cross process
the plugin's window
neilg_ 15:03 The HWND is going to become invalid shortly after getting that event - so yes, it sounds like it would be
sabotaged|wk 15:03 what's worse though -- blocking onWindowDetached until the other process stops, or using something like IsWindow() on the other process to check if it's ok to still write
neilg_ 15:03 Don't block in the plugin - that would be terrible for the user
But why wouldn't you send a message to your other process from the plugin when you get the event?
Then the process shouldn't try to do it anymore and doesn't need to call IsWindow() either
sabotaged|wk 15:03 it's going cross process, there's no guarantee the other process will receive the message before that onWindowDetached returns
maybe i have to use a mutex or something
win32 mutex that is
neilg_ 15:03 Hmm. You could use a named semaphore with a count of 1.
Keep grabbing the semaphore from your process and grab it from the plugin once onWindowDetached is called
That way there shouldn't be any speed penalty
sabotaged|wk 15:03 ok
taxilian 17:03 sabotaged|wk: yes, it is certainly worse to continue using hte HWND than to block — briefly — until you stop trying to use it. yes, you should be able to use a semaphore or mutex or signal or something to detect it
but do not keep using the hwnd after detachedevent returns
sabotaged|wk 17:03 ok
tony__ 21:03 hi taxilian... can I get a pointer to NSView in mac plugin..?
I was able to create a popup window (NSWindow + NSView) , from the js call.. and is working fine..
Is there any way to attach this window to the plugin..
neilg_ u there..?
tony__ 22:03 njan or 5 mani akumbo konde thanna mathiyo
taxilian 22:03 tony__: no
from what I'm told
you can get the CGContext, but not the NSView
tony__ 22:03 ok..
if I cast FB::PluginWindow to FB::PluginWindowMacCocoaCG and call the getcontext()..Am I right..?
taxilian 22:03 with cocoa you only have a valid context during a draw event
to be honest, I'm not sure how that works in CocoaCG
ok, after a little digging
if you handle the RefreshEvent, then during the refreshevent you can call getcontext() and it will work
but that context is only valid during that event
tony__ 22:03 Actually, my plugin need a a repainting of a bitmap 5 times per sec.., I am using a timer fr it and is working great in FB plugin as a popup window...
Is there any hack , to make my NSView as a sub view of plugin..?
taxilian 22:03 no
you can't draw except when the browser tells you to
if you want it to draw 5 times per second you'll have to call InvalidateWindow that many times
and the browser should tell you to draw in response
that's how it is with CG
tony__ 22:03 ok fine
taxilian 22:03 hey, don't look at me =] I didn't make the rules
tony__ 22:03 what about using CA
same principle
taxilian 22:03 there is some discussion about that =]
my understanding is that yes, it's the same principle, though the events come from a different place
tony__ 22:03 may I get the link..?
taxilian 22:03 but some ohers disagree
which link?
tony__ 22:03 discussion ..
taxilian 22:03 sure. http://logs.firebreath.org
it was just an IRC discussion
do a search for CoreAnimation; it was today
tony__ 22:03 ok thanks
may I know how to call invalidateWindow to force a redraw
where can I do that
taxilian 22:03 it's in the conversation
tony__ 22:03 ok
and what about setting up a timer..?
taxilian 22:03 I would imagine that you could just use performSelectorOnMainThread (or whatever that Cocoa call is called)
tony__ 22:03 Sorry for asking too many question at late nght ur time ...
taxilian 22:03 we still haven't created a good timer abstraction for FireBreath
it's on the todo list
tony__ 22:03 ok thats fine
But if you can give some trick to attach NSView created separately , that would be awesome , like , the HWND thing SetParent .. :)
taxilian 22:03 I don't know of any way to do that
I wrote most of FireBreath, but I don't know much about drawing
and less about Mac drawing
most of the information I can give you came from someone else and I haven't personally used
tony__ 22:03 But FB is really good..aved my life actually..I was fedup with the mozilla doc..in my NO FB try ..
thanks alot for the great effort
taxilian 22:03 you're welcome. if you find it that useful, please try to contribute back in some way; there are plenty of options. code, documentation, helping people in the chatroom (particularly when I'm not around).
just whatever you are able to do
tony__ 22:03 sure.. I am ready to contribue a sample mac plugin .. :)
taxilian 22:03 that would be awesome
tony__ 22:03 :)