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

IRC Nick Time (GMT-7) Message
cxo 07:05 So I forgot to get back to you guys yesterday.
I try and fopen "c:\log.txt","w+"
or even just "log.txt"
Always get a null handle
I can debug using visual studio, but without stdout, it makes things really slow for me
I've tried seamonkey, and chrome and same thing, no stdout/stderr on the console
neilg_ 07:05 cxo: I told you the solution yesterday
First of all, you don't have permissions to C:\ so there's your problem right there
Create it in C:\ProgramData or in C:\Users\<your user name>
But if you only want to log on Windows then you could use a mixture of the function OutputDebugString and use DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647)
Then you don't need file access
cxo 08:05 I'll try those paths. Thanks
But why doesnt stdout work?
jshanab_wcw 08:05 cxo, i feel your pain, but stdout is a second class citizen in windows and is often blocked. Remember that the process is the browsers, not yours and you are therfore at it's mercy of what is done with the stdout
I was having issues with disonnections and avoiding the deadlock issue I was trying to solve because the debugger slows things down so much if and stdout or printing breakpoints. (i could probably use a faster computer for this)
taxilian 09:05 cxo: you could (and probably ought to) use the log4cplus stuff that is built into FireBreath
do a search of the logs (logs.firebreath.org) for log4cplus, you should find some info on how to set it up
cxo 10:05 well in seamonkey, the process is my plugin as well
and I'm not going to use a custom logger.
taxilian 10:05 cxo: up to you on the custom logger. what do you mean by the first?
cxo 10:05 Was in regards to what jshanab_wcw said
taxilian 10:05 right… I saw what he said
the process is not your plugin
your plugin runs inside the browser's process
cxo 10:05 Same thing to me
taxilian 10:05 therefore you are a second class citizen; if you mess around with things and it breaks things, it is your fault
and his point is that you have no control over things like stdout and cwd because the browser does what it wants with that
cxo 10:05 Well I could reopen stdout right?
taxilian 10:05 you could. you'd probably have to allocate a console; I've done it before
it doesn't work well
and it slows things down much more than actually makes sense to me
but it can be done
not even really all that hard
if you're only doing it for debugging it's probably safe, more or less
however, it makes a lot more sense to use the tools that are provided rather than trying to brute force your own
i.e. OutputDebugString, etc; the nice thing about a "custom logger" as you put it is that it already supports and automatically abstracts the various consoles; on windows it uses the debug console, linux and mac stdout
and you get log messages from FireBreath as well
however, if you want to log to a file you can do so even with your own calls; you just need to open the file somewhere your user account has rights to, such as your profile directory. Many use AppData\LocalLow for this purpose (you can write to LocalLow even from IE)
cxo 10:05 stdout = brute force my own? jeez, how did windows ever get this popular
Anyhow. This onRefreshEvent, is that where you do the painting on Windows?
taxilian 10:05 well, you can either complain that things don't work the way you expect or you can understand that it is a different platform than you are aparently used to and learn to do things the "expected" way. it's totally up to you
it depends; what kind of painting are you doing
cxo 10:05 BeginPaint ... EndPaint
taxilian 10:05 RefreshEvent is definitely one place you should do it; RefreshEvent is called when the window is invalidated. you may need to draw other times as well depending on what you want to do
but RefreshEvent is fired on WM_PAINT
cxo 10:05 Yup, I'm following the FBTestPlugin example
taxilian 10:05 if you don't do any kind of animation, that should be sufficient
cxo 10:05 I had to use my own callback on Linux though
i.e that callback didnt happen on linux
taxilian 10:05 unfortunately linux graphics systems are not my strong point; therefore several things like that probably aren't implemented how they should be. I would welcome a patch from someone who knows what they are doing, though =]
cxo 10:05 Well on Linux you guys expose a GtkDrawingArea, and then you add events to it. It is probably better to expose a GtkEventBox
This way the event handling is not firebreath's problem
taxilian 10:05 I don't even know enough about it to comment on your suggestion, to be honest.
cxo 10:05 Ok. No problem. Its a liner change anyway that I'm sure people will just do themselves
^1 liner
taxilian 10:05 the general goal is to provide basic abstractions so that those who want to can use basic events through FireBreath and have it all abstracted to work the same way, but those who need more fine-grained control can use it directly
obviously some things are so platform specific that we can't abstract them anyway
cxo 10:05 Yes. It doesnt make sense to try and do "abstraction" with a toolkit as high level as GTK
you either provide X11 abstraction, or a GtkWidget
But using a GtkDrawingArea is a bit convuluted because you're now going backwards
taxilian 10:05 well, we are stuck with GTK because Chrome doesn't support raw X11; only XEmbed
and it does make sense to provide an abstraction so that you can use the same event handling for mouse and keyboard events regardless of which platform you are on
however, that doesn't mean the abstraction will be enough for everyone
cxo 10:05 Yes
taxilian 10:05 my main concern is that I'm not sure the current abstraction provides enough flexibility that you can do it either way without changing any FireBreath code
which would definitely be ideal
cxo 10:05 Well then you should give the user the GtkSocket instead of adding a GtkDrawingArea to it
taxilian 10:05 that's one of the things I've considered; is it possible to get events from a GtkSocket, or do you have to have a drawing area first?
cxo 10:05 Well there are multiple issues here. First off, the basic events you want to provide abstraction for does not require GTK
taxilian 10:05 and yet all we have is the GtkSocket
because that is what the browser gives us
cxo 10:05 But you cant really do anything with the basic mouse events. Thats why you're using GTK
But you're using GTK incorrectly
You should provide the user with the output of gtk_plug_new
taxilian 10:05 !findfile PluginWindowX11
FireBreathBot 10:05 Found 2 matching file(s) in the master branch. First 2 are:
src/PluginAuto/X11/PluginWindowX11.cpp http://goo.gl/Dvv6E
src/PluginAuto/X11/PluginWindowX11.h http://goo.gl/6fh64
taxilian 10:05 I looked at that at one point; but if we were to do that, then don't we lose the events?
cxo 10:05 No.
In that code, you are actually doing the oppositte
you are providing that GtkDrawingArea widget with events
taxilian 10:05 (I really didn't write any of that code, so I'm trying to understand how it works)
cxo 10:05 By creating a GtkDrawingArea, adding events to it, and then connecting those events to a firebreath event system, you constrain the user to those events
In other words, if i wanted to turn Thunderbird (for example) into a browser plugin using firebreath, I couldnt with the current setup.
But if you exposed that *m_container, I could do it in 10mins
taxilian 10:05 so knowing what my goals are, what would you recommend? Losing the event abstraction on linux is not something I'm unwilling to consider, but I'd prefer to have both
we can certainly expose the m_container, that's not a big issue
but I don't think that completely solves the problem, does it?
cxo 10:05 It does. Because then i could remove/disconnect the GtkDrawingArea widget you created (and your event system) and then use my own
neilg_ 10:05 Grr. No idea why I can't mail to Google Groups anymore... I'm still subscribed but can't reply - but it used to work so who knows what happened? :-/
taxilian 10:05 neilg_: what happens when you try?
neilg_ 10:05 I get a message saying "We're writing to let you know that the group you tried to contact (firebreath-dev) may not exist, or you may not have permission to post messages to the group. A few more details on why you weren't able to post:"
* You might have spelled or formatted the group name incorrectly.
* The owner of the group may have removed this group.
* You may need to join the group before receiving permission to post.
* This group may not be open to posting.
cxo 10:05 And by the way, why is it important to provide a basic event system for all platforms? Its pointless if you're going to do anything more than a Hello World! plugin. Expose the underlying drawing context and then let the user use their own graphics toolkit
taxilian 10:05 cxo: would you mind making that change and submitting a jira ticket with the patch? If you do it, I know it will be done correctly; if I do it I may miss something because I dont' understand the system
neilg_: what email address are you coming from?
cxo 10:05 I'll put something together
taxilian 10:05 thanks! http://jira.firebreath.org is the jira ticket system (link on the top left corner of the firebreath.org website)
taxilian 11:05 over the last week and a half traffic on FireBreath.org has significantly increased… we were over 200 hits per day even Sat/Sunday, and weekdays we're usually at least 300. (previously closer to 200 weekdays, 100 was really good for a weekend). No idea what has changed....
we're already over 200 hits today, and it's only noon
hey… look at that! Firebreath.org is finally the first result when searching for "firebreath" on google. it's been code.google.com/p/firebreath/ for ages… thought it'd never change
FireBreathBot 12:05 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-55 issue created by richard
amackera 12:05 taxilian: logs.firebreath.org is busted I think. Looks like a default apache page
taxilian 12:05 ahh. I think I know what caused that. thanks for the heads up
gimme a minute
amackera 12:05 cool
taxilian 12:05 try it now
amackera 12:05 there we go :)
thanks
taxilian 12:05 yw
thanks for the heads up
amackera 12:05 np
taxilian 13:05 lol. ‎"The problem with quotes on the Internet is that it is hard to verify their authenticity" - Abraham Lincoln
amackera 13:05 baha
amackera 14:05 wow, Xcode 4 is just idling on my computer. Using 2.56 GB of memory.
unbelievable
taxilian 14:05 lol
starakaj 14:05 dumb question
how do I turn on specific xcode build configuration properties from cmake?
in this case, I want to turn on use separate strip [SEPARATE_STRIP]
amackera 14:05 hmm
starakaj 14:05 I guess it doesn't have to be from cmake
I don't mind running some postprocessing script to modify the xcode project after cmake builds it
but still, how dat work??
amackera 14:05 i think set_target_properties() is the cmake function you're after
starakaj 14:05 k
let's see
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SEPARATE_STRIP "YES")
somethine like this?
amackera 14:05 yeah i think so
starakaj 14:05 hmm
didn't seem to do it
where does it go? I put it at the end of projectDef.cmake
taxilian 14:05 that would work, but I don't know if that property is supported by cmake
never even heard of it
starakaj 14:05 I see
right, it's an xcode property
taxilian 15:05 I don't know if there is a way to set that or not
http://stackoverflow.com/questions/1354542/how-to-set-an-xcode-attribute-in-cmake-for-a-specific-configuration
starakaj 15:05 well, fortunately I'm not interested in doing it for a particular configuration, so this could be exactly what I'm looking for...
let's see
taxilian 15:05 make sure you mark it as useful, then =]
(pet peeve: people who don't rate up useful answers and questions on stackoverflow; several of my answers people have responded with "thanks, perfect!" or similar but didn't flag it as the answer :-P)