IRC Log Viewer » #firebreath » 2011-08-29

IRC Nick Time (GMT-7) Message
supery 00:08 I tried that create a instance of TestAPI using "new " in the class B, but the compiler said that the "TestAPI.h" no such a file
Thanks advance
supery 02:08 Excuse me, here is a question------,thanks advance thanks advance
dougma 02:08 put you B.cpp in the same directory as TestAPI.h
supery 02:08 They are the same directory.
dougma 02:08 really?
can you paste the exact error message.
supery 02:08 ok
1>.\main.cpp(3) : fatal error C1083: 无法打开包括文件:“TestAPI.h”: No such file or directory
the chinese means can't open file
dougma 02:08 so is main.cpp in the same directory as TestAPI.h?
supery 02:08 yes,they are both in the Project Test Source files
dougma 02:08 the solution view. but on the disk?
i guess so.
supery 02:08 I'll check ...
dougma 02:08 no idea then.
supery 02:08 Oh....It's...
the disk is not the same..
dougma 02:08 well then :)
supery 02:08 I create the main.cpp in the VS2008 in the view..
dougma 02:08 i take it you are not a c++ programmer?
supery 02:08 yes...I am a java programmer..en..student.
dougma 02:08 ok, c++ has quite some learning curve.
supery 02:08 We are studing the gesture recognition
using c++
dougma 02:08 interesting!
supery 02:08 and i want to let the browser know the result
so we can use the gesture to control the browser
dougma 02:08 mmm. might work.
supery 02:08 It's really hard work..
dougma 02:08 until you navigate away from the web page... then your plugin will go away
supery 02:08 Thank you for helping me abount the firebreath
dougma 02:08 well, that was just a c++ question and the compiler was giving you the answer in the error message. :)
supery 02:08 So, I should not use the VS2008? I should create the main.cpp file by hand?
dougma 02:08 just be aware of where vs puts the files.
also, you should add your source files to the cmake file
so that when you rerun cmake/prep-script the solution includes your new files
supery 02:08 I'll try :) thanks..
dougma 02:08 good luck
supery 02:08 The main.cpp is in the bulid/projects others are in the projects/win, so I should move the main.cpp to the projects/win,and modify the CMakeLists.txt?
And then rebuild it?
dougma 02:08 yes
supery 02:08 I'm not familiar with CMake...Is this the only solution?
dougma 02:08 it is
also, are you sure you want a plugin?
supery 02:08 Yes ,I'm sure
dougma 02:08 ok
supery 02:08 What I need is a plugin ,not an extension.
linearray 03:08 supery: is your question in the forum about the resize event still relevant?
supery 03:08 yes.
linearray 03:08 ok, what do you mean with main method?
supery 03:08 Oh,it's the start method.. int main(){}... you know
The main problem is how the class B can get a reference of the TestAPI.
linearray 03:08 right... but in a plugin?
supery 03:08 yes, it must ....
linearray 03:08 not that I really know much about plugins, but mine don't have main()
supery 03:08 for the program can receive the letter from keybord and then pass it to the browser
if don't have main(),the program can't receive the letter!
linearray 03:08 what program?
supery 03:08 i use a c++ program recognize the gesture , when a gesture is recognized, the program call the TestAPI event method to tell the browser to do something
so the c++ program must start from the main()
linearray 03:08 wait
so you have a c++ program running
supery 03:08 yes
linearray 03:08 what is that? windows?
supery 03:08 windows
linearray 03:08 and you want to pass data to a browser plugin
supery 03:08 yes
linearray 03:08 well, it doesn't work that way :)
supery 03:08 ....It can't work?
how can it work?
Does NPAPI support that?
linearray 03:08 as far as I can see you need some sort of IPC
or you can let your plugin spawn new processes
e.g. when the plugin starts, you can let it start your program
then you can let the two talk to each other
supery 03:08 how can i use the plugin start a program...
linearray 03:08 or IPC style: you create a named pipe and let your program write to it and your plugin read from it
supery 03:08 put the code in the constructor?
IPC style: the pipe should be a file or just memory?
linearray 03:08 there is an event to signal the plugin is ready
!wiki onPluginReady
FireBreathBot 03:08 1 results found. Note: Results limited to 8
"class FB PluginCore onPluginReady":
linearray 03:08 but I think in your case the IPC route is probably easier
just read up on IPC on windows
supery 03:08 but I want to put my program cross-platform.
the IPC style can put in Linux or mac?
linearray 03:08 yes
then make sure you use platform-independent IPC
supery 03:08 does the IPC style run fluent? for once the gesture is recognized, the browser then do something
linearray 03:08 yes, you can do that
supery 03:08 thank you! where can i got something about the ipc?
linearray 03:08 it all comes down to this (and somebody may correct me on this): either you put everything into your plugin, that means also your gesture recognition program, or you use IPC to let the two talk to each other.
supery 04:08 I'll learn it and try it as soon as i can! thanks a lot! (but if i don't use the main() I just want to get the reference of the TestAPI, how ?)
linearray 04:08 your plugin object has a method getRootJSAPI()
supery 04:08 so the class B should have the reference of Test and then called getRootJSAPI()?
kryssi 09:08 Hi, I have a question about this new proxy discovery feature in 1.6, does it work with IE automatic configuration script?
taxilian 09:08 kryssi: I don't know; my guess would be probably not, but you'd have to try it
kryssi 09:08 ok, thanks I will try it
taxilian 10:08 linearray: why would you need double quotes around ../boost?
linearray 10:08 ah, I guess I oversimplified the example
taxilian 10:08 =]
linearray 10:08 and there's double quotes in the other example under External Boost
taxilian 10:08 that's really weird; I'm surprised that nested double quotes even work
I hate batch file scripting
linearray 10:08 yes!
me too
that's why I wanted to point it out, because I didn't even try
at first
cause it can't possibly work, right?
if there is a space in the dir name, it doesn't work anymore...
sabotaged|wk 10:08 anyone noticed buggy behavior when setting the background of a child CALayer under firefox?
linearray 11:08 i will just undo that for now
Guest27835 13:08 hi all, I have a question about firebreath. I've been looking at the documentation and google group and trying different sniplets while building an understanding of it. I am trying to access the domwindow element via m_host, and I tried out the first line on : (std::string location = m_host->getDOMWindow()->getLocation();), is
there a reason for me not being able to use it? (error w/ m_host "pointer to incomplete class type is not allowed")
taxilian 14:08 you need to #include "BrowserHost.h"
at least, that would be my guess based on the error message you're getting
I bet you need to #inlclude "DOM.h"
because it's probably the DOM window object that you don't have
that's what incomplete class type means; it means you don't have the header
Guest27835 14:08 so m_host isn't initialized until you include dom.h?
taxilian 14:08 no, I spoke in haste; it's not m_host that you don't have
and it has nothing to do with initialization
it has to do wtih declaration
the FB::DOM::Window object has a forward declaration that you have
namespace FB { namespace DOM { class Window; } }
that allows you to use a pointer to it
but not to use the class itself
Guest27835 14:08 ah
ic now
taxilian 14:08 you need to include "DOM/Window.h" or "DOM.h" (which includes Window.h) in order to use that obejct
jshanab_wcw 14:08 Good afternoon all. Somehow i did something that has rearranged a build order and for the life of me I cannot get rid of winsock errors. Does anyone know the earliest include file so I can beat windows.h to the punch. It seems to be included somewher in the fbcore, before my code
taxilian 14:08 what file is the error in?
usually I use "win_common.h"
jshanab_wcw 14:08 right now IDispatchAPI.cpp
I tried it there. The error has changed a bit since I added the incude into win_common.h. Now I have a redefinition error of sockaddr in ws2def.h, but all searching has lead to the "include windows.h before winsock2.h" snafu
taxilian 14:08 why have you been modifying the firebreath files?
jshanab_wcw 14:08 I did not modify IDispatchAPI.cpp. Only mod I have done are in desperation :-)
taxilian 14:08 if you haven't modified IDispatchAPI.cpp, why would you be getting a build error on that file when it works everythwere else?
unless you've changed other project settings
Guest27835 14:08 on a completely unrelated question, has anyone had experience parsing JSON with C/C++? I've played with JSONCPP and find it to be extremely buggy and unreliable, has anyone tried any alternatives?
jshanab_wcw 14:08 The first person to include windows.h causes include of winsock.h. So since I am using something that includes winsock2.h the thing blows up. To be honest, I have NO freaking clue why this happened, it just suddenly will not build
taxilian 14:08 jshanab_wcw: sure; but remember that is only in a given compilation unit, so if IDispatchAPI.cpp is broken that means something there changed, not something from your code
Guest27835: I haven't had any trouble with jsoncpp, personally
jshanab_wcw 14:08 And that is why I am pulling my hair out, it makes no sense.
Guest27835. I have used jsoncpp also without issue (but is was a while ago)
taxilian 14:08 you could always use the browser's json interpreter, if you know it's a current browser
Guest27835 14:08 whenever I use the append function, it crashes, it seems that if I use it as an array with a complicated json structure
it crashes
jshanab_wcw 14:08 Sounds like the recieving buffer is not large enough for the append
Guest27835 14:08 I thought so too, but I crash whenever I try to access any element treating it as an array
root["test"]["back"].isNull() <- crash
and i've looked at the object in memory, loaded fine
I can however traverse it with an iterator
linearray 15:08 I was on the lookout for a json parser recently and I found JOST. Did not have time to play with it yet, though.
Guest27835 15:08 ok thanks, I'll look into it
Guest27835 15:08 does firebreath have any methods that create a new window or tab? or will I have to use javascript to do that
taxilian 15:08 NPAPI does not have any methods for doing that
I gues sit kinda does
but not with any real level of control
there is a way (that hasn't been implemented in FireBreath) to tell it to open a URL in a new window
but you can't control anything about the window
Guest27835 16:08 but I can load a website with instructions?
i don't mind not being able to control the window
but at least prompting the user with another page if they have problems
taxilian 16:08 yes, that is possible; however, it is not currently implemented in FireBreath. you'd have to add it
Guest27835 16:08 that would be ideal
ah ok
taxilian 16:08 I can tell you more or less how to go about it, though
if you're willing to contribute the code back
Guest27835 16:08 invoking JS w/ NPAPI?
taxilian 16:08 no, though that is also an option
the problem with that is you get hit by the popup blocker
Guest27835 16:08 oh right
I don't mind contributing the code back, I have no idea where other than in the documentation
taxilian 16:08 are you familiar at all with NPAPI?
FireBreathBot 16:08 taxilian:
taxilian 16:08 huh. wish they'd take that down
Guest27835 16:08 not really, but I don't mind researching it either
taxilian 16:08 Guest27835: you can use to open the window
if you pass in "_blank" as the target
Guest27835 16:08 ah
taxilian 16:08 there is an ActiveX api that will do something similar for IE
so to start out with, you need to add a pure virtual method to BrowserHost for opening a new page
something like OpenInNewWindow(const std::string& url)
and then in NpapiBrowserHost you need to implement it to use GetURL and in ActiveXBrowserHost implement it to use the ActiveX way
Guest27835 16:08 I thought we weren't supposed to modify anything outside of our project
everything else is off bounds
I've been implementing other functionality without adding new functions and such when needed
taxilian 16:08 that is generally the case
in this case, however, FireBreath deosn't do what you want
but you're in luck… FireBreath is open source =]
so you can add the capability that you need
and then submit a patch so that it goes into the FireBreath tree
Guest27835 16:08 oh, so thats what you mean by contribute lol
taxilian 16:08 yep
Guest86637 16:08 hi - my first time on FB irc. I downloaded firebreath-1.6.0rc1.7z from google code and created a project. I notice it does not have PCH enabled, but the website said PCH was turned on for this build. What am I missing?
taxilian 16:08 PCH is there, it just doesn't look like it is
CMake doesn't support true project-level PCH, so it's on a file level
Guest86637 16:08 hmmm. I have VS 2010 Ultimate. In VS generated projects, the individual files have build settings, e.g. Right Click a .cpp file, and view configuration properties such as Precompiled Headers, complier flags, etc. In my FB project, the individual files have no settings shown except whether or not the file is included in the build.
taxilian 16:08 dude, I promise you — it's there
build the project
watch the output
you'll see precompiled_headers.cpp build, and then the rest will build faster
Guest86637 16:08 I just had a look and there is indeed a .pch generated in the output folder for each of the core projects.
taxilian 16:08 well, what'd'ya know? ;-)
Guest86637 16:08 I don't see one for my project however.
taxilian 17:08 you have to create it yourself
Guest86637 17:08 I do see VS launching a VSPKGMGR every few minutes and many things like right click -> definition lock up the IDE for long periods of time. I have to go get coffee while waiting for that to finish. A few minutes later it begins again.
taxilian 17:08 yeah; I've had a similar problem. I'm not sure what the solution is; I sometimes just have to kill the process
Guest86637 17:08 ok. I can set up pch myself in the proj. I just thought you were advising against that in favor of doing it in CMake and I wanted to get the low down before I started making changes there.
taxilian 17:08 I do advicse against that
I advise that you set up the PCH with cmake
Guest86637 17:08 then that is where I'll focus my efforts ;)
taxilian 17:08 look at the core projects for an example
Guest86637 17:08 will do. thanks.
taxilian 17:08 I sure wish there was a way to set up regular PCH like visual studio expects; that would be much simpler
but I don't know of one
hmm. actually, I might see a way
Guest86637 17:08 I'll see if I can figure it out.
taxilian 17:08 but I won't have a way to do it this week
it might work to add compiler flags (which you can do wtih add_definitions) /Yc and /Fp
Guest86637 17:08 that is what I was thinking also. I could not locate the build log to see the actual compiler command line.
Guest27835 17:08 @taxilian
GetUrL is implemented already
taxilian 17:08 yes it is
it is only implemented on NPAPI
you dont' want to call it directly
you want to create an API for opening a new window
there is no GetURL on an activex browser
and GetURL does other things besides just opening a new window
you need to add it to the abstraction
unless you only care about NPAPI, in which case I guess you could hack it
Guest27835 17:08 hmm
taxilian 17:08 ?
Guest27835 17:08 chrome blocks the windows
taxilian 17:08 yes
it would
there is another API you'll need to call to tell it not to
interesting; no docs for it
you need to call, if memory serves
and then NPN_PopPopupsEnabledState after you do the GetURL
Guest27835 17:08 isn't NPAPI.lib included in the project? why is msvs complaining about missing dependencies =|
dougma 19:08 taxilian_away: you were correct, parentNode wasn't set as a reserved property. thanks for the pointer.
Guest27835 19:08 NPNFuncs.pushpopupsenabledstate / NPNFuncs.poppopupsenabledstate
Guest27835 19:08 is there any way to set a width/height with npn_geturl
dougma 19:08 i wouldn't think so. why not call ?
Guest27835 19:08 taxilian said a popup blocker would get it
and i need the popup to explain how to use the plugin
dougma 20:08 i see.
Guest27835 20:08 if a popup blocker stops it from showing, it basically renders it useless
dougma 20:08 yes it would. what if it pops up in another tab?
that sounds useless too
Guest27835 20:08 yea
i already have that ability
but if it covers the plugin, I have no use for it
dougma 20:08 what does your plugin do?
Guest27835 20:08 trying to build a game container, the popup is going to explain the controls and such
taxilian 20:08 Guest27835: it is possible that you can use the popupsenabledstate controls to make js popup calls work
I haven't tried it
but it would make sense that it should work
also, no we don't link to npapi.lib; there is no such thing that I'm aware of, and if there is it's not for what we're doing
npapi is not a library
Guest27835 20:08 what im talking about is the size, position, etc
popupsenabledstate seems only to handle if you can bypass the popup blocker chrome
and yeah, I realized there was a NPN_PushPopupsEnabledStateProcPtr
and used that insead of NPN_PushPopupsEnabledState
which was giving linker errors
geturl(m_npp, url, target); <- url and target _blank, _self and _parent
i dont see any way to customize the new window and make it an actual popup with a set position
dougma 20:08 can the html in the popup reposition its window?
Guest27835 20:08 yes, but I don't think it will create a popup
ive tried it in chrome with _blank
and it just makes another tab
dougma 20:08 i like that about chrome. :)
Guest27835 20:08 i do, most of the time, but this is just giving me a headache :(
dougma 20:08 well you will insist on trying to use popups
Guest27835 20:08 there has to be a way
i know it works with flash
taxilian 20:08 Guest27835: what I'm saying is that if you use pushpopupsenabledstate it may very possibly disable the popup blocker even for javascript calls until you pop the state back
so you could call and have it work
I dont' know for sure, but it's worth trying
!find NpapiBrowserHost
FireBreathBot 20:08 Found 9 possible matches. Displaying 5
/^NpapiBrowserHost::NpapiBrowserHost(NpapiPluginModule *module, NPP npp)$/ (f) found in src/NpapiCore/NpapiBrowserHost.cpp:
/^ class NpapiBrowserHost :$/ (c) found in src/NpapiCore/NpapiBrowserHost.h:
/^NpapiBrowserHostAsyncWin::NpapiBrowserHostAsyncWin(NpapiPluginModule* module, NPP npp)$/ (f) found in src/NpapiCore/Win/NpapiBrowserHostAsyncWin.cpp:
/^ class NpapiBrowserHostAsyncWin : public NpapiBrowserHost$/ (c) found in src/NpapiCore/Win/NpapiBrowserHostAsyncWin.h:
/^ typedef boost::shared_ptr<const NpapiBrowserHost> NpapiBrowserHostConstPtr;$/ (t) found in src/NpapiCore/NpapiBrowserHost.h:
taxilian 20:08 and you shouldn't need to care about the function pointer; just call PushPopupsEnabledState on the NpapiBrowserHost object
Guest27835 20:08 tried that
threw linker errors
NPNFuncs.pushpopupsenabledstate(m_npp, true);
that works though
taxilian 21:08 if it threw linker errors then you did it wrong
unless there is something really weird that I'm not seeing
what are the linker errors?
doing that directly is dangerous is the function you should be calling
Guest27835 21:08 oh
i was calling it directly
i didnt realize you had it wrapped like that
taxilian 21:08 all npn functions are wrapped in the NpapiBrowserHost
you can't call it directly =]
Guest27835 21:08 i did it like that anyways lol
taxilian 21:08 I very strongly recommend you change it; the wrapped function has safety checks on it both for threading and for older versions
Guest27835 21:08 doing it now
taxilian 21:08 and could you change your nick to something easier to type please? =]
/nick <something not taken>
Guest27835 21:08 need to register
taxilian 21:08 you only have to register if it's not already taken by someone
for example, you can't use my nick (taxilian) even if I'm not here, because it's registered
but if you pick something not taken on IRC it'll work
even without registering
this way I also have a chance of remembering you if you come in again =]
BleuFish 21:08 that's odd, I tried connecting with the name I know no one else uses and it keeps resetting my name
may have registered it before
taxilian 21:08 this is a whole IRC server
not just this channel
BleuFish 21:08 right whole freenode network
taxilian 21:08 someone else may have used it anyway
BleuFish 21:08 i couldn't imagine compiling firebreath on my old pc
it takes long enough when I have to recompile all the projects
taxilian 21:08 you should have seen it before I added PCH
it's an unfortunate side effect to using templates as much as we do; it simplifies a ton on development, but it does make compilation slower
and of course it's a large project; you wouldn't think there would be that much for something that seems as relatively simple as a browser plugin, but...
BleuFish 21:08 it is also rather large in file size, I compiled it with MinSizeRel and it is almost 860kb
taxilian 21:08 yes; it compresses much smaller, though
I've done some looking into why it's as big as it is, but there doesn't seem to be much that I could conditionally compile out or that isn't really needed
BleuFish 21:08 rared it ~285kb
taxilian 21:08 right; and that's more what you'd be distributing anyway
but I agree it'd be nice if we could find a way to trim down the size
I'm open to suggestions =]
BleuFish 21:08 hmm
taxilian 21:08 I do wonder how much I could cut off if I removed ATL from the equation on windows, but that's more time than I have, unfortunately
and no direct evidence that it's taking up much space
BleuFish 21:08 looking at it in IDA
it has a TON of functions
taxilian 21:08 IDA?
BleuFish 21:08 yeah, IDA - The Interactive Disassembler
taxilian 21:08 not familiar with that one
BleuFish 21:08 its good at looking at compiled binaries
its not live like olly, and gives you time to analyze the code
it takes the asm and structures it
taxilian 21:08 cool. part of the reason there are so many functions is, as I said, the templates
look at just the variant type, and most of the functions get generated for every simple type that you use
they are generally very small functions, of course
but it still adds up eventually
BleuFish 21:08 most of the space looks like it is function code
taxilian 21:08 it would be interesting to try making a "stripped down" version of FireBreath that doesn't have any of the thread safety stuff, automatic type coersion, etc
but in the long run it's usually more valuable to me to be able to develop something quickly than it is to shave off another 200K on the plugin download
BleuFish 21:08 that, or adding a ton of conditional statements to get rid of stuff people don't need - I haven't really looked at the code or how you templated it so that is just a thought
taxilian 21:08 and since it's a framework, I would hope it'd be mostly function code… there shouldn't be much data to worry about
BleuFish 21:08 it seems like 95% of all the functions are being used
there isnt really any way without stripping it down
without templates
taxilian 21:08 right
you see my problem =]
I used different tools, but reached the same conclusion
BleuFish 21:08 hmm
perhaps you could change the structuring, make the templates rely on each other less