IRC Log Viewer » #firebreath » 2012-01-18

IRC Nick Time (GMT-7) Message
reichi 08:01 lol
i just stumpled upon the hack in getGdkWindow(void *in)
it's not exactly what one would expect to find there ;)
mkoch 09:01 hi!
can someone help me with CoreAnimation? I used the BasicMediaPlayer as an example to display my own stuff. I replaced the CAOpenGLLayer with CALayer as I need only 2D, and managed to display my bitmap data in a CGImage. it gets displayed correctly once onWindowAttached() is called
my problem is that while CAOpenGLLayer supported some kind of a self updating with a given time interval, it seems for the CALayer I have to do it myself by calling setNeedsDisplay on it
where should I put this piece of code?
it would be the main loop of my plugin, stg like while(1){ redraw(layer); sleep(t); }
Jake__ 09:01 hey guys.. can somebody help me with how to use the getfilesystempath thing??? i just can't really seem to understand how to call it to my JSAPI class so that it can be a method to be called in javascript
ch 10:01 mkoch, I'm curious: if you're not going to draw 3D, why are you doing CoreAnimation?
Jake__ 10:01 can someone please help me how to get the path where the dll is??? i want it to be called by javascript... how can this be done?
taxilian 10:01 Jake__: go read the tips and tricks page on the website
Jake__ 10:01 i did what was there.... but when I built the project it generated errors
taxilian 10:01 I can't help you without specifics
Jake__ 10:01 pardon me... it didn't generate errors but when I accessed it using JavaScript... it said it is undefined
taxilian 11:01 I can't help you without specifics
Jake__ 11:01 just like what was in the tips and tricks... i put the std::string MyPlugin::getFilesystemPath() { return m_filesystemPath; } in the plugin class which extends PluginCore
in my case... the Plugin.cpp
so how should I call that method in my JSAPI class?
taxilian 11:01 assuming you created it recentlyish, there should be a getPlugin method on your JSAPI class
and you should be able to call getPlugin()->getFilesystemPath()
or, if you really want to go crazy, you could go look at FBTestPlugin which has an example of doing *exactly* what you're trying to do
Jake__ 11:01 are you referring to the getPlugin method with the datatype PluginTestPtr?
taxilian 11:01 yes
Jake__ 11:01 when i built it it had an error again..
the error said.. getPlugin: identifier not found
taxilian 11:01 and where is this code located?
Jake__ 11:01 in the JSAPI.cpp
taxilian 11:01 okay; that means it's not part of the class
so of course it can't find it
Jake__ 11:01 i don't understand... i thought getPlugin() is in the JSAPI class.....
so what should I do about this sir?
taxilian 11:01 go get a C++ tutorial and learn how to add methods to your C++ class
Jake__ 11:01 I already know how.. although I'm not that good at it... i just don't quite understand the framework... it's confuses me
taxilian 11:01 I'll give you a hint, though: the function prototype will start iwth something like "string Plugin::getPath()"
reichi 11:01 taxilian: i guess i do understand now why someone wrote "moving firebreath to autotools" can be painful :/
Jake__ 11:01 I just don't know in what files to put it in... :( wew
taxilian 11:01 reichi: yeah, it would be possible but not eary
and it wouldn't really make sense
Jake__: your problem has very little (almost nothing) to do with the framework itself
reichi 11:01 taxilian: well i am doing it
taxilian 11:01 you are trying to access members of a class from a function that you haven't put inside that class
reichi 11:01 BUT
i have some reasons
taxilian 11:01 reichi: in the name of all that is coded in binary, *why*??
reichi 11:01 otherwise i wouldn't ;)
two reasons...
1st: i "need" to crosscompile
we actually have openembedded as toolchain
taxilian 11:01 re: 1st: you can crosscompile with cmake as well
reichi 11:01 2nd it needs to integrate into another thing
that has quite some dependencies
taxilian 11:01 okay, I'm still not seeing a valid reason for putting yourself through that much pain (both now and later)
reichi 11:01 which i would all have to resolve using crazy absolutley mindfu**** cmake find modules
well it looks ok...
taxilian 11:01 dude, you can totally have the dependencies output the libraries you need and write a cmake helper thing to find it
it's your time, but I pretty much guarantee there is a simpler way to do what you need without converting it to autotools
reichi 11:01 the thing is no one of "us" knows cmake
not at all
but there are some guys that are very much into autotools (which I am not, but I'm learning a lot)
Jake__ 11:01 ok thanks for the advice
reichi 11:01 maybe there's an easier way
i started writing some cmake find-modules
to finde the includes
and it felt pretty painful for me
considering that the project ist linux only
and pkgconfig could do it with a single line
Jake__ 11:01 thanks again... bye :D
taxilian 11:01 you can use pkgconfig from cmake
reichi 11:01 yes but i do have to write 30 lines of code for every lib
or well
copy them
and fix them
plus it integrates horribly with openembedded
but yeah
i am not saying you are wrong ;)
because I think i've reach the point where pain starts ;)
reached even...
taxilian 12:01 well, it's your call. consider, though, that even if you convert it all to autotools you'll then be stuck trying to manually move forward any changes that ever happen in firebreath, or you'll be stuck with the version you have now
so it's not just a lot of pain and work now; it's longer term too
reichi 12:01 i know that :)
taxilian 12:01 whereas if you use cmake and just throw together some macros to simplify the repeated code you have pain now, but longer term not too much trouble
reichi 12:01 hmm
welll i bascially did what's described here:
taxilian 12:01 bleh
hang on, let me dig a bit
if you're just needing to use pkgconfig, check out X11.cmake
!findfile X11.cmake
FireBreathBot 12:01 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 12:01 basically you have one line per thing you need to find; pkg_check_modules(VARNAME REQUIRED package_name)
all the other stuff it has you doing basically just verifies that the specifics you need are there; doesn't sound like you need to do that, since you control the packages
so that's overkill
reichi 12:01 oh
it though it have to that...
especially the include_dirs stuff
i think i need that?
taxilian 12:01 sure you'll need to add the resulting "found" variables like include_dirs to your projects
and you'll have to add the libs to your target_link_libraries
but you'd have to do that with anything
and it sounds like all the code would be identical for each library, pretty well, so you could just write a macro to simplify it all
reichi 12:01 well
my problem was the following
there is another project
which need to link my fb-based plugin to
and that project has quite some dependencies
taxilian 12:01 okay
reichi 12:01 even qt...
and it felt pretty much impossible to ever include anything
because i just ran from one "couldn't find xyz" into the next
taxilian 12:01 well, like I said; it's up to you. if it were me, though, I'd just have autotools build a config file that you could use from cmake
since autotools presumably knows all the dependencies
so then you'd just pull that file in and everything would work
reichi 12:01 mmh
that's an option i didn't know about
(but sounds promising)
i do have a config.h for that specific project, obviously
taxilian 12:01 I assume autotools can create a file from a template of some sort, no?
reichi 12:01 good questions
taxilian 12:01 so it could make a file with some set(INCLUDE_DIRS path1 path2 path3 path4) etc lines in it?
reichi 12:01 mmh
that would be a really easy thing
taxilian 12:01 you should know that if you can't do that, you won't be able to port FireBreath to autotools anyway because firebreath requires that capability
reichi 12:01 I'm starting to like you Ideas
taxilian 12:01 then you just include that file and you have the info you need
reichi 12:01 that's what I meant with "I think I'm at the point where the pain starts"
it's get's very clear once i had a look at PluginAuto
taxilian 12:01 yeah; PluginAuto and the problems it solves are the primary reason why cmake is needed; also the primary reason that we can't practically make firebreath a shared or static library
reichi 12:01 that's what i discovered today ;)
taxilian 12:01 amazing how all those arbitrary design decisions that you don't like turn out to be not so arbitrary after all, huh? :-P
reichi 12:01 well
it's more about missing know how
and i knew that from the very beginning
taxilian 12:01 yeah; that's usually the case
and maybe if I knew enough I could find a way to make it doable as a shared/static lib despite the challenges
but so far I haven't found a way
but I'm getting a bit closer every time I find time to address the issue
maybe some day
reichi 12:01 i guess it would be a lot less of a problem when targeting only a single platform
taxilian 12:01 yes
and of the three, linux would be the easiest by far
reichi 12:01 but than again, even if i just "resolve" the PluginAuto issue by integrating my plugin directly in the FB Sourcetree
taxilian 12:01 well, by integrating it in the normal way, anyway
it doesno't have to be part of the firebreath sourcetree, just built using cmake
reichi 12:01 yes
if it was jut a boring browser-plugin
i'd just use the devshell
and corss-compile it
but it actually has to interact with the process the qt-webkit-based browser is running in
but out of curiosity
what the hell happens with/between PluginAuto and the actual plugin
taxilian 12:01 what do you mean?
reichi 12:01 well
taxilian 12:01 PluginAuto is built as a static library and linked against it
however, it is built using customized config files generated using PluginConfig.cmake
reichi 12:01 yeah
i got that
taxilian 12:01 it also provides a few of the entrypoints and some other needed functions for configuration
reichi 12:01 global/config.h
plus all those fancy/crazy platform-based things
or platform-dependent things
to be more precise
taxilian 12:01 right
some of those I plan to eventually move into PluginCore; currently there is too much conditional compilation based on config files
reichi 12:01 (again the pain-section when trying to compile that stuff on linux with autotools) :p
jpteasdale 12:01 Is it possible to set a browser cooke from a firebreath plugin?
taxilian 12:01 jpteasdale: through javascript, yes
jpteasdale 12:01 I see, and that could be run as soon as the plugin is instantiated?
taxilian 12:01 sure
just put the code in onPluginLoad
jpteasdale 12:01 ohh, I don't think I've made myself clear
taxilian 12:01 perhaps not
feel free to clarify =]
jpteasdale 12:01 Can I set the cookie from the plugin while only modifying the plugin, ie. run javascript that lives in the plugin so it sets the browser cookie
taxilian 12:01 sure
just put the code in onPluginLoad
!find onPluginLoad
FireBreathBot 12:01 Could not find any tags matching onPluginLoad
taxilian 12:01 maybe it's named different; let me look
!find pluginLoaded
FireBreathBot 12:01 Found 1 possible matches. Displaying 1
/^ function pluginLoaded() {$/ (f) found in gen_templates/FBControl.htm:
taxilian 12:01 hmm
not that one
!findfile PluginCore.h
FireBreathBot 12:01 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 12:01 ahh, onPluginReady
!find onPluginReady
FireBreathBot 12:01 Found 1 possible matches. Displaying 1
/^ virtual void onPluginReady() {};$/ (f) found in src/PluginCore/PluginCore.h:
taxilian 12:01 sorry for the confusion; I've never been good with names, and the person who named things in FireBreath is terrible with names
we should fire him and make someone else do it
FuzzYspo0N 12:01 hey guys, long time :)
taxilian 12:01 hey, welcome back
it has been awhile
FuzzYspo0N 12:01 heh crazy times as always :P
how's it going in here?
taxilian 12:01 same ol' same ol'
FuzzYspo0N 13:01 fair enough. How's FB coming along?
taxilian 13:01 not bad. it's been pretty stable for the last little while; I'm hoping in the next couple of months to start work on 2.0
FuzzYspo0N 13:01 oh yea?
what kinda stuff is 2.0 in for?
taxilian 13:01 mainly a refactor of the cmake to be a cleaner experience
and possibly some significant cleanup in the drawing models
FuzzYspo0N 13:01 ah awesome
once I had it working in my engine i was happy and then got sidetracked moving across the country and making games and all that jazz
but im looking at wrapping it up soon, so i wanted to be sure i was on track
taxilian 13:01 would love to see a blog post some day about how you got FireBreath going with all your stuff =]
FuzzYspo0N 13:01 oh yea? I actually found it easiest to just use a DLL and boost::thread
taxilian 13:01 I'd update to the latest, but there shouldn't be too much trouble; which version are you on?
FuzzYspo0N 13:01 i think it was 1.5.2
taxilian 13:01 no breaking changes since then
FuzzYspo0N 13:01 awesome, there was just the issue of streaming or similar
taxilian 13:01 my personal experience is that all integration strategies and most particularly simpler ones confuse the heck out of half of our new users
FuzzYspo0N 13:01 i have 2 options for my users, which is tricky
taxilian 13:01 so a short writeup of your experience would actually be pretty useful
FuzzYspo0N 13:01 not a bad idea, i will look into writing that a bit later
the context is that i want to embed my game made with my engine on my website. 1) do they download the engine plugin (branded like unity plugin , not really helpful as my brand isn't so critical) , or 2) download a small setup for the game. Then it installs the plugin along side it, and has the minimum files required to launch the browser experience
so my last step is to figure out how to capture the install location, registry isnt really ideal since i want it to be cross platform and the engine runs on mac windows and linux...
jpteasdale 13:01 Excuse the interruption, so what I would do is get the JSAPI Object of the DOM::Document and then use SetProperty("cookie", "cname=cvalue")
taxilian 13:01 (sorry, guys, I'm on the phone)
jpteasdale 13:01 np
Oh, i see ::evaluateJavaScript() is what I was looking for
taxilian 13:01 m_host->evaluateJavaScript()
jpteasdale 13:01 yes, thanks tax
taxilian 13:01 okay, I'm back
FuzzYspo0N 13:01 rad
taxilian 13:01 jptewasdale: you could also use m_host->getDOMDocument()
FuzzYspo0N: not sure I understand concretely what you need; inside the plugin it's easy to get the path of the plugin DLL
FuzzYspo0N 13:01 taxilian, interesting
depending on where they install it, that would possibly be writeable or possibly not be?
(for downloading additional content from the plugin)
taxilian 13:01 depends on where they install it and what browser you're in
FuzzYspo0N 13:01 yea exactly, so if they install the game somewhere weird, it wont be able to play further
as it can't write assets to disk, unless there is an easier way to fetch document paths
like appdata
taxilian 13:01 the default per-user install puts it in the profile directory, in appdata; however, you can't write to that from within the plugin in IE, you'd have to launch an external updater
FuzzYspo0N 13:01 hmm
i actually dont care for IE haha
but then is that even the case from the thread?
or is it the process is not able to write
taxilian 13:01 it's the process
it's in low integrity mode when you're on vista or 7 w/ UAC enabled
FuzzYspo0N 13:01 eugh.
can it launch a diff process even?
taxilian 13:01 and I don't care for IE either, but it still has a very large segment of the market, so most have to use it anyway
FuzzYspo0N 13:01 sure, well i wont need to :P
taxilian 13:01 it can launch a process in medium integrity mode; I think there are links on the wiki about that
or search for low integrity mode and you'll find info
FuzzYspo0N 13:01 ok cool thanks
but in the others?
taxilian 13:01 you baiscally have to put a reg key in the registry when you install to say "this process if launched from IE should be elevated"
FuzzYspo0N 13:01 i guess then the installer needs to be clear about writeable folders
taxilian 13:01 other browsers don't have that issue
FuzzYspo0N 13:01 to the user
taxilian 13:01 if you install without requiring elevation you should be okay
because then you don't have permission to install anywhere that the user can't write to
FuzzYspo0N 13:01 hmm, but i cant really force that on platforms like mac or linux?
taxilian 13:01 on mac/linux you'll have a trickier time of it, yes
just ensure on those that you can only install to the user's folder is what I'd do
FuzzYspo0N 13:01 interesting , i guess thats what i was thinking is it would be forced to install to users
on all platforms
taxilian, you get the use case right? A user installs the menus and level1 with a small, quick installer. Then while they do the tutorials and level1 it grabs level 2 and onward in the background, and only downloads +1 level in advance, so theres no loading times per se
taxilian 14:01 right
FuzzYspo0N 14:01 so that doesnt sound ridiculous, right?
taxilian 14:01 seems reasonable
FuzzYspo0N 14:01 ok cool, i was a bit concerned
i already have download support already so it should be a matter of getting the plugin path (i checked , its easy as you mention), i in fact even had it already. that is how i got my game to work :P by using the path and stashing my files there manually.
taxilian 14:01 also worth looking at the new SystemHelpers.h
!findfile SystemHelpers.h
FireBreathBot 14:01 Found 1 matching file(s) in the master branch. First 1 are:
FuzzYspo0N 14:01 neat
will take a look
oh yes
this is basically what i was looking for
or going to suggest :)
taxilian 14:01 LocalAppData is always writeable
FuzzYspo0N 14:01 yea, thats what i wanted
was like
ECJ 15:01 Hello! I'm seeing an interesting behavior in the newest Chrome browser. When my Javascript obtains a reference to my FB plugin, a JSAPI-Auto object, I can't seem to invoke .nextSibling on it. It simply returns 'undefined'. Other plugins, such as a YouTube video return the next object in the DOM. Any ideas?
taxilian 15:01 ECJ: that's not surprising; you can add nextSibling as a reserved name in your JSAPI class and it shoudl fix it
!findfile JSAPIAuto.cpp
FireBreathBot 15:01 Found 1 matching file(s) in the master branch. First 1 are:
taxilian 15:01 try calling setReserved("nextSibling"); in the constructor of your JSAPI class