IRC Log Viewer » #firebreath » 2012-11-19

IRC Nick Time (GMT-7) Message
AndrewMac 03:11 hey guys
are there any examples for writing the jscript side in one of the browsers to interact with the plugins, specifically for now I just want to retrieve the DOM, pass it to the dll and then have it update the page (highlight specific words and so on)
JuanDaugherty 04:11 the FBAXExample app due to schellenbach as modified for 1.6 and later doesn't build in current FB
(due to line 37 in axwrapper.h)
JuanDaugherty 05:11 that was in vs2k5, apparently does build in 2010
spoke too soon
yeah same in both
cemeheeb 06:11 hi everyone! excuse me for my bad english. When i build a blank generated project, - workings fine! But no one of mouse or keyboard events are not raises. When i add RefreshEvent - same situation. Trying to connect with debugger and successfull breakpointed at onWindowAttached and Detached methods. platform - win7, IDE - vs2012
may be someone can navigate me to manual or discussion about same problem?
JuanDaugherty 07:11 cemeheeb, you need to break in the window proc
also you've not made clear if you doing npapi or active x
but basically this is stuff you as a programmer need to figure out effectively for yourself; other workers here will help and the FB principal developer is here frequently and is quite helpful
jshanab 07:11 cemeheeb. You overloaded the OnMouseMove in your plugin and added to the event map?
Sorry. no need to ad to event map. but must add onMouseUp,onMouseDown,OnKey ...etc
cemeheeb 07:11 jshanab, yes i implement onMouseUp onMouseDown ... methods, now i figured what a line in MyPlugConfig.cmake should be commented at line Set (FB_GUI_DISABLED 1)
i not sure that firebreath will be generate any mouse and keyboard events when FB_GUI_DISABLED flag is setted to 1
jshanab 07:11 I am not familiar with that flag. But no window no mouse events, they are very related
JuanDaugherty 07:11 it's standard at the begin of project generation
if you don't use the cmake stuff you wouldn't see it
jshanab 07:11 However, if javascript on the page will resond to events, then you just call the javascriptAPI that you write to connect it up
Why on earth would anyone avoid the cmake stuff? just curious. I know of no other cross platform build system that compares for c++
JuanDaugherty 07:11 reichi doesn't
reichi 07:11 i did
totally true
JuanDaugherty 07:11 thought it was you but could only be you or him
reichi 07:11 i am on linux
i basically created my project once
and then switched to automake
for easier integration into our existing build environment
which is openembedded based
JuanDaugherty 07:11 I avoid it/work around it where I can, it's a pain
but I do use at start of a dev cycle
reichi 07:11 + a dependent project has tons of depends which are very easily resolved by pkg-config
resolving in cmake is freaking pita
while it's a 3-liner in automake
jshanab 07:11 Sorry, that is a method I will avoid, it is a one way street that leaves you at a dead end. No reason you could not of put in a one linaer that generates the makefile as part of your build process. Cmake is NOT a build system. Make is. Use cmake to generate your make
reichi 07:11 i'm using FB on a linux-only embedded system
with my own platform classes
so it is a VERY special case
if special requirements
i would not generally recommend anyone to move away from cmake
jshanab 07:11 I can see where that could throw a wrench in the works.
Nowadays, embedded is a very grey line
reichi 07:11 but in our case it was very very proper to do so
because integrating a cmake project with openembedded isn't that easy to do either..
jshanab 07:11 (If it will run the browser that accepts a plugin, it will run this build system)
reichi 07:11 it's qt
with qtwebkit
jshanab 07:11 I did openembedded once myself. Long ago.
reichi 07:11 so it uses qmake ;)
(the browser)
jshanab 07:11 fun.
reichi 07:11 even qtwebkit had to be patched
to run npapi on embedded
it usually doesn't ;)
i think cmake is fine for FB
and what it's designed for
but on pure linux projects cmake feels painful for me
maybe just because i don't know it well enough
JuanDaugherty 07:11 yeah I don't like stuff getting in my way
jshanab 07:11 cmake is very "make" like once you get past the assumption that it is a build system :-) For me the good part is it can be one makefile that generates VS2010,VS2008,mac,makefile and My favorite CPACK creates the installers on all three. :-)
JuanDaugherty 07:11 and it gets in the way of working freely with VS settings
reichi 07:11 it's just not integrating well with automake based projects
you basically have to do everything all over again
but in cmake
JuanDaugherty 07:11 that and you have to go on a discovery process to see what's what in the cmake sources, which I don't wanna do
reichi 07:11 if you're cross-platfrom
JuanDaugherty 07:11 would be different if I weren't focused on just a single platform
reichi 07:11 i wouldn't turn away from cmake i think
but otherwise i think it's ok to use cmake to generate all the stuff
and go on without it aferwards
JuanDaugherty 07:11 yeah, I just synced up with master and it's not a big deal
so once i have a working bld tree, I ignore cmake
reichi 07:11 that's basically what i did ;)
AndrewMac 08:11 des anyone have an example using boost::regex within firebreath?
taxilian 08:11 good morning
reichi 08:11 morning taxilian
JuanDaugherty 08:11 yello taxilian
you should decommit Safari on Windows
since Apple apparently has
taxilian 09:11 I'll have to play with it; it was working last time I tried
but I've heard a few reports lately
JuanDaugherty 09:11 the reasons are a) they're not distibuting it anymore and b) they block MIME types they wanna handle as if it were their platform
admittedly the last mostly applies to people like me handling known MIME types
the first is the real reason, there's no point in it with Chrome these days
taxilian 09:11 yeah
JuanDaugherty 09:11 CFBControl has more superclasses than I think I've ever seen
taxilian 09:11 welcome to the wonderful world of ActiveX
JuanDaugherty 09:11 could have been done differently
taxilian 09:11 activex or cfbcontrol?
JuanDaugherty 09:11 surprised none if this ....
activex is a namespace isn't it, not a class
i.e. fb::activex
taxilian 09:11 yes, FB::ActveX is a namespace
JuanDaugherty 09:11 *none of this was exposed in PluginAuto or wherever so you could customize the control
taxilian 09:11 very little of it makes sense to be
JuanDaugherty 09:11 I wonder if e was in semipalatinsk oder
taxilian 09:11 but I think there is actually a factory function you can use to change which class ot instantiate
activex is a royal pain to work with, though, so there might not be
what did you need to customize, exactly?
JuanDaugherty 09:11 the control generally, you remember the app don't you. NPAPI is done so dealing with the AX leg
taxilian 09:11 I see
well, good luck
JuanDaugherty 09:11 I'm fortunate in it being a migration/coversion as well as being an ancient of the platform
taxilian 09:11 when you get the unsolicited streams working I'd love to see some code samples; I'd like to pull that into the core codebase
JuanDaugherty 09:11 well the np leg is working now
in FF anyway, it's a little different in each, I'm only supporting IE, FF, Chrome, Opera and on 64 only IE and FF
in the NP I was able to keep changes outside the project to a minimum, looks like that might not be the case with the ATL stuff
but I'm conceptually clear and not hesitant about the MFC AX to ATL move of the legacy code set
should be working later today
or tomorrow, it's a lot of crap
taxilian 09:11 cool
diorcety 11:11 Hi
static std::string getFSPath() { return BrowserPlugin::getFSPath(); }
it is not the same now? Why it was changed?
taxilian 11:11 on the phone; give me a few
taxilian 12:11 diorcety: it still does the same thing
it just does it in a slightly different way
the main reason it was changed is because I found some cases when I needed the path besides just in PluginCore
so I made it a static method of BrowserPlugin
but kept that method for backwards compatibility
diorcety 12:11 i can't find it in the master
neither in 1.6
taxilian 12:11 find what exactly?
diorcety 12:11 static function in BrowserPlugin: getFSPath
taxilian 12:11 it is there
otherwise it wouldn't link
on the phone again
diorcety 12:11
taxilian 12:11
yoiu're on your branch
which doesn't have it
you might want to pull =]
diorcety 12:11 gniiiii
jshanab 12:11 I am calling the windows function GetWindowInfo from inside my plugin after I am handed the window handle in FB. But I get a very strange rectangle. 0,0,18000,18000
If I step slowly, i will get the correct 0,0,300,300
Any ideas?
taxilian 12:11 huh
jshanab 12:11 It is very strange. It is soemthing that has always just worked
jshanab 13:11 Here is a strange one. if i step thru the code not only do all the values look fine, it works. If allowed to run at speed, it fails
So some kind of a race, like the window is not yet complete when I get the onAttachWindow. Apparently it must handle a certian message before it has set all the info
jshanab 13:11 When I am inside a plugin, what is the best way to get the window size?
jshanab 13:11 taxilian. I discovered something strange. I have a condition variable that blocks my main loop until the onWindowAttached event arrives. The first thing i do is ask it's size. It comes back as 18000 x 18000. If i put a sleep(2000) before the call, I get the window size of 300,300 (from FBControl)
So the event being used to fire the onWindowAttach is a bit early in the life of a window.??
taxillian. looking at PluginEventSource, when it adds the observer, it fires an event? (line 42 PluginEventSource::AttachObserver)
taxilian 14:11 jshanab: yes
jshanab 14:11 But looking furthor into the stack. it is NPP_SetWindow that is jumping the gun
glock45 14:11 hi, any issues with mac 10.8.2 ?
and chrome > 20 ?
taxilian 14:11 not that I know of
glock45 14:11 simply, chrome don't load plugin
taxilian 14:11 did you build the plugin 64 bit only?
glock45 14:11 with chrome update it just stoped worked :]
(disclamer: I don't use Firebreath. I do build it from scratch )
taxilian 14:11 I don't know
my plugins still work fine
glock45 14:11 ok
it's my fault I guess :)
taxilian 14:11 guess so ;-)
let me know when you figure it out; I'm curious to hear what it is
glock45 14:11 ok. really strange :] I do both arch
diorcety 15:11 when the 1.7 release is scheduled?
taxilian 15:11 whenever I have time to finish it
it's pretty stable except for a few minor things
JuanDaugherty 15:11 in case you didn't get it diorcety, you actually just asked, "when will 1.8 begin?"
correct me if I'm taxillian but 1.7 is current
taxilian 15:11 1.7 isn't officially stable
but it probably should be
considered so
JuanDaugherty 15:11 in any case that
's what master is now
taxilian 15:11 master is always the development branch
though I try to keep it stable
sometimes master does have things for a bit before they are sent to 1.7
JuanDaugherty 15:11 which is at taxillian instead of firebreath?
(i.e. 1.7)
taxilian 15:11 ?
you mean my personal fork?
diorcety 15:11 is it possible to make a SimpleStreamHelper but with a progress callback?
taxilian 15:11 certainly; feel free to make it =]
I just haven't had time
diorcety 15:11 ok
i will try :)
taxilian 16:11 diorcety make sure you do it on 1.7
there was a significant-ish refactor of the internals of requests in 1.7
diorcety 16:11 ok
jshanab 16:11 taxillian. I found out why my plugin fails on XP. I am using GLFW for opengl abstraction, it is C and uses Thread local storage. In pre-vista OS;s this does not work in a dll. So I was hoping maybe FB can help. The dll can use the TLSapi to ask for memory at load time. my lib cannot cause it needs to be in the dll entry point. I guess I could make it a dll and then it can take care of...
taxilian 16:11 not sure I understand
you can override the firebreath endpoints if you need to
jshanab 16:11 look at the last 2 paragraphs. The library has a static pointer declared with __declspec(thread)
taxilian 16:11 okay… and why can't you just do that in your DLL?
jshanab 16:11 Maybe...Boost to the rescue
I have never tried to use boost inside a C lib
taxilian 16:11 boost is c++
jshanab 17:11 I really need to re-write their lib in c++ but... ouch.
The promotion breaks a lot
How does the firebreath plugin, written in c++ becoem a dll. Is there a C wrapper?
taxilian 17:11 ? no..
it's all in C++
you can write a DLL in c++
I'm still not following what your issue is
didn't you say all you need to do is create some new entrypoints?
jshanab 17:11 But doesn't it have to have all entry and exit points exposed as C linkage?
taxilian 17:11 that's really not hard
jshanab 17:11 This line in my opengl layer : static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL; breaks on XP
taxilian 17:11 the entrypoints are:
jshanab 17:11 thanks
taxilian 17:11 and to tell them to be exported:
jshanab 17:11 These were generated into the project during fbgen, correct? i don't need to change the master
taxilian 17:11 no, these are in firebreath core
you probably don't need to change any, right?
just add a new entrypoint?
jshanab 17:11 It would change it on my other plugins too. correct
taxilian 17:11 you probably don't need to change any, right?
just add a new entrypoint?
jshanab 17:11 this seems to be the recommended fix
I am still digesting this stuff
Looks like i add the store and get entry points. I guess they become useful anywhere
taxilian 17:11 okay, so you need to change DllMain?
and also add some new entrypoints
so what you do is you copy the dllmain.cpp file into your project
and it will override the one in PluginAuto
jshanab 17:11 At what point do i just give up on glfw. I am gonna have an official fork soon.
taxilian 17:11 and you may need to copy the .def file into your plugin directory as well
jshanab 17:11 That sounds easy enough. But like i was saying I then have to modify their code to use it. I will try it tomarrow.
taxilian 17:11 good luck
jshanab 17:11 I have yet to find one library that claims to abstract the graphics that works on all browsers and platforms. They all work as a stand-alaone app, but in a browser, whew
taxilian 17:11 =]
jshanab 17:11 I got some stepping working in xcode last night, but it keeps stepping into commented out code. I even type in "garbage" and get compile errors so i know it is compileing it but it just will not debug.
I guess such a library would be the final piece in the feature set for FB!
taxilian 17:11 hehe
could be
jshanab 17:11 I have win7, win8 ie 9 and ie10, chrome and FF working. XP crashes
I have a test plugin I could tar up and send you
taxilian 17:11 when you get it working I'd love to see it =] particularly if you'd be willing to release it open
willing and able
jshanab 17:11 GLFW is small so I dragged it into the project and connected up the CMAKE so I can step thru it also
The idea is to get the test plugin building on apple,linux and windows and offer it up as the defacto standard for FB
but xcode is kicking my butt
taxilian 17:11 :-/ it's a bit of a pain at first
jshanab 17:11 I loved it for ios, but for FB it is giving me fits. (also there is a lot of cmake things we need to do to ensure we get the correct libs on mac)
WoLfulus_away 18:11 I still have some doubts about calling c++ from javascript
I tend to always use FB::variant for return/arguments
if I declare a C++ function as bool method(const std::map<std::string, std::string>& args);
I'll be able to call it from javascript using exports.method({ "key1": "value" });
taxilian 18:11 more or less, yes
I don't think "doubts" is the word you were looking for, though
questions? concerns? I'm confused about?
WoLfulus_away 18:11 confused about
taxilian 18:11 "doubts" implies you don't think it'll work =]
WoLfulus_away 18:11 well, then its doubts
I mean
its weird, I'm still confused on how it will translate those types
taxilian 18:11 bascially it enumerates all of the keys in the jsobject passed in and copies them
WoLfulus_away 18:11 but anyways... if this will work then its ok
I'll make some tests
taxilian 18:11 it should work
WoLfulus_away 18:11 it can fail
taxilian 18:11 there is always some way it can fail
but it works fine for me
(anything can fail in some way)
WoLfulus_away 18:11 well, I'll change the question
"how" it will fail?
taxilian 18:11 nothing comes to mind
WoLfulus_away 18:11 well
the map is <string, string>
if I pass
taxilian 18:11 except maybe trying to pass in an object with other types that it doesn't accept
WoLfulus_away 18:11 { "key1" : { "hello": "world" } }
taxilian 18:11 if you pass a bunch of functions and it expects strings then it probably won't work
that *probably* won't work
WoLfulus_away 18:11 but it will just ignore the call
or will make the plugin crash
taxilian 18:11 it might change it to {"key1": "{Object}"} or something
WoLfulus_away 18:11 or something like that?
taxilian 18:11 it will throw a javascript exception
WoLfulus_away 18:11 ahh
then its ok