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

IRC Nick Time (GMT-7) Message
linearray 07:11 good morning, gentlemen
tpaul 09:11 When adding new headers and cpp files in visual studio, is the best approach to manually add the files (in explorer for instance), then re-run the prep scripts?
Dan8464 09:11 yes, you shouldn't do it from in vstudio since then you lose the ability to use the prep script / lose platform compatibilty
rerunning the prep script re-generates all the vcproj files and so forth
taxilian 09:11 tpaul, yeah, tha'ts the easiest
you can do it from vstudio if you're careful to put them in the right place so that they'll be caught by the prep script, but it's far easier to just do it manually
linearray 10:11 so here I am with an FB::PluginWindow* in one hand and the urge to display an NSOpenPanel in the other
where do I start reading?
taxilian 10:11 you don't need the PluginWindow
did you not see the code I sent you?
linearray 10:11 I did, and it crashes at result = [oPanel runModal];
taxilian 10:11 ? that code exactly as it is runs perfectly for me
you arne't trying to call _showFolderDialog instead of OpenFolderDialog, are you?
linearray 10:11 hehe no
ok, I will play with it some more
crash is: EXC_BAD_ACCESS
is there anything that needs to be enabled in PluginConfig.cmake for this to work?
taxilian 10:11 EXC_BAD_ACCESS implies that you have a null pointer somewhere
and no, you don't need anything in pluginconfig
linearray 10:11 ahh, uncaught exception
linearray 11:11 gotta love errors like that... I changed nothing at all, recompiled, now it works
taxilian 11:11 lol
linearray 11:11 bam, and crashing again
cadguy 12:11 Hi all...this is a crazy question. I have FireBreath based plugin in the browser. Now I want to move this to the server. Is there a way this whole plugin could work on the serverside?
taxilian 12:11 nope
cadguy 12:11 Is it too far fetched to ask for it?
linearray 12:11 explain what exactly you have in mind
because right now I would recommend you to run a web browser on your server
cadguy 12:11 I am doing CAD/WebGL based using a C++ kernel in browser. Great!. The paying customers love it, the consumers hate the plugin, so I want to move the PlugIn to serverside (without much re-ingineering). There is V8 at the why not NPAPI and FireBreath?
I am putting a wire between my Javascript and the PlugIn. Why not?
Ola Senor?
linearray 12:11 sorry, the thought of npapi on the server made my head spin
taxilian 12:11 heheh. NPAPI on the server would be completely pointless
you can already run C++ applications on the server
linearray 12:11 I'm still not sure what exactly you want or need, but it sounds like you need CGI
taxilian 12:11 the trick is figuring out how to run the application on the server in such a way that it's useful on the client
yeah; CGI or FastCGI, etc. anything you can do with PHP or Perl or Python you can do in C++
cadguy 12:11 My CAD kernel is all C++ and it in the browserside PlugIn
taxilian 12:11 and what does it do?
event handling?
simply processing?
cadguy 12:11 It computes the CAD geometry and serves up facet JSON to scene JSON for WebGL
taxilian 12:11 if it's serving JSON and you're rendering that using javascript then yes, you could probably move that to the server
cadguy 12:11 That's our IP and it is all in C++ since we are coming from desktop land
taxilian 12:11 you could look at something like this:
you'll basically need to make a web server; you can do that using C++
it'd be just like writing a python app backend or PHP app, except you leave it in C++
cadguy 12:11 It is simpler than V8 addons, protobuff for node
taxilian 12:11 that would be another option, I guess
I don't know what is simpler; I have never done it
however, it is certainly possible
but trying to use NPAPI on the server is like trying to figure out how to make a tractor swim
it doesn't really make any sense
NPAPI is a protocol designed for client-side applications; it doesn't have any relevance in a server environment
cadguy 12:11 I wanted to move the home with the foundation. You are asking me to move just the home and build a new foundation
taxilian 12:11 I am telling you that if you try to move your foundation you'll end up having to construct a mountain to put it on in the middle of the desert
they are completely, totally, incompatible concepts
there is no point, no benefit, no advantage to trying to use NPAPI on the server
cadguy 12:11 I thought NPAPI was thunking between JS and C++
taxilian 12:11 not at all
that's NPRuntime
cadguy 12:11 So, why not the same in V8 on serverside
taxilian 12:11 NPAPI is the interface between the browser and the client
if you want the interface between JS and C++ from FireBreath, that might actually be useful to you
but tha'ts not NPAPI
are you using FireBreath?
cadguy 12:11 My question actually should have been: Can I use my client side plugin on the serveside? Still NO?
taxilian 12:11 the exact same plugin?
cadguy 12:11 Yes!, I am using FreBreath
taxilian 12:11 you could probably do it, but it would be a lot of work
it would make a lot more sense to make a seperate tool that would use the same libraries as your plugin
you could even create a JSAPI adapter for node, I suppose, and use your same JSAPI object
that might be kinda cool
to use your full plugin you'd have to write a NPAPI host that would fake out all of the pieces of NPAPI
which requires a lot of in-depth understanding of how NPAPI works
I could do it, but it'd take me a couple of weeks
you'd be a lot better off just using pieces
cadguy 12:11 But, this is a generic requirement. Quite a lot of folks hate a plugIn
taxilian 12:11 yes, but most plugins are written to be plugins and wouldn't actually work on the server
cadguy 12:11 And the reverse is true too. The serverside latency could kill, my Serverside plugin should work client side too.
taxilian 12:11 you could do it; there is even the beginnings of a NPAPI host project in the firebreath codebase
but it'll take a lot of work
cadguy 12:11 ok!...
What was the JSAPI adaptor?
taxilian 12:11 !findfile IDispatchAPI
FireBreathBot 12:11 Found 2 matching file(s) in the master branch. First 2 are:
taxilian 12:11 !findfile NPObjectAPI
FireBreathBot 12:11 Found 2 matching file(s) in the master branch. First 2 are:
taxilian 12:11 !findfile NPJavascriptObject
FireBreathBot 12:11 Found 3 matching file(s) in the master branch. First 3 are:
taxilian 12:11 those are the adapters for the current javascript engines; one that gets sent to the browser with a JSAPI object in it, one that wraps an object from the browser and provides a JSAPI interface
those two things for each type of javascript engine you need to wrok with
there is also an adapter for JavaScriptCore, which is what Safari uses
you could probably make one for V8
cadguy 12:11 Hmm...that is all new to me. So, my choices are: V8 addon, proto-buf for node or fastcgipp
taxilian 12:11 or something else. fastcgipp is just the first result when I googled "c++ fastcgi"
cadguy 12:11 Alright!...I will explore V8 addon. I have about 40 functions that need to be moved to server sidde
Gracias! amigoes
taxilian 12:11 good luck
ssdc 12:11 Hi! Wondering if someone would be able to help me out with a Firebreath/Objective C++ question?
taxilian 12:11 .ask
FireBreathBot 12:11 If you need help, just ask your question and wait for people to come back.
ssdc 12:11 Ok - quick overview - I want to call into LaunchServices to see if a particular application is installed.
It returns a NSURL object
How do I convert an NSURL to a C++ string to return via the JS api?
taxilian 12:11 you convert it to a NSString and then you convert that to a std::string
ssdc 12:11 by casting?
taxilian 12:11 .lmgt convert NSString to std::string
!lmgt convert NSString to std::string
FireBreathBot 12:11 Let me google that for you:
linearray 12:11 there are NSURL functions that give you a NSString
ssdc 12:11 nice. thanks
taxilian 12:11 yw =]
good luck
linearray 12:11 can you take a quick glimpse over this and tell me if there's something obvious I'm doing wrong?
taxilian 12:11 what is happening?
same crash?
linearray 12:11 yes, sometimes
taxilian 12:11 what line?
linearray 12:11 45
taxilian 12:11 oh, I See
you have a comment
linearray 12:11 it works 2-3 times, then it crashes
taxilian 12:11 are you reloading the page or anything between attempts?
linearray 12:11 ohhh wait a second
(no, not reloading)
ok, 'out' was uninitialized but that didn't help.
taxilian 13:11 yeah; it's an object, doesn't need to be explicitly initialized
linearray 13:11 ah true: Content is initialized to an empty string.
taxilian 13:11 hmm. nothing comes to mind; it looks like it should be fine
linearray 13:11 I found some hits with the same problem but no solution
taxilian 13:11 heh.
linearray 13:11 exactly :)
taxilian 13:11 try using the same line I did for getting a directory instead of a file
see if it makes a difference
I'm going to go get some lunch
I really don't have any ideas :-/
linearray 13:11 bon apetit
linearray 13:11 ok, this is very very interesting
safari actually produces nice crash logs
and it's crashing in a different thread in NSDateFormatter
some stuff it uses for the dialog
taxilian 13:11 huh
linearray 13:11 wanna bet it works once I set date format to US? :)
taxilian 13:11 lol
you can try it
linearray 14:11 do you know of a way to make chrome write crash dumps? It seems to do it only for certain signals
ahh, that's breakpad
taxilian 14:11 Chrome seems to always write dumps for me when the plugin crashes
linearray 14:11 the nice folks in #macdev solved it
I think.
UI must run on the main thread
solution: wrap the body of _showFolderDialog in dispatch_sync(dispatch_get_main_queue(), ^ {/* body */});
LostInEvents 15:11 Hi all, I've got a question about firing an event from the plugin code
linearray 15:11 what's up
LostInEvents 15:11 I've defined an event in the API using FB_JSAPI_EVENT(foo, ...)
Now I'd like to fire that event from my plugin code (not from the API code)
How can I do that?
From the API I can call fire_foo(), but from the plugin...?
linearray 15:11 I guess one way is to have a method in your JSAPI that just fires the event
LostInEvents 15:11 Hmm. Unfortunately the API doesn't know when to fire the event.
linearray 15:11 that's why you call the method when it's time
LostInEvents 15:11 OK, so save the pointer to the JSAPI object in the plugin's createJSAPI method, and then invoke a new event helper method using that pointer when it's time?
linearray 15:11 there is also getRootJSAPI() on your plugin object
I would try that.
LostInEvents 15:11 ...trying to cast FB::JSAPIPtr into my pluginAPI so I can invoke a method...
linearray 15:11 hm yeah
IIRC this is useful:
LostInEvents 15:11 Yes, very helpful & it worked (at least everything built). Unfortunately I have to close this browser to be able to link the plugin again & test it. Thanks for your help.
LostInEvents 16:11 @linearray - Thanks for your help earlier, Event firing is now working from the plugin. Cheers!
linearray 16:11 xcode is so awesome
visual studio is dead as disco
dougma 18:11 xcode profiler thingy is nice...
otherwise, I find visual studio way faster