com gtk/php-gtk: Sample script and READMEs for GtkMozembed and GtkSourceView.: ext/mozembed/README ext/mozembed/demos/browser.php ext/sourceview/README
[email protected] (David Soria Parra)
| Newsgroups | php.gtk.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: bf537ccfa76afe1ab3906d3159623d6772091fbc Author: Anant Narayanan <[email protected]> Mon, 10 Apr 2006 06:14:11 +0000 Parents: 2cee0384942075cdb4f396b538fc77863fe2788e Branches: master Link: http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=bf537ccfa76afe1ab3906d3159623d6772091fbc Log: Sample script and READMEs for GtkMozembed and GtkSourceView. Changed paths: A ext/mozembed/README A ext/mozembed/demos/browser.php A ext/sourceview/README Diff: bf537ccfa76afe1ab3906d3159623d6772091fbc diff --git a/ext/mozembed/README b/ext/mozembed/README new file mode 100644 index 0000000..5fb35a8 --- /dev/null +++ b/ext/mozembed/README @@ -0,0 +1,9 @@ +LICENSE: Mozilla Public License / (Optionally LGPL/GPL) +AUTHOR: Mozilla.org +URL: http://lxr.mozilla.org/mozilla/source/embedding/browser/gtk/src/ + +GtkMozembed is a widget that allows you to embed the Mozilla engine in your Gtk+ +applications. Check the demos/ directory for sample script(s). + +You need to add the --enable-mozembed switch to your ./configure statement when +you build PHP-GTK 2 in order to enable this extension. diff --git a/ext/mozembed/demos/browser.php b/ext/mozembed/demos/browser.php new file mode 100644 index 0000000..c1c630a --- /dev/null +++ b/ext/mozembed/demos/browser.php @@ -0,0 +1,68 @@ +<?php + + global $location; + global $mozComponent; + $location = new GtkEntry(); + $mozComponent = new GtkMozEmbed(); + + $goButton = GtkButton::new_from_stock(Gtk::STOCK_OK); + $stopButton = GtkButton::new_from_stock(Gtk::STOCK_STOP); + $goForward = GtkButton::new_from_stock(Gtk::STOCK_GO_FORWARD); + $goBackward = GtkButton::new_from_stock(Gtk::STOCK_GO_BACK); + + $goButton->connect_simple("clicked", "goto"); + $stopButton->connect_simple("clicked", "stop"); + $goForward->connect_simple("clicked", "forward"); + $goBackward->connect_simple("clicked", "back"); + + /* Home Page! */ + $mozComponent->load_url("http://gtk.php.net/"); + + $locationBar = new GtkHBox(); + $locationBar->pack_start($location); + $locationBar->pack_start($goButton); + $locationBar->pack_start($stopButton); + $locationBar->pack_start($goForward); + $locationBar->pack_start($goBackward); + + $mainBox = new GtkVBox(); + $mainBox->pack_start($locationBar, false, false); + $mainBox->pack_start($mozComponent, true, true); + + $mainWindow = new GtkWindow(); + $mainWindow->maximize(); + $mainWindow->set_title("PHP-Gtk2's first web browser!"); + $mainWindow->add($mainBox); + + $mainWindow->show_all(); + $mainWindow->connect_simple("destroy", array("Gtk", "main_quit")); + + Gtk::main(); + + function goto() + { + global $location; + global $mozComponent; + $url = trim($location->get_text()); + $mozComponent->load_url($url); + } + + function stop() + { + global $mozComponent; + $mozComponent->stop_load(); + } + + function forward() + { + global $mozComponent; + $mozComponent->go_forward(); + } + + function back() + { + global $mozComponent; + $mozComponent->go_back(); + } + +?> diff --git a/ext/sourceview/README b/ext/sourceview/README new file mode 100644 index 0000000..fc08dd2 --- /dev/null +++ b/ext/sourceview/README @@ -0,0 +1,11 @@ +LICENSE: GPL +AUTHORS: Gustavo Giráldez <[email protected]> and others +URL: ftp://ftp.gnome.org/pub/GNOME/sources/gtksourceview + +GtkSourceView is a text editing widget that extends the standard Gtk2.x text +widget. It has features syntax highlighting for a number of languages in +addition to those found in many standard source editors. Check the demos/ +directory for sample script(s). + +You must add the --enable-sourceview switch to your ./configure statement when +you build PHP-GTK 2 in order to enable the extension.