summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2001-07-23 21:31:36 +0000
committerDaouda Lo <daouda@mandriva.com>2001-07-23 21:31:36 +0000
commit190a4146db3bd386ca256f5e5804c827bbf5d507 (patch)
tree413e5ba15b627371dacc28a08cc4b793abbf9740
parent7b59bfeae49bb5b031912c1e0ee6e320f224adb6 (diff)
downloadcontrol-center-190a4146db3bd386ca256f5e5804c827bbf5d507.tar
control-center-190a4146db3bd386ca256f5e5804c827bbf5d507.tar.gz
control-center-190a4146db3bd386ca256f5e5804c827bbf5d507.tar.bz2
control-center-190a4146db3bd386ca256f5e5804c827bbf5d507.tar.xz
control-center-190a4146db3bd386ca256f5e5804c827bbf5d507.zip
first use of gecko mozilla engine -> the goal is to embbed some webmin modules
in mcc
-rwxr-xr-xgecko.pm70
1 files changed, 70 insertions, 0 deletions
diff --git a/gecko.pm b/gecko.pm
new file mode 100755
index 00000000..9a31756d
--- /dev/null
+++ b/gecko.pm
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+
+# TITLE: Mozilla embedding
+# REQUIRES: Gtk Mozilla
+use POSIX qw(getenv);
+use Gtk::MozEmbed;
+use Locale::GetText;
+use lib qw(/usr/lib/libDrakX);
+use interactive;
+use standalone;
+use common qw(:common :file :functional :system);
+
+# unless you use a threaded perl, you need to run this app with:
+# LD_PRELOAD=libpthread-0.9.so or something like that to make use of networking
+
+Gtk->set_locale;
+init Gtk;
+
+system("LD_PRELOAD=libpthread.so ; export LD_PRELOAD");
+
+$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
+#my $in = vnew interactive('su');
+my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
+$window->set_default_size(600, 400);
+$window->signal_connect('destroy', sub {Gtk->main_quit});
+
+my $box1= new Gtk::VBox($false,0);
+
+my $event_box = new Gtk::EventBox();
+$box1->add($event_box);
+$event_box->show();
+
+my $embed_moz= new Gtk::MozEmbed;
+#$embed_moz->load_url(shift || "https://www.mandrake.com");
+$embed_moz->render_data("hello world","/","text/html");
+$embed_moz->open_stream("/","text/html");
+$embed_moz->append_data("</html>\n</body>\nhello world\n</body>\n</html>\n");
+$embed_moz->close_stream();
+$event_box->add($embed_moz);
+$embed_moz->show();
+
+my $separator= new Gtk::HSeparator();
+$box1->pack_start($separator,$false,$false,0);
+$separator->show();
+
+my $box2=new Gtk::HBox($false,0);
+$box1->pack_start($box2,$false,$false,0);
+$box2->show();
+
+my $button_next= new Gtk::Button("Next");
+$box2->pack_end($button_next,$false,$false,0);
+$button_next->show();
+
+my $button_prev= new Gtk::Button("Previous");
+$box2->pack_end($button_prev,$false,$false,0);
+$button_prev->show();
+
+my $button_skipwiz= new Gtk::Button("Skip Wizard");
+$button_skipwiz->signal_connect ( clicked => sub { Gtk->main_quit();});
+$box2->pack_start($button_skipwiz,$false,$false,0);
+$button_skipwiz->show();
+
+
+$window->add($box1);
+
+$box1->show;
+$window->show;
+
+main Gtk;
+exit (0);