gtkhtml update
| From: | Alan Knowles | Date: | Sun, 28 Oct 2001 16:33:34 +0000 |
| Subject: | gtkhtml update | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-150@lists.php.net to get a copy of this message | ||
I've just uploaded the latest copy of gtkhtml to
http://midgard.hklc.com/phpgtkhtml.1.0.tgz
Below is the readme from the file, the only thing left on the todo list is to make sure that object
based callbacks work. other than that it is pretty much completed.. - the tes t program event works
without curl.. (as I used non blocking fsockopen).. with a bit more work (eg. connect the link
presses to callbacks) it could be made to browse things...
regards
alan
---------README----------------------
Prerequisites (or stuff you are going to need).
/---------------------------------------------------
A UNIX system! (sorry unless windows binaries are available - this will be so for a little while!)
On a packaged system Redhat/Mandrake/Debian
libgtkhtml, libgtkhtml-dev
-- these have quite a few dependancies *
like..
libgal, libgnomeprint,libdb3, libgdk_pixbuf
libart_lgpl,libgdk_imlib,libgnome
It may also depend on libgconf (optional)
On non package systems (or build it yourself)
libgtkhtml is available from
ftp://ftp.gnome.org/pub/GNOME/unstable/sources/gtkhtml
Downloading
/-----------------------------
current location of php gtkhtml bindings ..
http://midgard.hklc.com/phpgtkhtml.*.tgz (see
version number)
Building
/-------------------------------------------------------
Move this directory (ext/html) into the ext directory of php-gtk
run
/configure --enable-html --enable-scintilla ... (and all the other extensions you want)
make
make install
General info:
/----------------------------------------------------
most of the conversion is pretty straight forwared - the c function maps closly to the
php one.. - have a look at html.defs for a rough idea. (below all the enums)
/-- Oddities
Save
takes 1 argument - the call back function that recieves the data.
This function then recieves the data in a string.
Export
takes 2 argument - the type and the call back function that recieves the data.
This function then recieves the data in a string.
connect_url_request("function")
because the callback for url_request returns a pointer to a pointer, the base
gtk library would never be able to understand this - so I had to add a special callback
wrapper for this callback
set_editor_api
- this one is strange..., the editor api struct is a series of callbacks for different editor events
the php version of this function is rather long winded, but works..
$gtkhtml->set_editor_api(
callback check_word,
callback suggestion_request,
callback add_to_session,
callback add_to_personal,
callback command,
callback event,
callback create_input_line)
each of these functions will call back in different ways...
function checkword("word") return TRUE/FALSE
function suggestion_request("word")
function add_to_session("word") // no idea what this does.
function add_to_personal("word") // no idea what this does.
function command(commandtype (look at the enums for command in html.defs)) return TRUE/FALSE
function event(eventtype, STRING|0)
3 types of event: command,image_url,delete
delete returns 0 as the second entity, the other 2 return strings.
event type is another enum!
function input_line(0) // this is messy cause I'm not sure how to return the empty function
$gtkhtml->set_color($string|$r,$b,$g)
$gtkhtml->set_default_background_color($string|$r,$b,$g)
set colours using "#rrggbb" or r,g,b
The overrides file has to define these due to the HTMLStream Resource not being handle in the Gtk
Wrapper lib.
$gtkhtml->begin,begin_content,write,end
TODO:
/-----------------------------------------------------------------
or whats remaining:
URGENT:
All callback functions should take arrays as the function and use this to do object callbacks
Enumerated (enums) are defined in defs:
these are interpreted by the gtk library - and from my guess will never work as strings.
however they should work as constants - so that will have to do!
There is also a nasty hack of creating the GTK_TYPE_GTKHTML enums...
gtk_htmleditorapi_create_input_line
does not currently allow you to return a widget!
GtkHTMLStream Resource does not free the Gtkstream Struct If it is left open.
gtk_html_set_iframe_parent - not converted
print_with_header_footer - not converted
print - not converted
print needs 'Gnome Print' to work - which may be a little while...
gtk_html_set_iframe_parent = maybe later.. when I work out what it is used for.