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

IRC Nick Time (GMT-7) Message
Feeling 00:07 hum...
how to insert unicode string in string table?
dougma 00:07 the .rc file?
save it as unicode?
Feeling 00:07 yes, the rc file
occurs error, if i saved rc file to unicode
dougma 00:07 what error?
Feeling 00:07 um.. wait
suit, rc file is break... sorry i will be ask again.
Feeling 00:07 hm.. i really sorry to bother you. that's my mistake
dougma 00:07 no bother. :)
Feeling 00:07 thanks.
gargle 02:07 Hi all
linearray 03:07 bonjour
gargle 03:07 ho, un francophone :)
someone use the nsIFile::Append function in a firefox plugin ?
linearray 09:07 hello
gargle 09:07 Hi taxilian
do you remember if people who crash plugin under Firefox 5 use the nsIFile class ?
because i've a crash on "file->Append(NS_LITERAL_STRING("hello"));", fils is a nsIFile object
file
linearray 09:07 I want to add something like this to the wiki: http://pastebin.com/c7Hx17Ez
a) is this a good idea?, b) did I miss anything?, c) where is the best place to put it?, d) does it sound too grumpy?
gargle 09:07 good idea
Sajty 09:07 Hi! The Git heads are not working for me on linux. In FBTestPlugin the "alert plugin valid" returns undefined, however in 1.5.2 it works.
I'm using firefox 5 with ubuntu 11
taxilian 09:07 linearray: good call on the wiki change =]
can anyone else confirm Sajty's problem on linux?
linearray 09:07 pardon?
taxilian 09:07 linearray: wasn't that you that added the paragraph to the cmake page on the wiki?
linearray 09:07 ah yes
but is there anything special about it? :)
taxilian 09:07 just that it's good that someone added it
linearray 09:07 good to hear
taxilian 09:07 and yes, the fact that you update the wiki is special… considering how many people complain about the docs and then never do help update them
Sajty 10:07 hmmm I think I'm doing something wrong
is it ok to use cmake directly?
taxilian 10:07 on linux? should be fine
Mac there is a script that needs to be run afterword
kylehuff 10:07 speaking of docs, taxilian, we had spoke about adding something to the wiki for simplestreamhelper (that uses AsyncPost and AsyncGet) -- anyway, I guess I'm confused on how that is different from what is already here: http://www.firebreath.org/x/3YBR
taxilian 10:07 lol. Well, the first thing is that I totally forgot that was there...
!wiki simplestreamshelper
FireBreathBot 10:07 0 results found. Note: Results limited to 8
kylehuff 10:07 lol -- so did I, until I was writing up the thing for simplestreams and thought "Wait, I don't know what this crap is, but it looks familiar...."
taxilian 10:07 hehe
I added SimpleStreamsHelper to the title to make it easier to find; not sure why the search isn't pulling it yet
maybe the index has to update
!wiki simplestreamshelper
Sajty 10:07 I moved the examples/FBTestPlugin to projects/FBTestPlugin and runned cmake with codeblocks, it compiles, but the plugin is not working. When I create a random named plugin ASD with default settings with fbgen, it works. npASD is 2.1MB npFBTestPlugin is 3.3 MB
FireBreathBot 10:07 1 results found. Note: Results limited to 8
"Making HTTP Requests with SimpleStreamsHelper": http://goo.gl/zSyNx
taxilian 10:07 Sajty: you know that you don't have to move it to projects to build, no?
kylehuff 10:07 I think the verbiage used in that was "SimpleBrowserStreams" -- not sure how they are different
Sajty 10:07 yes I know I can set it
I found that easier for me :P
taxilian 10:07 okay; what browser?
kylehuff 10:07 (08:36:04 AM) Sajty: I'm using firefox 5 with ubuntu 11
taxilian 10:07 sure, sure, read the logs
lol
kylehuff 10:07 lol
taxilian 10:07 well played
hmm. Sajty: I don't know; could you try a few different APIs, such as ones that return an integer instead of a string?
or a bool?
kylehuff 10:07 that isn't what I was implying at all -- I just remembered seeing it, thought I would help out and save you the trouble
taxilian 10:07 ;-)
just giving you crap. no worried =]
I'm about to double the cost of my internet connection… I'm fed up with having internet that keeps going down at random times with no idea when it will come back
and then if it's not during business hours, it doesn't come back until business hours return, often as not
gargle 10:07 woww, where do you live ?
Sajty 10:07 ahh
I'm stupid
I already reported that bug
taxilian 10:07 I live in a city called American Fork, in Utah (USA)
Sajty 10:07 When I enable log4cplus its not working
in FBTest it was enabled
in the fbgen generated project it wasn't
taxilian 10:07 Hmm. see if you can figure out why? I have no idea; I have used it on linux before, but not in ff5 specifically
unfortunately I don't have linux set up for easy development currently
and I don't really have time to worry about it right now; I'm not working on any plugins on linux
I realize that's a lame response, but I just only have so much time...
Sajty 10:07 ok, doesn't matter
in the mean time I have redirected to cout the log macros
taxilian 10:07 that works; you can provide your own logger if you want
it's not too hard
and doesn't require changing FireBreath
that's another of those things that someone should probably document… :-P
linearray 10:07 if you have a minute, scroll to 09:09
taxilian 10:07 ?
in the logs? my times are different than yours… different time zone
linearray 10:07 yes, I adjusted that :)
assuming you run your IRC in the same timezone as you are
_pq_ 10:07 hello
taxilian 10:07 ahh, I see it
hey _pq_. been awhile
linearray 10:07 hi _pq_
_pq_ 10:07 ye been working on other things too
taxilian 10:07 I need to reread the logs from last night; I seem to have a missed a bunch
linearray: yeah, that sounds like a good idea to me
I'm not certain where to put it is all
but definitely a good idea
linearray 10:07 maybe right on Getting Started?
taxilian 10:07 throw it on, we'll see how it looks
linearray 10:07 ha, i got an even better idea
_pq_ 10:07 got a question
taxilian 10:07 .ask
FireBreathBot 10:07 If you need help, just ask your question and wait for people to come back.
taxilian 10:07 =]
_pq_ 10:07 PluginWindowsX11::EventCallback
http://www.firebreath.org/display/documentation/file%20PluginWindowX11.cpp
there's not a case for keyboard events
how does keyboard events get handled?
taxilian 10:07 well, you can either hack things as some have done lately or you could add support for them and then submit a patch
_pq_ 10:07 actually i get platform events
Sajty 10:07 I have added X11 keyboard
taxilian 10:07 or talk to Sajty
Sajty 10:07 but don't pushed
I'l push now
sec
dada 10:07 i tried using firebreath on windows. i got everything installed like the video tutorial said. but when i build my plugin i only get generated a .exp and .lib files. no DLL file created. what can be wrong?
_pq_ 10:07 but it seems like no KEY_PRESS or KEY_RELEASE the SendEvent call at line 173
so I thought maybe they go from another route
or I have to explicitly tell I want them
dada: probably looking in the wrong directory
Sajty 10:07 https://github.com/sajty/FireBreath/commit/1ddb17290bea8480cfad29484ca3e7f30ce9c342
FireBreathBot 10:07 1ddb172 by Peter Szücs: Add Keyboard support on linux. http://goo.gl/B2Uui
Sajty 10:07 I don't have set FBKeyCode
_pq_ 10:07 ty Sajty I think I was missing the focus thing
Sajty 10:07 yeah
and it needed XFlush
Thats the magic :D
If something is not working, then use XFlush!
_pq_ 10:07 so you request focus on mouseup?
Sajty 10:07 yes
I don't used mouse down because of SDL integration
but I don't know which is better
_pq_ 10:07 neither do I
isn't there some gdk support for that?
Sajty 10:07 ?
What do you mean?
_pq_ 10:07 like, some specification on when you should ask for focus
Sajty 10:07 When the toplevel window has focus
but It's on both cases
_pq_ 10:07 it looks like most widget gets focus at mousedown
Sajty 10:07 so it doesn't matter when
_pq_ 10:07 oh ok
what was that SDL issue you mentioned about?
Sajty 10:07 I had a lot, but I've got it now working with input and everything with IPC and without IPC
taxilian 10:07 Sajty: want to make a pull request? Also, if you could create a JIRA issue for it that would be awesome; it helps me keep track of things for the changelog
Sajty 10:07 yeah, but I don't have tested it yet on the git head. Also I want to add the FBKeyCode
taxilian 10:07 okay
I will wait =]
Sajty 10:07 Would you accept example projects too? I mean SDL example
taxilian 10:07 absolutely
the more examples we have the better
however, I would probably put them in a seperate git repository
rather than the main one
Sajty 10:07 At the moment tab changing is not hiding SDL so its still buggy
taxilian 10:07 watch the clipping rect
that will change to nothing when the tab changes
_pq_ 10:07 cool
linearray 10:07 the wordpress on colonelpanic is a tiny wee bit annoying, because there doesn't seem to be a way to go to 'page 2' on the frontpage
or am i just blind? :)
Sajty 10:07 I will use GdkEventVisibility, which can notify GDK_VISIBILITY_FULLY_OBSCURED
taxilian 10:07 linearray: you mean on the history? you may be right
linearray 10:07 yep
oh well...
_pq_ 10:07 :( undefined reference to XFlush
taxilian 10:07 I'll see if I can find a way to add such a link
Sajty 10:07 its in X11
taxilian 10:07 because I agree that there should be one
linearray 10:07 my wordpress does it... maybe it's the theme?
taxilian 10:07 it's the theme
_pq_ 10:07 i guess that's the reason for target_link_libraries(${PROJECT_NAME} X11)
taxilian 10:07 I just have to figure out how to add it to the theme
Sajty 10:07 yes :)
Only for the XFlush magic
linearray 11:07 not sure, but this might do the trick: <?php posts_nav_link(); ?>
http://codex.wordpress.org/Function_Reference/posts_nav_link
dada 11:07 _pq_ - i looked in all directories no DLL file created.
_pq_ 11:07 Sajty is gdk_display_flush the same as XFlush?
Sajty 11:07 hmmm I don't have known that function
can you test it?
_pq_ 11:07 I'm trying now
Sajty 11:07 What browser are you using?
_pq_ 11:07 dada: how did you build your project? Using visual studio?
firefox
need to disconnect to reload browser
see you later
dada 11:07 _pq_: yes. vs 2008
_pq_ 11:07 looks like i get keyboard events now
taxilian 11:07 dada: are you absolutely certain that the project built successfully?
_pq_ 11:07 GdkDisplay* disp = gtk_widget_get_display (m_canvas);
taxilian 11:07 because if there is no .dll then either it didn't build correctly or you didn't build the right thing
_pq_ 11:07 gdk_display_flush(disp)
seems to work
dada 11:07 taxilian: as far as i can see there were no errors. it did generate the .lib .exp files
taxilian 11:07 what .sln file did you open?
_pq_ 11:07 but I don't know if in my configuration I need to flush display at all
Sajty 11:07 _pq_: nice!
dada 11:07 FireBreath.sln in build directory
_pq_ 11:07 well, it should be ok
taxilian 11:07 dada: I would try deleting your build directory and rerunning the prep script
then build again
dada 11:07 i tried this a few times. it also happens on the example
taxilian 11:07 can you pastebin me the output of the prep script as well as the build log?
Sajty 11:07 _pq_: is it working for you without flush?
taxilian 11:07 linearray: that didn't work, btw :-/
but you can look it up by category
_pq_ 11:07 i'm going to try that too
but I'm doing it at mousedown, since I like better this way
restarting
Sajty: it does work for me even if I don't flush anything
:(
I guess you have to try on your environment
Sajty 11:07 What distro and what firefox version are you using?
_pq_ 11:07 ubuntu natty firefox 5 64 bit, nspluginwrapper 32-bit plugin
Sajty 11:07 I'm on same but with 32 bit. Hmmm.
_pq_ 11:07 32-bit you have in-process plugin
Sajty 11:07 I will test it tomorrow, but today I can't test it.
_pq_ 11:07 so maybe in my case there's something else flushing display connection
i'd like to know if it fixed it
I'll be on tomorrow I'm going to leave soon too
Sajty 11:07 ok, then tomorrow we continue. :)
taxilian 11:07 this is awesome, you guys; when you figure out how things "ought" to be we'll update it in FireBreath :-P
linearray 11:07 according to your theme creator, you need to install this http://wordpress.org/extend/plugins/wp-pagenavi/ then everything automagically works
but it's not really important...
taxilian 11:07 linearray: a friend of mine is a whiz at wordpress blogs and sent me some code to try; I'll let you know how it goes =]
dada:
.pb
FireBreathBot 11:07 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin. http://fpaste.org, https://pzt.me/, and https://gist.github.com are all good options
Sajty 11:07 _pq_: is log4cplus extension working for you on linux?
_pq_ 11:07 logwhat?
linearray 11:07 :)
Sajty 11:07 http://www.firebreath.org/display/documentation/Logging
add add_firebreath_library(log4cplus) to your PluginConfig.cmake
and then build it
_pq_ 11:07 i guess it should work
but what do you need that for?
Sajty 11:07 Can you test it if it builds with that?
I need it for getting info when it crashes
taxilian 11:07 _pq_ Sajty hasn't been able to use log4cplus; it's not working for him on linux
_pq_ 11:07 hm ok
by the way write on stderr if you have crash log problems
Sajty 11:07 But if you don't want to test it, its ok too :)
_pq_ 11:07 stdout is buffered
so if it crashes maybe some of your messages aren't flushed on stdout yet
Sajty 11:07 Try out FBTestPlugin. It has by default log4cplus enabled
And its not working for me if I don't turn it off
_pq_ 11:07 compiling now
_pq_ 11:07 compiling worked
trying to reboot
doesn't work
"plugin not installed"
as if mime type got messed up
taxilian 12:07 but it built correctly?
_pq_ 12:07 nevermind looks like it was an nspluginwrapper's problem
maybe symbol order has changed or so
taxilian 12:07 my guess is that either something is causing the plugin to crash (probably a log call during startup) or for some reason it's requiring a lib that isn't there
_pq_ 12:07 it works on a 32-bit browser
*** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed
looks like nspluginwrapper's external process crashes
taxilian 12:07 yeah; it's crashing
_pq_ 12:07 log4cplus:ERROR Unable to open file:
07-06-11 20:08:25,263 [4109392016] INFO FireBreath <> - /home/devel/Devel/Builder/COMMON_LIBS_HOUSE/firebreath-1.5.1/src/PluginCore/PluginCore.cpp:39
taxilian 12:07 hmm. could be that it can't open stdout
_pq_ 12:07 don't know
where does log4cplus logs by default?
taxilian 12:07 stdout
!findfile log4cplus.cpp
FireBreathBot 12:07 ValueError: Input must be serialised JSON. (file "/home/richard/phenny/web.py", line 68, in json)
taxilian 12:07 !findfile log4cplus.cpp
FireBreathBot 12:07 Found 1 matching file(s) in the master branch. First 1 are:
src/PluginAuto/log4cplus/log4cplus.cpp http://goo.gl/jMoY2
Sajty 12:07 So the plugin works for you?
Hmmm...Maybe my ubuntu is wrong :D
taxilian 12:07 he's saying it doesn't work
and he found messages to indicate why
_pq_ 12:07 hm
Sajty 12:07 ahh sry I just saw last message
_pq_ 12:07 i don't have a getLoggingMethods in my Factory.cpp
taxilian 12:07 there is a base class to Factory
!find FactoryBase
FireBreathBot 12:07 Found 3 possible matches. Displaying 3
/^FB::FactoryBase::FactoryBase()$/ (f) found in src/PluginCore/FactoryBase.cpp: http://goo.gl/aojM1
/^ class FactoryBase : public boost::noncopyable$/ (c) found in src/PluginCore/FactoryBase.h: http://goo.gl/SKAie
/^ typedef boost::shared_ptr<FactoryBase> FactoryBasePtr;$/ (t) found in src/PluginCore/FactoryBase.h: http://goo.gl/SKAie
taxilian 12:07 that sets defaults
_pq_ 12:07 so that's console by default
taxilian 12:07 right
which on linux is stdout
_pq_ 12:07 yep
probably the nspluginwrapper process spawns with stdout unusable
taxilian 12:07 right
_pq_ 12:07 and that causes crashes or similar
taxilian 12:07 it may well be using it from cross-process comm, actually
_pq_ 12:07 I don't get messages from printf either
if I run from wrapper
but I thought it's redirected on /dev/null or something similar
lemme check
its /home/pq/.xsession-errors
stdin is /dev/null
Sajty: did you try running firefox from a terminal?
ls -l /home/pq/.xsession-errors reports write and read permission for me
Sajty 12:07 _pq_: Yes, then I get normally stdout there.
_pq_ 12:07 nothing
can't make it work
with wrapper
don't know why
don't get any log
taxilian 12:07 so add the function to your factory and tell it to log to a file insetad
override the defaults
and see if that fixes it
Sajty 12:07 ok, thank you for trying!!!!
_pq_ 12:07 i'm going to eat something now we try again tomorrow
Sajty 12:07 tomorrow I can try it too.
_pq__ 12:07 firefox crashed
_pq_ 12:07 should run make with nice
well, anyway I'm back here just to say goodbye
see you tomorrow
Sajty 12:07 ok
bye
linearray 12:07 have a nice evening, bye
Sajty 12:07 thanks again :)
ronuchit 13:07 hi
taxilian 13:07 hi
ronuchit 13:07 i was working on my plugin project and all of a sudden it seems firefox can't recognize mypluginapi.cpp's methods anymore
taxilian 13:07 then most likely your plugin is no longer loading
ronuchit 13:07 plugin.getWidth is not a function: var wid = plugin.getWidth("test.ron");
taxilian 13:07 what was the last thing you changed before that happened?
ronuchit 13:07 uh
the return type for
onPluginReady
i changed it from char* to std::string
taxilian 13:07 wait… what?
on what object?
ronuchit 13:07 what?
i wanted to test something
on that function
so i tried to return a buffer
taxilian 13:07 is this your own onPluginReady function that you added, or the one that was there by default?
!find onPluginReady
FireBreathBot 13:07 Found 1 possible matches. Displaying 1
ronuchit 13:07 the default one
FireBreathBot 13:07 /^ virtual void onPluginReady() {};$/ (f) found in src/PluginCore/PluginCore.h: http://goo.gl/M31V9
taxilian 13:07 the one on your plugin object that extends PluginCore?
ronuchit 13:07 mhm
taxilian 13:07 the one that is supposed to be specializing the one I just showed you?
ronuchit 13:07 yes
i also went to plugincore.h
taxilian 13:07 the one that is called by the framework that you don't ever call?
ronuchit 13:07 and changed the return type there
ooh
ok
taxilian 13:07 alright, before I decide you're completely crazy, could you please explain what you were trying to accomplish?
ronuchit 13:07 so i'm loading data from a picture into a memory buffer in onPluginReady, and just as a test i'm trying to return the contents of that buffer to the javascript code (i know it will be gibberish but i want to see that something is being loaded into the buffer)
taxilian 13:07 onPluginReady is not called from Javascript, and therefore returning a value from it is worse than useless
you don't return data to javascript from your plugin object
ronuchit 13:07 i just realized that while typing what i typed
taxilian 13:07 you return data to javascript from your api object
ronuchit 13:07 :)
yeah
i guess i forgot that...
taxilian 13:07 heh. now go, and think twice before you change FireBreath methods; they are generally the way they are for a reason
=]
ronuchit 13:07 so i cannot change return types of any myplugin methods?
taxilian 13:07 if what you are doing is at all normal, you won't have to change firebreath code
ones that you add, yes
ronuchit 13:07 ^ what would i have to change generally
taxilian 13:07 but keep in mind that it extends the PluginCore object
so any that are specializing PluginCore methods you can't change
are you new to C++?
ronuchit 13:07 i never had more than compsci 101's worth of experience
taxilian 13:07 it shows, I'm afraid. I highly recommend you get a good book on C++ and read up on virtual methods and inheritence
ronuchit 13:07 i know about those
i just...got lost i think
taxilian 13:07 I see. well, take a look at PluginCore; anything that is virtual there that you have an implementation for, you can't change
anything else you rpobably can, but whether or not it is a good idea is another question
the event handler methods, for example, are expected to have a certain signature
ronuchit 13:07 thanks
taxilian 13:07 good luck
ronuchit 13:07 is it acceptable to change a bool value to true in onWindowAttached
and then check for that value being true in onPluginReady
just to see if attachedevent has been called before attempting to draw?
taxilian 13:07 if it's a value you added, you can change it however you want
ronuchit 13:07 ok
so then back to the previous problem: i load this memory buffer in onPluginReady. how would you suggest I return it to the javascript code?
as a test
uhoh. the plugin not loading properly is still a problem..
taxilian 13:07 I would start out by reverting any and all firebreath files back to the original
and honestly I wouldn't return the memory buffer to javascript code; you can't pass binary data in a string
linearray 13:07 what? why?
taxilian 13:07 because if it's not valid UTF8 it won't work properly on the different browsers
linearray 13:07 ah ok
ronuchit 13:07 ok
taxilian 13:07 for example on IE we convert it to a BSTR, and NPAPI specifically expects UTF8
ronuchit 13:07 yeah i'm reverting right now
taxilian 13:07 there is no good way to pass binary data to the plugin; there are simply various options of bad ways
ronuchit 13:07 then how am i supposed to print this image to the browser window?
taxilian 13:07 what are you trying to do?
ronuchit 13:07 i've checked that attachedevent has been called and i have a window of 300x300...
taxilian 13:07 then draw it!
don't pass it to javascript
what use is it there?
ronuchit 13:07 i know, i wanted to test it one step at a time. but if passing binary as a string isn't good then i won't
from my employer: The eventual goal is to have a plug-in that will read a Pelican Imaging file format that is similar to jpeg, but slightly different.
linearray 13:07 you can "test" by just returning the size for example
taxilian 13:07 there are two ways you could do it. you can either use a "data:" url w/ base64 encoded data (not really ideal) or you can simply draw to the plugin's drawing area, which is what I'd do
there are two ways you could do it. you can either use a "data:" url w/ base64 encoded data (not really ideal) or you can simply draw to the plugin's drawing area, which is what I'd do
ronuchit_ 13:07 "simply draw"
tht's what i've been trying to figure out for a while :P
taxilian 13:07 yeah; like, in the HWND? or the hDC?
we deal with plugins here; I'm *not* going to teach you windows programming via IRC
you have all the information you need to figure this out; use it
ronuchit_ 13:07 the docs im guessing
taxilian 13:07 http://www.firebreath.org/display/documentation/Getting+Started
all the resources are listed there
ronuchit_ 13:07 is the memory buffer the correct first step?
taxilian 13:07 you have already read the article on drawing on windows; that has been sufficient for hundreds of other people
that totally depends on what you're doing
you need to learn to program for the platform you're dealing with
are you using windows?
ronuchit_ 13:07 mhm
ronuchit_ 14:07 uhh
taxilian 14:07 brb
ronuchit_ 14:07 i reverted everything and remade my changes, and it still can't recognize the functions
weird...
linearray 14:07 is it loaded? ;)
about:plugins
ronuchit_ 14:07 mhm
it's funny cause it was working 10 minutes ago
with the exact same code
linearray 14:07 check if the correct version is loaded
ronuchit_ 14:07 what do you mean?
there's no reference to firebreath's version number on about:plugins
linearray 14:07 I mean: make sure you are loading the correct file
ronuchit_ 14:07 why would that randomly become different within 10 minutes?
linearray 14:07 do other functions work?
plugin.echo("foo");
plugin().echo("foo") of course...
ronuchit_ 14:07 ahhh
fixed
i had moved the image file to another directory
and when i moved it back it's ok again
linearray 14:07 crazy
ronuchit_ 14:07 heh
linearray 14:07 no really, this doesn't make any sense to me :)
taxilian 14:07 linearray: he's saying the file that was supposed to get loaded was moved
so of course it didn't work
linearray 14:07 I think he's referring to the pelican image file, no?
maybe not.
ronuchit_ 14:07 yes
anyway richard
after talking to you the last 2 days
your blog post makes a lot more sense :)
taxilian 14:07 I'm glad it has helped
linearray 14:07 ah, I see, but shouldn't the plugin just crash?
taxilian 14:07 it probably did; but with OOPP / ipc you no longer see that as obviously
linearray 14:07 i see
ronuchit_ 14:07 can you cast pluginwindow to pluginwindowwin
taxilian 14:07 if it is a pluginwindowwin, yes
coincidentally, I believe that is specified in the blog post
ronuchit_ 14:07 yeah
so i changed the type in the eventtype_case
can i access pluginwindowwin from mypluginapi?
taxilian 14:07 I am not repeating this conversation *again*
go read the logs from our last conversation where I explained that twice
ronuchit_ 14:07 k
taxilian 14:07 I don't mean to be rude, but I am extraordiarily busy; I don't mind helping out when people have questions, but if you need me to teach you c++ and read and repeat documentation and previous conversations, please feel free to contact me privately about my subcontracting rates
ronuchit_ 14:07 i could pay you to do that?
taxilian 14:07 it's expensive, but I do contracting on the side, yes
ronuchit_ 14:07 don't worry about being rude, i got used to it
taxilian 14:07 just so you know; I don't mind questions. the time when I start getting cranky and frustrated is when I am ask questions whose answers could be easily found with resources that are already at the disposal of the person I am speaking with
in other words, do your own homework =]
ronuchit_ 14:07 teen's attention spans are quite low when it comes to reading docs
teens'*
taxilian 14:07 I'm glad you understand that. now you know the first thing you need to work on =]
because my tolerance level is very very low for people who think I'm going to do their work for them for free
particularly considering how much of it I have already done in writing FireBreath
ronuchit_ 14:07 under that attitude, i'm wondering why you kept it free
don't get me wrong, it's amazing
but i'm wondeering
taxilian 14:07 there are several reasons; I really do want to provide it as a free resource. I dont' think it should be as hard as it is
and I really enjoy seeing people use it and even helping them use it
I just don't enjoy it when people abuse my time
ronuchit_ 14:07 abuse your time? i'm sorry
taxilian 14:07 in addition, most of my employment for the last year and a half has come from companies using it
as I said, I'm being perhaps a bit harsher than I intend; my point is just that if I have already given you information, but you failed to use it and failed to read the articles and blogs that I have already written, then it is a waste of my time to spoon feed it when you could find it on your own
in addition, one of hte most important skills to learn on any new project is how to find information yourself
there will always come a point where you will exhaust your ability to figure something out; at that point, come talk to me. However, if the questions people ask are already clearly (to me) answered in existing resources, then either you haven't done your part or you aren't asking the right questions
ronuchit_ 14:07 fine
taxilian 14:07 most people in here can tell you that when it's not a question that I have already answered, I'm pretty easy going; I just get cranky when I feel like I've already answered the question and I am being ask again
I hope I don't offend
also I haven't had lunch yet and that makes me cranky :-P
so, with that in mind, do you have any more questions for me right now, or would you like to go read some more first?
ronuchit_ 14:07 i've been reading. but now i'm scared to ask you anything cause you might yell at me again
taxilian 14:07 I'll try to restrain myself ;-) however, if you ask me a broad question that you could have learned yourself, I'll just send you back to the article
so when you ask questions, try to be specific
ronuchit_ 14:07 ok, just tell me if this is correct: from the HWND, i should be able to obtain a Graphics object using Graphics.FromHwnd, and with that i can use a method like drawImage to accomplish my goal?
Graphics.drawImage*
taxilian 14:07 you're referring to the Gdiplus Graphics object?
ronuchit_ 14:07 i'm sorry, i'm really not sure. i'll send you the link
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromhwnd.aspx
taxilian 14:07 that's a .net call
one of the trickier things with working with c++ is to figure out what docs refer to .net and what is normal windows api
it might hypohetically be possible to use managed c++ with FireBreath, but I've never tried it and don't recommend it
ronuchit_ 14:07 what's bad about a .net call?
taxilian 14:07 it requires managed C++
and that's a pain to deal with
ronuchit_ 14:07 ok. normal windows api...
taxilian 14:07 take a look at the draw method in FBTestPlugin
!find FBTestPlugin
FireBreathBot 14:07 Could not find any tags matching FBTestPlugin
taxilian 14:07 that may help you get started
!findfile FBTestPlugin
FireBreathBot 14:07 Found 27 matching file(s) in the master branch. First 5 are:
examples/FBTestPlugin/CMakeLists.txt http://goo.gl/WB5FC
examples/FBTestPlugin/FBTestPlugin.cpp http://goo.gl/PFCgg
examples/FBTestPlugin/FBTestPlugin.h http://goo.gl/Wizcy
examples/FBTestPlugin/FBTestPluginAPI.cpp http://goo.gl/e2uMr
taxilian 14:07 that was a much better question, btw; it showed that you have been trying to dig through things, and were trying to figure out if you were on the right track
and I hadn't already answered it ;-)
ronuchit_ 14:07 that's nice
the example you show implements a new draw method; is that really necessary?
taxilian 14:07 look at the .h file as well
you'll see that that draw method is handling the RefreshEvent
!find RefreshEvent
FireBreathBot 14:07 Found 3 possible matches. Displaying 3
/^ RefreshEvent() { }$/ (f) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
/^ RefreshEvent(FB::Rect inBounds)$/ (f) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
/^ class RefreshEvent : public PluginEvent$/ (c) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
taxilian 14:07 RefreshEvent is fired for a WM_PAINT, which basically means that for whatever reason that window needs to be redrawn
usually that's because a window was dragged in front or something
you'll want to handle that
if you're windowed (as opposed to windowless) you can draw at any time, but you need to draw in response to a WM_PAINT message if you want it to look right
ronuchit_ 14:07 so when you say "draw handles refreshevent" you basically mean that every time refreshEvent is called, draw() will be called, thus ensuring that the window is redrawn when it needs to be?
taxilian 14:07 right
RefreshEvent is not called, however; it is fired
it's an event, which means there is one or more event hander that is called (in this case draw) when it is fired
similar to mouseover or mousemove
ronuchit_ 14:07 so is it acceptable to call onPluginReady or any other already-generated method upon a RefreshEvent? i see no reason why that's not okay
taxilian 14:07 well, technically you could; but why on earth would you want to?
ronuchit_ 14:07 alrite, new method it is then
taxilian 14:07 if you want to do whatever it does, then certainly you can, but it will make that method less useful because then you don't know if it's the framework telling you that the plugin is set up and ready or if it's your function calling it
ronuchit_ 15:07 ok, makes sense
FB::PluginWindowWin *wnd = dynamic_cast<FB::PluginWindowWin*>(win); <---- this line could be replaced by changing PluginWindow to PluginWindowWin on the EVENTTYPE_CASE
correct?
taxilian 15:07 correct; however, if you were to do that, then it wouldn't compile on Mac or Linux (or at least wouldn't work)
ronuchit_ 15:07 that's fine
that example: super helpful
taxilian 15:07 yes; that's one reason why reading the examples is listed as something to do before asking in the IRC room ;-) you'll find a lot of really good stuff in that example in particular
however, I should also clarify that we didn't put up that suggestion until this morning
ronuchit_ 15:07 in what class are Begin/EndPaint?
taxilian 15:07 those aren't in a class; they are windows API function
s
ronuchit_ 15:07 alrite. google time
taxilian 15:07 you learn fast ;-)
ronuchit_ 15:07 i learn fast when i'm scared
taxilian 15:07 lol
ronuchit_ 15:07 not a compliment
taxilian 15:07 well, I apologize for not being offended, then
ronuchit_ 15:07 apology accepted
http://msdn.microsoft.com/en-us/library/dd162760(v=VS.85).aspx
in this whole list of functions
i can't find a neat, easy, convenient one that takes an image as parameter and puts it on the window
as i had found in the .net api
taxilian 15:07 unfortunately, "neat", "easy", and "windows API" are rarely found together...
try StretchDIBits
ronuchit_ 15:07 oh lord
A pointer to a BITMAPINFO structure that contains information about the DIB.
that sounds ridiculous
those last 4 params are throwing me off...
linearray 15:07 The DrawState function displays an image and applies a visual effect to indicate a state, such as a disabled or default state.
taxilian 15:07 .g StretchDIBits
FireBreathBot 15:07 taxilian: http://msdn.microsoft.com/en-us/library/dd145121(v=vs.85).aspx
linearray 15:07 this what you want?
*wild guessing
taxilian 15:07 interesting; that might also work
not sure
ronuchit 15:07 hm
stretchdiwhatever is starting to make more sense now
the only one i am confused about after reading the example is how to create this bitmapinfo thing
and what that even is
A pointer to a BITMAPINFO structure that contains information about the DIB.
taxilian 15:07 hang on; I have an example somewhere, let me check if I can give it to you (I don't own it)
ronuchit 15:07 ok
taxilian 15:07 https://gist.github.com/1068352
and that is my apology for being too harsh on you and scaring you ;-) (though I hope you'll still think about what I said)
you'll notice that code supports both windowed and windowless mode
ronuchit 15:07 don't mess with 15 year olds, we can make you feel bad ;D
taxilian 15:07 lol. well, I started programming when I was 7, so I've been there...
ronuchit 15:07 nice.....
i started in 7th grade. i think.
anwyay
anyway
cool, most of this is what i already did
which means i'm doing something right for once
taxilian 15:07 I have similar code for Mac, btw, if anyone needs it
ronuchit 15:07 now, is there a guarantee that my plugin is windowed?
taxilian 15:07 windowed is the default on windows; however, windowless may be better for what you want.
ronuchit 15:07 dang it
gotta go figure out how to do that
taxilian 15:07 the difference is that with windowed it doesn't participate in the DOM z-order; so you can't float a div over it
I'll give you that one for free; hang on
!findfile FBTestPlugin.cpp
FireBreathBot 15:07 Found 1 matching file(s) in the master branch. First 1 are:
examples/FBTestPlugin/FBTestPlugin.cpp http://goo.gl/PFCgg
ronuchit 15:07 for free?!?
taxilian 15:07 (it's not well documented). :-P
ronuchit 15:07 OH
taxilian 15:07 although if you wanted to add it somewhere appropriate on the wiki that would be awesome
ronuchit 15:07 a pluginwindow
can be casted to either
pluginwindowwin or windowlesswin?
taxilian 15:07 no; a plugin window may be one or the other
ronuchit 15:07 so you need to check both
which is what this example does
so how can you control which one your pluginwindow is
taxilian 15:07 right
https://github.com/firebreath/FireBreath/blob/master/examples/FBTestPlugin/FBTestPlugin.cpp#L152
you return true from that method and it will always be windowless
ronuchit 15:07 oh
hahaha
taxilian 15:07 same with returning false for never
it's really hard ;-)
ronuchit 15:07 i remember seeing that
hehe
taxilian 15:07 seriously, though, if you wouldn't mind adding that to tips and tricks or something that would be awesome
one really good way that you can give back to this project is to help update the docs in places where it didn't make sense to you
ronuchit 15:07 i'll see if i have time, i'm kinda on a time constraint
taxilian 15:07 as are we all
ronuchit 15:07 yep
er
we're supposed to write isWindowless()?
taxilian 15:07 if you want to force it to always be windowless, that's how you do it
override the virtual method
!find isWindowless
FireBreathBot 15:07 Found 1 possible matches. Displaying 1
/^bool PluginCore::isWindowless()$/ (f) found in src/PluginCore/PluginCore.cpp: http://goo.gl/96BTo
taxilian 15:07 that's the original
ronuchit 15:07 virtual method=in plugincore?
oh, there's my answer
haha
taxilian 15:07 FireBreathBot is a useful fellow
ronuchit 15:07 did you program that thing?
taxilian 15:07 yeah
ronuchit 15:07 god
so amazing...
kylehuff 15:07 you can call him Mr. GOD, thanks
=c p
taxilian 15:07 lol
ronuchit 15:07 i like the random comments outta nowhere
taxilian 15:07 kylehuff sticks around mostly to do that, I think. he also seems to do more documentation than most anyone else around lately, despite the fact that he isn't actively using FireBreath for anything
hey, anyone know of a reasonable library that can be used to convert a pdf to an image on windows?
with Mac I can load it with CoreGraphics
kylehuff 15:07 I do too much PT for actual coding anymore... not that I did a whole lot to begin with.
ronuchit 15:07 hey
so i returned true from iswindowless
is there any need to include code for pluginwindowwin anymore
taxilian 15:07 don't think so, no
I think Rob left that in because he planned to donate it back to the project
ronuchit 15:07 http://www.firebreath.org/display/documentation/class+FB+PluginWindowlessWin
why is there no getHDC method?
taxilian 15:07 because on windowless you don't get a HWND
you just get a hDC
ronuchit 15:07 hdc=windowlesswin->getHDC();
^ this method is not in the docs
taxilian 15:07 !wiki getHDC
FireBreathBot 15:07 0 results found. Note: Results limited to 8
taxilian 15:07 huh. sure enough
I should probably add that someday
ronuchit 15:07 do i win/
?
taxilian 15:07 my channel, I get to win
but I'll admit that you're right
ronuchit 15:07 wtf
that's hardly fair!
ok
taxilian 15:07 who said things were fair?
ronuchit 15:07 good enough
:P
taxilian 15:07 =]
ronuchit 15:07 oh yeah, we're in software
what does "fair" even mean, the compiler always wins
taxilian 15:07 that, my friend, is a very deep truth
ronuchit 15:07 r.left, r.bottom
those are methods withing FB::Rect?
within*
taxilian 15:07 members, yes
!find FB::Rect
FireBreathBot 15:07 Could not find any tags matching FB::Rect
ronuchit 15:07 sorry members
taxilian 15:07 !find Rect
FireBreathBot 15:07 Found 1 possible matches. Displaying 1
/^ struct Rect {$/ (s) found in src/ScriptingCore/APITypes.h: http://goo.gl/xJCGm
ronuchit 15:07 hey
The x-coordinate, in pixels, of the source rectangle in the image.
what does that mean?
taxilian 15:07 the source rectangle is the portion of the image that you want to draw
ronuchit 15:07 so what corner of the source rectangle is this referring to?
taxilian 15:07 what is the name of the parameter?
I don't even know what function call you're talking about
ronuchit 15:07 XSrc
stretchdibits
taxilian 15:07 probably the left, then
look at the example I gave you and see what it is doing
ronuchit 15:07 what does DIB stand for?
nvm
i got it
device-independent bitmap
EVENTTYPE_CASE(FB::RefreshEvent, draw, FB::PluginWindow)
it keeps saying RefreshEvent isn't a member of FB
even though when i type FB::, refreshevent is one of the options in the list
taxilian 16:07 !find RefreshEvent
FireBreathBot 16:07 Found 3 possible matches. Displaying 3
/^ RefreshEvent() { }$/ (f) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
/^ RefreshEvent(FB::Rect inBounds)$/ (f) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
/^ class RefreshEvent : public PluginEvent$/ (c) found in src/PluginCore/PluginEvents/DrawingEvents.h: http://goo.gl/RItIL
taxilian 16:07 if it says that then you're missing an include
ronuchit 16:07 nvm i got it
yeah, it was the drawingevent.h
if i'm understanding this correctly, i don't need to call draw() from mypluginapi.cpp, because it will automatically be called every time refreshevent is fired? so in turn, i should have to do absolutely nothing except <object> in my html code to put the object on the window, and everything else should happen...
taxilian 16:07 that is mostly correct; the one thing you will want to do, though, is any time your image changes you should call invalidateWindow() on the pluginwindow
that will tell the browser to send a RefreshEvent
otherwise it doesn't know that you need to be redrawn
ronuchit 16:07 can i get an example of that? :]
taxilian 16:07 it's just a function call on the pluginwindow object
go look at it
ronuchit 16:07 i did
taxilian 16:07 also, I think there is an example in FBTestPlugin
ronuchit 16:07 but how do you tell when the image has changed...
taxilian 16:07 grep is your friend
I don't know, I'm not the one changing the image
ronuchit 16:07 grep...?
taxilian 16:07 .lmgt grep
FireBreathBot 16:07 Let me google that for you: http://goo.gl/5r12C
ronuchit 16:07 i like this thing
ronuchit 16:07 well it's compiling now, but when i open firefox it simply displays the words "firebreath plugin" on this 300x300 window, which surprises me because there is no reference to those words anywhere in my program. is this some sort of auto-generated default that you set?
i simply don't understand where those words are coming from.....
taxilian 16:07 there actually might be a default set that way, come to think of it
!findfile PluginWindowWindowless
!findfile PluginWindowlessWin
FireBreathBot 16:07 Found 2 matching file(s) in the master branch. First 2 are:
src/PluginAuto/Win/PluginWindowlessWin.cpp http://goo.gl/pMsj1
src/PluginAuto/Win/PluginWindowlessWin.h http://goo.gl/UqJZ9
taxilian 16:07 yeah; are you returning true from your RefreshEvent handler?
that tells it that you handled the event
and it shouldn't do anything
ronuchit 16:07 let me test that
oh wtf
i just put a return false at the end...
ok
as you said, when i return true, i see nothing displayed
on the window
when i return false the words "firebreath plugin" appear
taxilian 16:07 https://github.com/firebreath/FireBreath/blob/master/src/PluginAuto/Win/PluginWindowlessWin.cpp#L120
ronuchit 16:07 ok, so the event is not being fired
oh
i think i know why
maybe cause i didn't include the call to invalidatewindow() as you said to
ugh, i did that and the error persists
it seems refreshevent is not getting fired, ever. i think that causes "firebreath plugin" to be displayed on the window
taxilian 16:07 what is the EVENTTYPE_CASE line you're using?
ronuchit 16:07 EVENTTYPE_CASE(FB::RefreshEvent, draw, FB::PluginWindow)
taxilian 17:07 ronuchit: I don't know; you could set a breakpoint in PluginWindowlessWin and make sure the draw event is being called
then step through and figure out why it isn't getting to you
ronuchit 17:07 news flash: employer wants a windowed window :)
taxilian 17:07 why?
does employer know what that means?
ronuchit 17:07 he sounds like he does. i don't plan to argue =]
he just said that's what was needed.
well now that I made it a windowed window, nothing is displayed on the window at all
taxilian 17:07 all you plan to do is show an image, right?
ronuchit 17:07 yea
taxilian 17:07 then unless he has a very good reason why he needs a window, he doesn't want one
you don't need a window to draw — some people think windowless means no drawing
that is not the case
ronuchit 17:07 i understand
i also can't do anything about it
well
i'll just put it into an if statement :P
make it easy to switch
taxilian 17:07 oh? you can't talk to him and tell him that the person who wrote the plugin framework you're using says this is likely not really what he wants and double check?
ronuchit 17:07 ok
but if i get fired, i blame you
taxilian 17:07 fair enough. however, I would like to point out that if you get fired because on the recomendation of an expert on what you're trying to do you double checked to make sure you were doing what your boss wants, your boss is an idiot and you need to find a new jbo
or job; whichever is more convenient
ronuchit 17:07 hahaha
yeah i'll talk to him
let me reconnect
ronuchit 17:07 i can't put breakpoints in my vs2008
taxilian 17:07 is it express?
ronuchit 17:07 it skips right over them when i run the .html
no
taxilian 17:07 you probably aren't attaching to the right process
ronuchit 17:07 i mean, i can put breakp[oints
but it ignores them
taxilian 17:07 or else you aren't attaching in native mode
!wiki debugging
FireBreathBot 17:07 8 results found. Note: Results limited to 8
"Debugging Plugins": http://goo.gl/U9TGz
"Building on Mac OS X": http://goo.gl/iQ1mh
"Logging": http://goo.gl/0Ms1C
"Building on Windows": http://goo.gl/VYTcE
taxilian 17:07 I gotta run now, though. good luck
ronuchit 17:07 alright :(
bye
ronuchit_ 19:07 can someone explain how to set breakpoints in vs 2008, it seems to skip right over the breakpoints when i run my html code in firefox
dougma 19:07 what process have you attached to?
ronuchit_ 19:07 what do you mean?
dougma 19:07 is called firefox.exe?
or is it plugin-container.exe?
how are you starting the debugger?
ronuchit_ 19:07 should i be attaching to firefox.exe?
dougma 19:07 what _are_ you attaching to?
Feeling 19:07 is skip breakpoint if i attaching to firefox.exe(firefox4)?
ronuchit_ 19:07 right now attached to bcmdeviceandtaskstatusservice.exe
dougma 19:07 that's your problem, read this link taxilian gave you "Debugging Plugins": http://goo.gl/U9TGz
ronuchit_ 19:07 alright
ok i attached firefox.exe
but wherever i place a breakpoint, it says the breakpoint will not be hit
even though i know it will hit that point
Feeling 20:07 dougma: where is function like DoPropExchange?
Feeling 20:07 oops, that's stupid question....:(
dougma 20:07 ronuchit_: are you running firefox with in-process or out-of-process mode?
Feeling 20:07 dougma: how to getting HWND in OnPluginReady?
dougma 21:07 you can't
you wait until window attached
Feeling 21:07 OnAttached Event?
dougma 21:07 i think that's what it's called
Feeling 21:07 ok. thanks.
taxilian 21:07 Feeling: AttachedEvent it is called
ronuchit_: you need to disable ipc on firefox 4 or you won't get your breakpoints. instructions on that page
Feeling 22:07 taxilian: a u there?
taxilian 22:07 semi
Feeling 22:07 i know firebreath has has 2 class.
it's MYPluginName Class, and MYPluginNameAPI Class
taxilian 22:07 that's your plugin, not FireBreath
but yeah
Feeling 22:07 so, where i put delicate class?
which one?
taxilian 22:07 delicate?
Feeling 22:07 delegate
i mean, put main class instance
taxilian 22:07 I have no idea what you're talking about
as a general rule, put things that are tied to the instance of a plugin instance (object tag) in the plugin class
and put things that are relevant to the javascript API in the API class
Feeling 22:07 could i access MyPluginNameAPI Class in plugincore class?
taxilian 22:07 of course
getRootJSAPI()
!find getRootJSAPI
FireBreathBot 22:07 Found 1 possible matches. Displaying 1
/^ virtual JSAPIPtr getRootJSAPI()$/ (f) found in src/PluginCore/PluginCore.h: http://goo.gl/M31V9
Feeling 22:07 hm.. i moved all main code in JSAPI to Plugincore...
and JSAPI access to Plugincore member variable.
taxilian 22:07 I don't follow
Feeling 22:07 sorry, i study english more :(
anyways, thanks for help
taxilian 22:07 good luck =]
Feeling 22:07 taxilian: my past question is where am i supposed to actually implement the plugin. plugin.cpp or pluginAPI.cpp.
i found solution in log. thanks.
dougma 22:07 actually implement in the API (or have the API delegate to another 3rd class)
imo.
as required...
:)
although obviously some parts belong in the plugin!
like drawing...
but whatever. :)
Feeling 22:07 :) but, i already moved to implement plugin code from pluginapi.cpp to plugin.cpp
both way is correct :)
dougma 22:07 you'll work it out. :)
dougma 23:07 I'm returning a JSCallbackPtr from one of my API methods.... it works ok in Firefox (ie: the webpage can call it), but not on IE (I get "object does not support this property or method").
anyone seen that?
Feeling 23:07 how to getting pMyClassNameAPI class's instance from plugin.cpp?
dougma 23:07 ah... on ie, it invokes it with the name "value"!
taxilian> !find getRootJSAPI
Feeling 23:07 nono.. that is parent instance
dougma 23:07 cast it
Feeling 23:07 ah.. thanks.
dougma 23:07 FB::ptr_cast<MyClassNameAPI>(getRootJSAPI)
FB::ptr_cast<MyClassNameAPI>(getRootJSAPI())
or something
Feeling 23:07 i was confused, because boost::make_shared. thanks.
dougma 23:07 ...actually FB is mapping DISPID=0 (DISPID_VALUE) to property name "value"