IRC Log Viewer » #firebreath » 2011-07-07

IRC Nick Time (GMT-7) Message
taxilian 00:07 dougma: show me what you had to change; that should be working. the problem is that value and ToString and default instance all end up getting used with DISPID 0
it is quite possible that I am not really solving it correctly; it's been awhile
dougma 00:07 !findfile AxIdMapInit
taxilian 00:07 !find AxIdMapInit
FireBreathBot 00:07 Found 2 possible matches. Displaying 2
/^ AxIdMapInit()$/ (f) found in src/ActiveXCore/axutil.cpp:
/^class AxIdMapInit$/ (c) found in src/ActiveXCore/axutil.cpp:
taxilian 00:07 findfile only searches for filenames, not tags
!findfile axutil
FireBreathBot 00:07 Found 2 matching file(s) in the master branch. First 2 are:
dougma 00:07 line 84: I changed from "value" to ""
yes... not really sure of the implications
but seems to work. :)
taxilian 00:07 hmm; there was a place where I was hacking that elsewhere
the problem is that you need value to work as well, if memory serves
probably when using it as new ActiveXObject
dougma 00:07 ok... so IE doesn't try to invoke on a method called "", it just invokes DISPID_VALUE (ie: 0)
taxilian 00:07 right
"" is a firebreath convention
so it should be detecting that
dougma 00:07 No chance to detect, IE just goes ahead and invokes by id (no preceding name lookup)
taxilian 00:07 right; but in the invoke call, it should detect that it's trying to invoke a method and realize that "value" translates to ""
dougma 00:07 oh i see what you mean.
taxilian 00:07 anyway, gotta run
bed time
dougma 00:07 i'd like to understand why "value" is required... but i've never used the "new ActiveXObject" route
will keep investigating
taxilian 00:07 well, my memory is a bit sketchy, and it's possible I was mistaken, but here is what I remember
when you do new ActiveXObject("….") if memory serves it creates the object and then invokes DISPID_VALUE for some reason
and so if that is not implemented or throws an exception, it throws a javascript exception
so I made the default when it calls that as a propertyget to do ToString
so that it would return the "name"
but I may be mixing up some details
dougma 00:07 ok, cheers. :)
linearray 00:07 good morning
dougma 00:07 hi
Feeling 00:07 hi
gargle 03:07 Hello
linearray 03:07 hi
gargle 03:07 should I ask you something ?
linearray 03:07 if it makes you happy, sure
gargle 03:07 sorry, could :$
linearray 03:07 question is if the answer is equally satisfying :)
gargle 03:07 if i write a plugin for firefox, i must use the xulrunner sdk for the newest version ? or i could use the 1.9 sdk for a plugin which run under firefox 5 ?
gargle 03:07 And if i use the 5.0 skd, it will run under firefox 3.6 ?
sdk, sorry
linearray 03:07 For Gecko versions before 2.0, you should choose the Gecko SDK version for the earliest version of Mozilla you wish to target. For Gecko versions 2.0 and higher, you must recompile your component for each release as cross-version compatibility is no longer supported.
gargle 03:07 so i must create a plugin for FF 3.6 and one for FF 5. And when FF 6 will be availlable, i must create a plugin for the FF 6 too ?
linearray 03:07 That's how I would read it, yes
gargle 03:07 ok, thanks a lot
jshanab_wcw_ 07:07 I want to add FireBreath as a git submodule to my project (I think) Can anyone tell me what the command details are?
This is the way to easily keep things updated right?
nirvdrum 07:07 jshanab_wcw_: git submodules just allow you to version a release of firebreath in your project. It's wholly a git concept.
Similar to svn:externals.
You'd have to dig up the man page on adding submodules.
jshanab_wcw_ 07:07 Yeah. I read it and was not to clear. Taxillian has been my git mentor here and since it is FireBreath, i thouht i'd ask here. But it just worked.
_pq_ 07:07 hello
hello Sajty
Sajty 08:07 hi _pq_
Hmm, it works now without flush!
taxilian: I have tried without log4cplus with file only, but its still not working.
I make a bugreport for it
nirvdrum 08:07 jshanab_wcw_: Cool. Glad to hear.
Sajty 09:07 file logging works if you don't use ~ in the path for the home.
I don't have write access for the home from firefox
jshanab_wcw_ 09:07 I am migrateing from 1.4 to 1.5 on teh migration page it says I must have this line. "include_directories(${PLUGIN_INCLUDE_DIRS})" If i already have an include_directories do I add this entry or do I have 2 such lines
Sajty 09:07 I think both will work
jshanab_wcw_ 09:07 thanks
taxilian 09:07 jshanab_wcw_: You're finally upgrading!? I'm so happy for you! ;-)
jshanab_wcw_ 09:07 I am having a deadlock issue, i saw the "stability" improvements and maybe it will magically fix them.. But I think it is just a deadlock I have yet to discover.
If you were monitoring, I also was adding FireBreah as a submodule. :-)
taxilian 09:07 when do you have the issue?
jshanab_wcw_ 09:07 During careless and impatientant moving of the position know in my video player which generates a lot of calls to the pluginapi
taxilian 09:07 ahh
yeah, I doubt that's FireBreath
there isn't much locking going on in FireBreath that could deadlock except on startup and shutdown
it's more likely your code
jshanab_wcw_ 09:07 I am doing the cmake conversion and when I grep for PROJMAKE to see where I need to fix it, I see a lot that are in the .cmake/Win.cmake folder. Do I change these?
taxilian 09:07 no
those are part of macros or functions
jshanab_wcw_ 09:07 I agree, most likely my code, but a good excuse to upgrade now why the sales guys are deploying our first version.. The calm before the storm
taxilian 09:07 hehe.
_pq_ 09:07 it's always a good idea change everything again just before release
taxilian 09:07 I try to change as much as possible as soon as the QA cycle completes
jshanab_wcw_ 09:07 I am having just a bit of trouble with the cmake conversion. It says include_directories given empty-string as include directory Aparently without the old include, GEN_DIR is now blank, Did it change?
taxilian 09:07 FB_GEN_DIR
jshanab_wcw_ 09:07 Thankyou
taxilian 09:07 is that not in the version history breaking changes list?
jshanab_wcw_ 09:07 I was on this page :
taxilian 09:07 I guess that's just not a directory I thought most people were using
I'll update it
jshanab_wcw_ 09:07 I have a lot. I don't know if it is redundent left over from the original fbgen and now handled elsewhere or not.
taxilian 09:07 what file is that from?
jshanab_wcw_ 09:07 It is in my top level cmakelists.text, I belive it was to template my test page
Maybe I can eliminate it, FB_GEN DIR is also empty at that point
_pq_ 09:07 which data type should I use to encapsulate a Javascript function to be passed as an argument to my plugin's method?
taxilian 09:07 *your* top level CMakeLists.txt? that's strange; I am uncertain if that was there in times of old or if you added it yourself
_pq_: FB::JSObjectPtr
well, really const FB::JSObjectPtr&
any time you pass an object that you can you could make it a const &
_pq_ 09:07 ye
jshanab_wcw_ 09:07 I added it, I can tell because of the if, I think it was to have my own fbcontrol.htm template
_pq_ 09:07 then how do I invoke that javascript function?
taxilian 09:07 by calling Invoke
!find Invoke
FireBreathBot 09:07 Found 18 possible matches. Displaying 5
_pq_ 09:07 using the method invoke expects me to pass a methodName argument
FireBreathBot 09:07 /^FB::variant IDispatchAPI::Invoke(const std::string& methodName, const std::vector<FB::variant>& args)$/ (f) found in src/ActiveXCore/IDispatchAPI.cpp:
/^ HRESULT JSAPI_IDispatchEx<T,IDISP,piid>::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,$/ (f) found in src/ActiveXCore/JSAPI_IDispatchEx.h:
/^bool NPJavascriptObject::Invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result)$/ (f) found in src/NpapiCore/NPJavascriptObject.cpp:
/^FB::variant NPObjectAPI::Invoke(const std::string& methodName, const std::vector<FB::variant>& args)$/ (f) found in src/NpapiCore/NPObjectAPI.cpp:
/^bool NpapiBrowserHost::Invoke(NPObject *npobj, NPIdentifier methodName, const NPVariant *args,$/ (f) found in src/NpapiCore/NpapiBrowserHost.cpp:
taxilian 09:07 _pq_: pass "" for the default method
InvokeAsync may be a better choice, though, if you don't need a return value
in fact it usually is
_pq_ 09:07 i'm single threading so it should be ok
even not async
taxilian 09:07 InvokeAsync may be a better choice, though, if you don't need a return value
in fact it usually is
and I don't care if you are single threading or not
_pq_ 09:07 isn't the purpose of InvokeAsync to be used from any thread?
taxilian 09:07 they can both be used from any thread
the purpose of InvokeAsync is to schedule a javascript call that doesn't have to be linked to the current thread
Sajty 09:07 _pq_: How do you get errors in the console? Is is possible to set firefox into debug mode?
taxilian 09:07 which will perform better and be less likely to be subject to the "fun" of Firefox 4's problems when you do an alert or something on the return value
sorry, during the call
Sajty 09:07 I run firefox from console to get the errors of log4cplus, but nothing there.
taxilian 09:07 you could run firefox -g; that will run it in gdb with debug mode on
that might be overkill, though
Sajty 09:07 firefox is not crashing for me. The plugin is just not starting.
jshanab_wcw_ 09:07 Sajty. there is an about:config parameter that turns on the FF logging for the log4cplus
Sajty 10:07 which option do you mean? I have searched there for "log" and everything is on debug
_pq_ 10:07 Sajty: just running firefox from terminal emulator would be enough to have him print debug messages
like printf and similar
you ought to make sure you're running your plugin from the same process of firefox
i seem to remember firefox 5 on windows will run your plugin in a external process
Sajty 10:07 I will try ipc disabled.
_pq_ 10:07 you can know where is your process's stdout by doing ls -l /proc/(pid)/fd/2
jshanab_wcw_ 10:07 Sajty. Sorry i cannot find it, It logs to c:/var/log on my machine right now
_pq_ 10:07 i'm not sure if that would work on Linux
jshanab_wcw_ 10:07 taxilian. I think i have it all converted, but I get the CMAKE Error: Attempt to add link library "foo" ..which is not built by this project" on all my subprojects. what did i miss?
Sajty 10:07 without IPC I get this:
in a popup window
Its maybe because I'm on 32 bit and you on 64 bit with 32bit plugin wrapper :S
_pq_ 10:07 nah I tried even doing 32bit plugin 32bit firefox it works
better than with wrapper
Sajty 10:07 I give up. Log4cplus is not reporting anything to the console for me, not even error, but the plugin is not working.
jshanab_wcw_ 10:07 Well if the plugin fails to init then it never gets tot he point where it can log?? place breakpoint on onpluginready?
_pq_ 10:07 maybe can't find some runtime linked libraries?
try LD_DEBUG=libs firefox -g
then put some blank lines between firefox garbage pressing enter
and load your plugin's page
Sajty 10:07
I think log4cplus is making the buffer invalid
_pq_ 11:07 calling InvokeAsync on a null or undefined JSObject is safe?
or a non-function object
FireBreathBot 11:07 JIRA issue issue created by sajty
neilg_ 11:07 Hey all!
taxilian 11:07 hey Neil
been awhile
I've actually had to moderate the list myself! ;-)
FireBreathBot 11:07 JIRA issue issue created by sajty
neilg_ 11:07 Sorry. ;) I've been in the UK for a very short trip. And now my body clock is very confused! :)
ronuchit 11:07 anyone know a good function to display a string or char* to hdc?
taxilian 11:07 ronuchit: go look at the FBTestPlugin example again
ronuchit 11:07 k
well i finally got how to print from the c++ code to the console log :D
i'd been looking for that forever
taxilian 11:07 meaning the javascript console log?
ronuchit 11:07 yeah
that's good
taxilian 11:07 be aware that you shouldn't have that enabled for a release build; it can have some serious performance issues
ronuchit 11:07 how so?
taxilian 11:07 that would involve a long discussion on how the threading models and async calls and everything work
ronuchit 11:07 ok i'll try it
taxilian 11:07 just trust me that it isn't a cheap call and we've seen memory leaks in the browser over time from using it with things like FireBug
ronuchit 11:07 yeah i'm using firebug
ok so i shouldn't print mousedown events to the console log while running release mode, got it
linearray 11:07 I assume you are talking about htmlLog()
taxilian 11:07 yes
linearray 11:07 I should actually add the speed issues to the FAQ
ronuchit 11:07 yea
taxilian 11:07 good thinking
or best practices
or somewhere
linearray 11:07 well, it's already tgere
ronuchit 11:07 real name: bertl?
linearray 11:07 hello
now I'm dreaming BIG:
one day I'd like to reorder FAQs into sections like Building, Programming, Debugging...
taxilian 11:07 that would be awesome
the organization on the wiki really needs help
from single pages like that to the larger picture
linearray 11:07 then we can remove all the random info from the other articles and promote it to FAQs
e.g. what I added abot cmake yesterday is factual, somewhat related to cmake, yet something that should rather be a building FAQ :)
ronuchit 11:07 but within fbtestplugin, i couldn't find an example of printing a string to hdc or hwnd
string or char*
taxilian 11:07 look harder
ronuchit 11:07 and the windows api has several methods which didn't work for me :(
taxilian 11:07 !findfile FBTestPlugin.cpp
FireBreathBot 11:07 Found 1 matching file(s) in the master branch. First 1 are:
ronuchit 11:07 i tried this:
const char* buf = "Hello world.";
TextOutW(hdc, 0, 0, (LPCWSTR)buf, sizeof(buf));
jshanab_wcw_ 11:07 taxilian. my FB_GEN_DIR is empty :-(
ronuchit 11:07 but it doesn't work :(
taxilian 11:07 go take a look at and see if you can figure out what you did wrong
ronuchit 11:07 alright
taxilian 11:07 !findfile CommonPlugin
FireBreathBot 11:07 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 11:07 jshanab_wcw_: looks like I actually named it FB_TEMPLATE_DEST_DIR
ha, tricked you? ;-) sorry, my bad
jshanab_wcw_ 11:07 Nice! very descriptive
ronuchit 11:07 oh, looks like i was looking at the wrong fbtestplugin.cpp....
taxilian 11:07 gotta run; be back later.
jshanab_wcw_: could you update version history with the correct variable name, please?
I'll be back in a couple of hours
already late
jshanab_wcw_ 11:07 ok
ronuchit 11:07 is anyone familiar with _T?
never mind
ronuchit 12:07 anyone know a function to draw jpeg onto hdc?
gargle 12:07 on which windows ?
Sajty 12:07 ronuchit: 5 years ago, I used OleLoadPicture for drawing jpeg. google it :)
here is the first result:
jshanab_wcw_ 13:07 ronuchit. A gdi version on windblows i use that has a base64 encoded image in a header file
Somehow I lost the include_directory that pointed to the top level plugin directory. Is their a CMAKE variable for that?
./ ?
taxilian 13:07 ${CMAKE_CURRENT_SOURCE_DIR} should work
jshanab_wcw_ 13:07 Somehow that was included by default before I think ???
taxilian 13:07 ronuchit: the way I display jpeg images is I load it with GDI+ and use that to get the buffer gives an example of something different that could be adapted
jshanab_wcw_: not sure; I've never needed to worry about it
jshanab_wcw_ 13:07 I have a few files there that are common to the player before the win specific stuff.
I do not have the best directory structure :-)
ronuchit 14:07 i have to make a checkerboard pattern within my hdc window...i have an idea of how to set up the for loops but i'm not sure how to actually print 20x20 black squares on my 200x200 window
taxilian 14:07 find some tutorials on windows drawing
I don't have any sample code for anything like that
ronuchit 15:07 do you know any methods off the top of your head?
i've been looking through windows api and it's all not what i want
as you said "easy" and "windows api"....never compatible
taxilian 15:07 I don't
jshanab_wcw_ 16:07 i am getting an error MVSArchivePlayer::getParam overriding virtual function return type differs ans is not covariaent from FB::PluginCore::getParam. Is this a new function in the core?
My auto generated plugin.h file was generated back in 1.3 times and I think something conlicts
taxilian 16:07 !find getParam
FireBreathBot 16:07 Found 1 possible matches. Displaying 1
/^boost::optional<std::string> PluginCore::getParam(const std::string& key) {$/ (f) found in src/PluginCore/PluginCore.cpp:
taxilian 16:07 looks like it
jshanab_wcw_ 16:07 How do I set a string = to the result of the new getParam
taxilian 16:07 so if you do boost::optional<std::string> myParam = getParam("thingermajig");
you can do if (myParam) { std::string tmp(*myParam); }
jshanab_wcw_ 16:07 oh, I have a few params :-( I will have to wrap that
taxilian 16:07 why?
you just use the boost::optional as the datatype; if they are false, there was no param
otherwise you use them with a * as if they were pointers and it'll just work
in fact, pretend it is a pointer and you'll be fine
jshanab_wcw_ 16:07 Because there nees to be an else for each if and for each getParam I have the sam situation on the webserver side and added a getOption(key,defaultvalue)
taxilian 16:07 ahh, so you want to provide a default value
that should be easy to wrap to do that
return myParam ? *myParam : default_value;
jshanab_wcw_ 16:07 oh wait, what happens if I construct a string of null :-) I get an empty string right, that is something I do test for.
taxilian 16:07 you won't *get* null in this case
that's the whole point of boost::optional
jshanab_wcw_ 16:07 right
taxilian 16:07 you can use that for jsapi parameters as well, btw, if you want optional parameters
jshanab_wcw_ 16:07 I haven't used it before. I guess the bes thing wqould be for me to change all my param string class members to optional
taxilian 16:07 that would work; the real problem if you have is that if you have been just assuming they are there you could have crashed
jshanab_wcw_ 16:07 Well, they were just in a try catch and no harm but no init
plugin pointer was null and JSAPI checks for plugin before calling it of course
taxilian 16:07 ahh. well, this should be easy to tweak to work the same way, except no need for the try .. catch
jshanab_wcw_ 16:07 kinda uglifys code like "width_ = atoi(getParam("width").c_str());" (which is not really very "safe" anyway)
jshanab_wcw_ 17:07 I just wrapped it in a throw. Usually I don't like a throw, but in this case where I have 8 required params and if any one is not there I don't want to construct, it fits
jshanab_wcw_ 17:07 One last Question. When GEN_DIR changed, did it also change value 1 level? I had trouble finding things and now my resource can't find things. I look at the error and they have /gen/FireBreathWin.rgs in them. This would explain why Visual Studio cannot find the files
The FireBreathWin.rc is already in the gen directory so /gen/....rgs is wrong? I am not up on resource compilers
taxilian 17:07 jshanab_wcw_: why on earth are you using atoi anyway? boost::lexical_cast<std::string>(...)
value 1 level? I have no idea what you're talking about
sorry, boost::lexical_cast<int>
jshanab_wcw_ 17:07 Right. good Q on atoi, i use lexical cast all over, duh.
I am getting an error now and it appears to come from assumption that gen stuf is in GEN_DIR/gen the replacemtn FB_TEMPLATE_DEST_DIR already has the /gen in it. I think my old project has some growing/migrating pains
taxilian 17:07 you must have tweaked your project in a lot of nonstandard ways; I haven't seen anyone else have most of these issues
jshanab_wcw_ 17:07 the "autogenerated" firebreathWin.rc which i take to mean from fbgen time, has these lines
Visual studio says it cannot find the files. I think not so much tweaked as i started this on FB 1.3 and migrated to 1.4 and now 1.5
taxilian 17:07 did you delete your build dir when you started?
next question, did you specialize that file?
do you have your own copy?
jshanab_wcw_ 17:07 no, i dont think so I will delete the build. I had done that at first, but it has been a while
taxilian 17:07 !findfile firebreathWin.rc
FireBreathBot 17:07 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 17:07 that looks good
jshanab_wcw_ 17:07 I must still have some pathing wrong or overridden. I delete the build directory and prep then try to view the firebreathWin.rc that shows in Visual Studio solution. It errors out saying it cannot find the file.
taxilian 17:07 !findfile FBTestPlugin/CMakeLists.txt
FireBreathBot 17:07 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 17:07 look at that for reference
jshanab_wcw_ 17:07 thanks.
taxilian 17:07 the generated files you shouldn't have to mess with
those are all gathered for you by FireBreath
jshanab_wcw_ 17:07 ok, here we go. Intentionaly or not, i have a tempolate in my directory and it has the GEN_DIR in it which we know o be blank, I have shot myself in the foot
I think I modified some generated files during that whole signing thing
taxilian 17:07 that would do it
jshanab_wcw_ 17:07 No difference at all other than just being the old version. safe to delete
Getting one step closer to dinner :-)
I have a git question for you. I made a mess of things when asked to release after we had commited on our develop branch and they wanted half the features in a commit and not the other half. Anyway I have a good develop branch on my repo but the one manually created branch never got "released". i would like to create a new repo with persistant major versions like fb 1.3,1.4,1.5 I need...
...archiver 1.1 an 1.2. Can i take that branch and create a repo from it? is it just a clone? or was that a "bare" repo. I am still learning GIT on my time off
taxilian 17:07 so to make sure I understand; you want to pull a branch out into a seperate repo, but not get the other branches?
jshanab_wcw_ 17:07 Yeah.
taxilian 17:07 there are several ways you could do it
jshanab_wcw_ 17:07 I think going forward i want to do this more and more. every major point release I need a maint branch created
taxilian 17:07 the most straightforward would be to clone the original repo and delete the branches you don't want
you don't want a seperate repo for that
why would you use a seperate repo?
you're trying to use svn in git
look at FireBreath
there are firebreath-1.3, firebreath-1.4, firebreath-1.5 branches
you can change to those branches and do more commits if you need
jshanab_wcw_ 17:07 Nah. I was trying to use gitflow and they don't yet have the concept I think
taxilian 17:07 then if you need to put those in the main (master) branch you just git cherry-pick the commit you want
aparently someone doesn't have the concept; git-flow does all of that for you
what problem are you trying to solve? I don't understand why you'd want a seperate repo
jshanab_wcw_ 17:07 branches are not persistant in gitflow. If you use the release which merges and tags the master and merges to develop, it concludes by delteing the release branch. I want to be able to maintain one release in the field while working on the current release. I need to let a devel clone the 1.2 work on it and commit withut those changes going into 1.2. Obviously this is just branching, Maybe...
...I need to re-read the doc for gitflow, it seems to not fit this model
taxilian 17:07 you can create a hotfix branch, if memory serves
so you create a hotfix off of the release tag and then that becomes a tag as well
the idea being that once you have released, fixes shouldn't have any direct correlation to the main develop branch; instead, you create a hotfix branch and then cherry-pick the fixes to it
jshanab_wcw_ 17:07 Oh, when I looked at the hotfix I saw that it to was temporary and merges back into trunk. if trunk goes from 1.1 to 1.2 ... mergeing into truck will possibly break 1.2
taxilian 17:07 hmm. I haven't used git-flow enough to be sure I'm explaining correctly
but there is a "correct" way to do what you're trying to do
you may even find that git-flow isn't quite what you want
jshanab_wcw_ 17:07 OK, it is official. I am on 1.5.2. It works and seems faster
taxilian 17:07 Firebreath doesn't use it, you noticed
jshanab_wcw_ 17:07 Yeha. I think gitflow doesn't support it. the only persistant is the develop branch, people were talking about this issue. Maybe i can create such a branch but a repo would also solve it for me. I will just have to throw away the crutch and use git directly (but my office mate may balk)
Totally random access to the video, really nice
I cannot crash it like I was doing before!
taxilian 17:07 if you're going to create seperate repos, save yourself the headache and just get rid of git-flow
it's not that hard
don't make multiple repos
that's really messy
jshanab_wcw_ 17:07 ok. Thanks
Ok, it is miller time. 1.5 migration done and it is noticbly faster
taxilian 17:07 it also discards what is IMO the best feature of git
jshanab_wcw_ 17:07 What is that? it's versitility?
taxilian 17:07 branching
the ability to keep complex versioning in a single repository cleanly
jshanab_wcw_ 18:07 It has branching it just tries to make all but the master and develop temporary i think. create a feature branch, finish the task then auto close the feature. It does not prevent from branching
Thanks a million again
taxilian 18:07 the point is that with branching you don't *need* a seperate rpo
jshanab_wcw_ 18:07 gitflow is adding "support branches" it is experimental with warnings as of feb23 I will try them tomarrow
taxilian 18:07 sounds interesting
Feeling 21:07 hello all
how to embed mfc dialog in browser?