Akshat Gupta

Finally invoved in Open Source :)

akshat[at]php.net

Yes … After a lot form filling(Trick Form) I have been granted the cvs access where i can push the cairo bindings (which was phpCairo) on to PECL.
Lot of things changed on the way … the entire naming convention of each method was changed to Camel Case … Apart from that I had to remove all the traces of phpCairo and so its only Cairo now (Not so cool) .
One of the best (worst) challenges came when I had to return a CairoContext object from php-gtk … Initially I had not planned for it so I had to do lot of further changes and tested it first on a sample extension and then moved on to php-gtk …. As the methods were not defined in php-gtk I asked my mentor Elizabeth to help me out. After some struggle with php-gtk (a noob in that) I could return the CairoContext object ….

But the problem was far from solved. In spite of getting the object we were having difficulty in getting it printed …Again Elizabeth came to rescue and wrote an excellent gtk+, pygtk converted php program and gave it for test .. Hurray it worked !!!!

As of now it seems everything is working properly but Elizabeth just informed me that C gurus will be checking the cairo extension … so now I am waiting cross-fingered …..

Its time I pushed my extension …. before that I would like to thank both my mentors … Anant and Elizabeth for there support throughout the process …. Thanx for solving my stupid doubts …

Advertisements

July 16, 2008 Posted by | gsoc | 1 Comment

phpCairo Update

This is for my mentor …
The Path class and the Pattern class have been completed ….
I have tested them to some extent .. but intensive tests are still to be carried out …
Any way …

June 6, 2008 Posted by | gsoc | Leave a comment

Pit Falls for “C side” php Extensions – I

Just thought of documenting all the pit falls that I went through 😉 :
1. For returning an object from a method use init_object_ex() instead of init_object() as this would help one to distinguish the object then and there so that there is no ambiguity.
2. Never forget to increase the reference count of an object so that the object is not destroyed earlier than expected .. believe me it can happen !!!

Well I am not able to think about other pit falls that I came across … but will surely update this as soon as I remember one …

Till then … as my mentor puts it … “Show me the code !!!”

June 6, 2008 Posted by | gsoc | Leave a comment

CairoSurface … conquered …

After some struggle with overloading the constructor in “c space” the surface class is also done…. So that make the class count to 2 but now we can draw anything on any surface … So whats left now …

There is a need to finish the pattern class and path class. Apart from that I have not implanted the functions that are new to Cairo 1.6 (‘cause I have to install it first ;)) and lot of testing on different environments.

For overloading the constructor please accept all the parameters by using the function call get_parameters() into an array of zval * … now check for all the parameters and get there corresponding data types ….

Its been a long time since I have taken a break 😉 … so signing of for an awesome weekend ….

 

May 31, 2008 Posted by | gsoc | , | 1 Comment

phpCairo Tutorial – I

Cant stop myself from writing this post … I need to tell someone how the code will look on the php user space 😉

Yes this tutorial is about implementing the Hello World Program 🙂

PHP Code :

$sur = new CairoImageSurface(0,400,400);
$con = new CairoContext($sur);
$con->select_font_face(”Sans”);
$con->set_font_size(50.0);
$con->set_source_rgb(0,1,0);
$con->move_to(15,75);
$con->show_text(”Hello World”);
$con->set_source_rgb(1.0, 0.0, 0.0);
$con->set_line_width(10);
$con->rectangle(10,10,350,80);
$con->stroke();
$sur->write_to_png(”try.png”);

End PHP Code

May 27, 2008 Posted by | gsoc | 1 Comment

Yes Context class … you are almost finished

After lot of frustrating moments (Hey coding is all about that) the context class is complete baring a strict testing ….
The good news is that it has passed the first test and I was able to implement the Hello World program …. 🙂
One major issue that I came across was the representation of various return values … At the moment everything is being returned as associative arrays but this can be changed if the need arises. ….
Forgetting all that it is an accomplishment so ….
Cheers !!!

May 27, 2008 Posted by | gsoc | Leave a comment

First Cairo Output

After a long break … work has been resumed.

Finally I could see the version number of phpCairo … so I am all set up now to test all the functions that I have written.

The most useless part was the deforestation of the config jungle … added the cairo library and the linking support during compilation.

So things going good for the moment except that I am a week behind my schedule .. need to work harder to compensate for it.

May 19, 2008 Posted by | gsoc | Leave a comment

Changes to phpCairo

Some changes have been made to phpCairo extensions …. the naming convention has been changed …
instead of cairoClassname it is now CairoClassname.

Added some extra features that have been supported in Cairo 1.6 to the framework.
At present clueless about the Quartz surface and win32 surface ….

May 6, 2008 Posted by | gsoc | 2 Comments

Structure Ready

Phew !!!
Finally the structure of phpCairo is ready as an XML file that is supposed to be used in PECL_codegen to generate the starting code. Now the tough part starts and finally I will be able to reply to my mentors only question … “Show me the code !!”
Writing the XML file taught me a lot about the working of Cairo and now have a broad vision of how Cairo works ….
Its now time to Fill in the Blanks ..

May 4, 2008 Posted by | gsoc | 2 Comments

My first git push :)

After some struggling I was finally able to push some thing on the git server .. repo.or.cz …
The project is http://repo.or.cz/w/phpCairo.git.

Fall backs to be avoided : use git push git+ssh://[username]@repo.or.cz/srv/git/phpCairo.git master

May 3, 2008 Posted by | gsoc | Leave a comment