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 …
July 16, 2008
Posted by
akshatgupta |
gsoc |
|
1 Comment
Ya …..
Its been a long time since I have posted anything … This might be due to the fact that I have learnt nothing new (which is not possible) or I had no time(Please kick the mentor for that).
After a month of awesome coding finally phpCairo 1.0.1 is complete and is all set to be a part of PECL. The basic functionalities are up and running now only the intricate ones are left to sort out which will be corrected as they are brought forward (The beauty of Open Source).
Along the way there were lot of renaming of files and functions due the the PECL nomenclature which really bugged me but I guess it is required to maintain the uniformity in various extensions.
I could not write the module tests as there are around 300 modules so I have included various examples and there output so that people who want to use phpCairo can learn the syntax fast.
I am looking forward to start my work on php-gtk and use my own extension to integrate with it :).
Thanks a lot Anant and Elizabeth.
June 30, 2008
Posted by
akshatgupta |
Uncategorized |
|
No Comments
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
akshatgupta |
gsoc |
|
No Comments
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
akshatgupta |
gsoc |
|
No Comments
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
akshatgupta |
gsoc |
Add new tag, php |
1 Comment
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
akshatgupta |
gsoc |
|
1 Comment
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
akshatgupta |
gsoc |
|
No Comments
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
akshatgupta |
gsoc |
|
No Comments
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
akshatgupta |
gsoc |
|
2 Comments
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
akshatgupta |
gsoc |
|
2 Comments