Extending PHP-Gtk2
| From: | Anant Narayanan | Date: | Fri, 03 Mar 2006 14:50:03 +0000 |
| Subject: | Extending PHP-Gtk2 | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-2486@lists.php.net to get a copy of this message | ||
Hi All!
After battling with the 3rd alphabet of the English language for over 12
hours now, I have finally accepted defeat.
All I wanted to do was to add an extension to PHP-Gtk2: some "source
editor" that would provide advanced features that GtkTextBuffer/View
doesn't have. Scintilla was an obvious choice, since it had already been
implemented in PHP-Gtk1; and I had also come across GtkSourceView which
also seemed pretty nice.
First I had problems with sorting out the config.m4 and Makefile.frag
files, the ext_skel script in the ext/ directory sadly does not provide
a working copy of these files. After lots of imitation with the only
extension currently implemented (libglade) I was finally able to
./configure successfully.
Another few hours were spent in authoring minimal .def and .overrides
files so that make does not fail. When "make" did not produce any errors
I did a "make install". Just when I thought I had done it, I received
errors when I actually ran php, what's more they were different for each
extension that I enabled.
Enabling GtkScintilla (./configure --enable-scintilla), gave me a
"Segmentation Fault" when I ran PHP and enabling GtkSourceView
(./configure --enable-sourceview) gave me "Undefined symbol:
phpg_sourceview_register_constants".
Yes, my C sucks :(
Anyway, I committed my work files to the CVS tree (ext/scintilla and
ext/sourceview), since it would not disrupt anything as the extensions
have to manually enabled to be built. I have included
ref.sourceview.defs, ref.sourceview.overrides, v1.scintilla.defs and
v1.scintilla.overrides as reference in the same directories.
If anybody would be so kind as to kindly point me in the right direction
(What am I doing wrong, Why doesn't it work!), I would be more than
happy to take these and more extensions all the way to the finish line.
The existing libglade extension doesn't seem to be a good enough example
for me to emulate.
Thanks and Regards,
--
Anant
Find Freedom, Go Open Source!
http://www.kix.in/