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

IRC Nick Time (GMT-7) Message
someone-noone 04:08 linearray: you may buy a fan. It costs ~8$ in my country and it also solves problem with warm air.
linearray 04:08 I have one :)
someone-noone 04:08 taxillian: Ulan-ude? Lol, it's near Baikal lake. I guess you're even closer to that place than me. There is completely no civilization, but very nice nature
linearray: doesn't it help you?
linearray 04:08 it helps a bit, but doesn't really solve the problem
someone-noone 04:08 hm, may be you need to more powerful one
linearray 04:08 but it definitely was worth the cost :)
on friday we will get 37 C
a fan just doesn't cut it
someone-noone 04:08 I do not envy
linearray 04:08 to be fair, summer is merely catching up... it was raining thoughout july
someone-noone 04:08 all temperature above 28 C is hot for me
linearray 04:08 +r
someone-noone 04:08 same thing here. It was raining for a half of the summer, and another half was very warm. Hate such weather
I'm with my friends was going on picnic this summer and our plans were broken by unpredictable rain
and you don't know will it rain or no tomorrow
taxilian 09:08 someone-noone: I spent 5 months in Irkutsk and 2 in Angarsk; I have been to Baikal a couple of times. absolutely beautiful area
Frank 10:08 Hello
linearray 10:08 hi
Frank 10:08 Can you hekp me please
Did you read my post?
linearray 10:08 what's up
Frank 10:08 I just want to add an object-c routine in my porject
linearray 10:08 ah yes
Frank 10:08 I have made a project Checker and add an object c file
So I have checker, cherkerAPI and checherMAc.mm
Sorry for my typing, i will do me best
taxilian 10:08 howdy
Frank 10:08 hello
taxilian 10:08 so pastebin what you've tried
and we'll see if we can figure out what you're missing
I am Richard
Frank 10:08 can i send you my project?
Hi Richard
taxilian 10:08 you can, but I don't have time to dig through it all right now; it would be easier for you to just pastebin the relevant files
.pb
FireBreathBot 10:08 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
Frank 10:08 ok, but I have never worked with that
taxilian 10:08 it's pretty easy; just follow one of the links FireBreathBot gave you
Frank 10:08 ok, i'll do that
What file do you want?
taxilian 10:08 ok, let's back up; your problem is that you have objective C code that you need to call from a FireBreath class, right?
Frank 10:08 yes, that it
taxilian 10:08 okay; so there are two things you need to learn
Frank 10:08 I want to send a string to my objective-c and get one back
taxilian 10:08 the first is how to add methods to FireBreath itself
and then the next will be how to call objective C from a C++ class
have you tried creating a straight C++ firebreath plugin?
Frank 10:08 I can already did a test to add a routine and taht is working fine
yes I did and it works
taxilian 10:08 okay, great. the easiest way to do the second is to create a c++ class and put the implementation in a .mm file
in a .mm file you can mix c++ and objective c; technically it's then called objective-c++
but it's pretty close to what you're used to, since c++ is just a superset of c
do you know how to create a C++ class?
Frank 10:08 no
taxilian 10:08 .lmgt create a c++ class
FireBreathBot 10:08 Let me google that for you: http://goo.gl/EZrwV
taxilian 10:08 a few guidelines to help you get started
generally you put the class definition in a header file (the .h file) just like in objective c
and you put the implementation in the .cpp file; except this time you'll put it in a .mm file
Frank 10:08 ok, can I use CheckerMac.h for that?
taxilian 10:08 so you created a CheckerMac.h?
Frank 10:08 yes
taxilian 10:08 pastebin me that file
Frank 10:08 and CheckerMac.mm
how do you get that, I pastebin-it with ,
taxilian 10:08 you pastebin it and then you give us the URL for the paste
Frank 10:08 sorry, where can i find the url?
http://fpaste.org/OcUU/
taxilian 10:08 okay; that's a valid class, but it is not extending Checker
so if you wanted it to be easy to just call it on the plugin object, you need to extend Checker
your main problem is that you're trying to write something without learning the programming language it's written in first
that is always going to go very very slowly
Frank 10:08 yes I know
but I just need that 'bridge' to get in Objective-C
taxilian 10:08 no, you need more than just a bridge; you need to understand what is going on
or you'll shoot yourself in the foot and not even notice
you can't write a basic firebreath plugin without a basic understanding of C++
Frank 10:08 what do you suggest I do then
taxilian 10:08 there are too many things that can go wrong in a browser plugin
I suggest you take a couple days and do a crash course in C++
or find someone who knows C++ that you can have help you with it longer term
Frank 10:08 that is impossible for just a small routine
but it can't be that hard to send and receive a string
taxilian 10:08 it's up to you, but if you don't even know c++ well enough to follow the few suggestions I've given you (and I'm sorry, I'm not trying to be rude) you're most likely going to have this blow up in your face at a later point even if you do get it working; even with FireBreath, browser plugins are fickle
send and receive a string? no, that's not very hard at all
now, lifecycle? that's harder
memory management?
what exactly si your objective c code doing?
Frank 10:08 just sending a terminal command
taxilian 10:08 sending to where?
Frank 10:08 it is like doing an ls -al and getting the directory in a string a back
linearray 10:08 there are better ways to do that ;)
taxilian 10:08 heh. I don't think he means that it's exactly that; I think he means it's launching a process and returning the output
Frank 10:08 I recieve a string that is encrypted, the command will uncrypt and make an new string, encrypt again and send back
taxilian 10:08 so the only reason you even need to call an objective c command is because that's the only API you know for launching the process?
Frank 10:08 that's all i has to do, and it's working now with a webkit plugin
yes
taxilian 10:08 okay; you don't actually need to write your own webkit class at all, then
and you're never planning to use this on windows?
mac only is sufficient?
Frank 10:08 no never
yes
taxilian 10:08 okay; rename your API .cpp file to a .mm file
edit the CMakeLists.txt where it includes *.cpp to also include *.mm
and rerun the prep script
Frank 10:08 the CheckerAPI.cpp
taxilian 10:08 right
then add a function to your JSAPI object
and do your objective C stuff right in there
remember that you don't have an autorelease pool by default, so if you're using anything that expects one you need to put it there yourself
Frank 10:08 ok
taxilian 10:08 if you do some google searches you should be able to find instructions on how to convert from a std::string to a NSString
and back
Frank 10:08 ok, thank you
taxilian 10:08 I guess I just got the impression that you needed to do something more involved
I hope that works for you
Frank 10:08 can the CheckerAPI.mm stay in 'Source Files'
taxilian 10:08 keep in mind that this could cause problems if that process you're waiting on takes long to run
so I hope it's fast
Frank 10:08 no, I just miss a basic start to go on, it is really not complicated
it is very fact
it seems i have lost the file after the 'prepmac'
taxilian 10:08 did you edit CMakeLists.txt?
Frank 10:08 no
taxilian 10:08 you might want to do that =]
Frank 10:08 yes, its back
can it stay in the 'Source File', even it is for the MAc?
taxilian 10:08 yes
as long as you don't plan on running this on window
windows
Frank 10:08 so, CheckerMac can be deleted?