cvs: pear /PEAR_Frontend_Gtk Gtk.php package.xml /PEAR_Frontend_Gtk/Gtk Documentation.php Info.php WidgetHTML.php installer.glade

From: Date: Thu, 13 Jun 2002 09:37:02 +0000
Subject: cvs: pear /PEAR_Frontend_Gtk Gtk.php package.xml /PEAR_Frontend_Gtk/Gtk Documentation.php Info.php WidgetHTML.php installer.glade
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4594@lists.php.net to get a copy of this message
alan_k Thu Jun 13 05:37:02 2002 EDT Added files: /pear/PEAR_Frontend_Gtk/Gtk Documentation.php Modified files: /pear/PEAR_Frontend_Gtk Gtk.php package.xml /pear/PEAR_Frontend_Gtk/Gtk Info.php WidgetHTML.php installer.glade Log: Documentation Browser added - primed for testing

Index: pear/PEAR_Frontend_Gtk/Gtk.php diff -u pear/PEAR_Frontend_Gtk/Gtk.php:1.14 pear/PEAR_Frontend_Gtk/Gtk.php:1.15 --- pear/PEAR_Frontend_Gtk/Gtk.php:1.14 Thu Jun 13 02:57:12 2002 +++ pear/PEAR_Frontend_Gtk/Gtk.php Thu Jun 13 05:37:02 2002 @@ -16,7 +16,7 @@ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ - $Id: Gtk.php,v 1.14 2002/06/13 06:57:12 alan_k Exp $ + $Id: Gtk.php,v 1.15 2002/06/13 09:37:02 alan_k Exp $ */ require_once "PEAR.php"; @@ -26,6 +26,7 @@ require_once "PEAR/Frontend/Gtk/Config.php"; require_once "PEAR/Frontend/Gtk/DirSelect.php"; require_once "PEAR/Frontend/Gtk/Info.php"; +require_once "PEAR/Frontend/Gtk/Documentation.php"; /** * Core Gtk Frontend Class @@ -86,6 +87,7 @@ $this->_config = &new PEAR_Frontend_Gtk_Config($this); $this->_dirselect = &new PEAR_Frontend_Gtk_DirSelect($this); $this->_info = &new PEAR_Frontend_Gtk_Info($this); + $this->_documentation= &new PEAR_Frontend_Gtk_Documentation($this); $this->_loadGlade(); $this->_initInterface(); } @@ -112,7 +114,7 @@ preg_match_all('/\<name\>([^\<]+)\<\/name\>/',$data,$items); foreach ($items[1] as $widgetname) { $args = array(); - if (preg_match('/^(_install|_packages|_summary|_config|_dirselect|_info)_(.*)$/',$widgetname,$args)) { + if (preg_match('/^(_install|_packages|_summary|_config|_dirselect|_info|_documentation)_(.*)$/',$widgetname,$args)) { $obj = $args[1]; $varname= $args[2]; //echo "ASSIGN $obj $varname to $widgetname\n"; @@ -127,7 +129,7 @@ //print_r($items[1]); foreach ($items[1] as $handler) { $args = array(); - if (preg_match('/^(_install|_packages|_summary|_config|_dirselect|_info)_(.*)$/',$handler,$args)) { + if (preg_match('/^(_install|_packages|_summary|_config|_dirselect|_info|_documentation)_(.*)$/',$handler,$args)) { $obj = $args[1]; $method= $args[2]; //echo "CONNECT $obj $method to $handler\n"; @@ -233,7 +235,7 @@ $this->_packages->loadPackageList(); $this->_setStyle('black_bg1','#FFFFFF','#000000',FALSE); - $this->_setStyle('black_bg2','#FFFFFF','#000000',TRUE); + $this->_setStyle('black_bg2','#FFFFFF','#000000',FALSE); $this->_setStyle('black_bg3','#FFFFFF','#000000',FALSE); $this->_setStyle('black_bg4','#FFFFFF','#000000',TRUE); @@ -305,6 +307,24 @@ $this->_widget_config_logo->put($config_logo,0,0); $config_logo->show(); + + + /* documentation loading */ + $this->_setStyle('documentation_logo','#000000','#339900',TRUE); + $this->_setStyle('documentation_logo_text','#FFFFFF','#339900'); + $this->_setFont('documentation_logo_text','-*-helvetica-bold-r-normal-*-*-100-*-*-p-*-iso8859-1'); + $documentation_logo = &new GtkPixmap( + $this->_pixmaps['pear.xpm'][0], + $this->_pixmaps['pear.xpm'][1]); + + $this->_widget_documentation_logo->put($documentation_logo,0,0); + $documentation_logo->show(); + $this->_documentation->init(); + $this->_setStyle('documentation_view_label' ,'#FFFFFF','#000000',TRUE); + $this->_setFont('documentation_view_label','-*-helvetica-bold-r-normal-*-*-80-*-*-p-*-iso8859-1'); + $this->_setStyle('documentation_package_label' ,'#FFFFFF','#000000',TRUE); + $this->_setFont('documentation_package_label','-*-helvetica-bold-r-normal-*-*-80-*-*-p-*-iso8859-1'); + } /** @@ -489,7 +509,7 @@ } } - function log($msg,$command) { + function log($msg,$command='') { return $this->_info->show("LOG: $msg: $command"); } Index: pear/PEAR_Frontend_Gtk/package.xml diff -u pear/PEAR_Frontend_Gtk/package.xml:1.3 pear/PEAR_Frontend_Gtk/package.xml:1.4 --- pear/PEAR_Frontend_Gtk/package.xml:1.3 Fri May 31 18:27:15 2002 +++ pear/PEAR_Frontend_Gtk/package.xml Thu Jun 13 05:37:02 2002 @@ -22,17 +22,24 @@ </maintainers> <release> <version>0.1</version> - <date>2002-05-27</date> + <date>2002-06-13</date> <notes>Snapshot - dont expect it to work</notes> <state>snapshot</state> <filelist> <dir name="/" baseinstalldir="PEAR/Frontend"> <file role="php">Gtk.php</file> <dir name="Gtk"> - <file role="php">Packages.php</file> - <file role="php">Summary.php</file> - <file role="php">Install.php</file> - <file role="php">installer.glade</file> + <file role="php">Config.php</file> + <file role="php">DirSelect.php</file> + <file role="php">Documentation.php</file> + <file role="php">Info.php</file> + <file role="php">Install.php</file> + <file role="php">PackageData.php</file> + <file role="php">Packages.php</file> + <file role="php">Summary.php</file> + <file role="php">WidgetHTML.php</file> + <file role="php">installer.glade</file> + <dir name="xpm"> <file role="php">black_close_icon.xpm</file> <file role="php">check_no.xpm</file> @@ -45,7 +52,9 @@ <file role="php">nav_documentation.xpm</file> <file role="php">nav_installer.xpm</file> <file role="php">package.xpm</file> - <file role="php">pear.xpm</file> + <file role="php">pear.xpm</file> + <file role="php">stock_delete-16.xpm</file> + <file role="php">stock_delete-outline-16.xpm</file> </dir> </dir> </dir> @@ -54,9 +63,9 @@ <changelog> <release> <version>0.1</version> - <date>2002-05-27</date> + <date>2002-06-13</date> <notes>Snapshot - dont expect it to work</notes> - <state>experimental</state> + <state>snapshot</state> </release> </changelog> </package> Index: pear/PEAR_Frontend_Gtk/Gtk/Info.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Info.php:1.1 pear/PEAR_Frontend_Gtk/Gtk/Info.php:1.2 --- pear/PEAR_Frontend_Gtk/Gtk/Info.php:1.1 Mon Jun 3 06:10:45 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Info.php Thu Jun 13 05:37:02 2002 @@ -16,11 +16,11 @@ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ - $Id: Info.php,v 1.1 2002/06/03 10:10:45 alan_k Exp $ + $Id: Info.php,v 1.2 2002/06/13 09:37:02 alan_k Exp $ */ /** - * Gtk Frontend -Directory Selection + * Gtk Frontend - Pop up messages at present * * @author Alan Knowles <alan@akbkhome.com> */ Index: pear/PEAR_Frontend_Gtk/Gtk/WidgetHTML.php diff -u pear/PEAR_Frontend_Gtk/Gtk/WidgetHTML.php:1.17 pear/PEAR_Frontend_Gtk/Gtk/WidgetHTML.php:1.18 --- pear/PEAR_Frontend_Gtk/Gtk/WidgetHTML.php:1.17 Wed Jun 12 22:10:04 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/WidgetHTML.php Thu Jun 13 05:37:02 2002 @@ -17,7 +17,7 @@ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ - $Id: WidgetHTML.php,v 1.17 2002/06/13 02:10:04 alan_k Exp $ + $Id: WidgetHTML.php,v 1.18 2002/06/13 09:37:02 alan_k Exp $ */ /** @@ -80,21 +80,26 @@ class PEAR_Frontend_Gtk_WidgetHTML { - + var $widget; // what you add to your interface (as it's too complex to extend Scrolled window) var $_pixmap_area_x =1024; var $_pixmap_area_y = 5000; var $_source; // raw HTML var $_URL; // the URL function loadURL($URL) { // load a file into source - for testing only - echo "OPENING URL $URL\n"; + //echo "OPENING URL $URL\n"; $this->_URL = trim($URL); $this->_URLparse = parse_url(trim($URL)); - $this->_source = str_replace("\r", " ",implode('',file(trim($URL)))); + $this->_source = @str_replace("\r", " ",implode('',file(trim($URL)))); + if ($this->_source) return TRUE; //$fh = fopen('/tmp/test','w'); fwrite($fh,$this->_source ); fclose($fh); } + function loadTEXT($text) { + $this->_source = $text; + } + var $_tokens = array(); // HTML Tokens id => array($tag,$attribute_string) | $string function tokenize() { // tokenize the HTML into $this->tokens - echo "TOKENIZING\n"; + //echo "TOKENIZING\n"; $tok = strtok($this->_source,'<'); $a[0] = $tok; while( $tok !== FALSE ) { @@ -162,6 +167,9 @@ var $_Building=FALSE; function build() { // read the tokens and build the line/table arrays - then display if($this->Building) return; + if(!$this->Realized) return; + if (!$this->_tokens) return; + $this->_Building=TRUE; $this->Start = FALSE; // reset all major variables; @@ -470,6 +478,7 @@ break; case 'LI': case 'DT': + case 'DD': $this->$method($item[0],$pos,@$item[1]); if ($method == 'push') $this->linebr($this->_tokens[$pos][0],$pos); @@ -1112,18 +1121,18 @@ function Interface() { // Create the Drawing Area - $this->scrolledwindow = &new GtkScrolledWindow(); - $hadj = $this->scrolledwindow->get_hadjustment(); - $vadj = $this->scrolledwindow->get_vadjustment(); + $this->widget = &new GtkScrolledWindow(); + $hadj = $this->widget->get_hadjustment(); + $vadj = $this->widget->get_vadjustment(); $hadj->connect('value-changed', array(&$this,'_LayoutScrolled')); $vadj->connect('value-changed', array(&$this,'_LayoutScrolled')); $this->layout = &new GtkLayout($hadj,$vadj); $this->layout->set_size($this->_area_x,$this->_area_y); $this->layout->show(); - $this->scrolledwindow->show(); - $this->scrolledwindow->set_policy(GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); - $this->scrolledwindow->add($this->layout); + $this->widget->show(); + $this->widget->set_policy(GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); + $this->widget->add($this->layout); //$this->scrolledwindow->add_events( GDK_EXPOSURE_MASK ); @@ -1159,8 +1168,7 @@ // $this->layout->add_events( GDK_KEY_PRESS_MASK ); $this->drawing_area->set_flags( GTK_CAN_FOCUS); - - + //$this->drawing_area->connect("key_press_event", array(&$this,"_DrawingAreaCallbackKeyPress")); //$this->drawing_area->connect("button_release_event", array(&$this,"_DrawingAreaCallbackBtnPress")); @@ -1177,7 +1185,7 @@ function _LayoutScrolled() { // windows bug fixmo //echo "SCROLL"; $this->layout->queue_draw(); - $vadj= $this->scrolledwindow->get_vadjustment(); + $vadj= $this->widget->get_vadjustment(); if (@!$this->drawing_area) return; if ($this->_LayoutRefesh==time()) return; $this->_LayoutRefesh=time(); @@ -1186,14 +1194,14 @@ } - + var $Realized = FALSE; var $pixmap; // the pixmap that everything gets drawn on function _DrawingAreaCallbackConfigure($widget, $event) { // the callback to create the pixmap & start building if (@$this->pixmap) return true; + $this->Realized = TRUE; - - $this->Start = FALSE; + $this->build(); $this->_setCursor(GDK_ARROW); @@ -1710,7 +1718,7 @@ } - +/* dl('php_gtk.dll'); error_reporting(E_ALL); @@ -1746,11 +1754,7 @@ gtk::main(); -?> - - -/* -------------------- end scribble code ---------------------- */ - +*/ Index: pear/PEAR_Frontend_Gtk/Gtk/installer.glade diff -u pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.9 pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.10 --- pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.9 Thu Jun 13 02:57:13 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/installer.glade Thu Jun 13 05:37:02 2002 @@ -392,6 +392,11 @@ <name>documentation_button</name> <width>150</width> <height>90</height> + <signal> + <name>clicked</name> + <handler>_documentation_show</handler> + <last_modification_time>Thu, 13 Jun 2002 07:56:10 GMT</last_modification_time> + </signal> <label>Documentation</label> <relief>GTK_RELIEF_NONE</relief> <child> @@ -1438,6 +1443,250 @@ <child_name>Notebook:tab</child_name> <name>label40</name> <label>Config</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + + <widget> + <class>GtkVBox</class> + <name>vbox20</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + + <widget> + <class>GtkVBox</class> + <name>vbox21</name> + <height>47</height> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow17</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_NEVER</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLayout</class> + <name>documentation_logo</name> + <area_width>400</area_width> + <area_height>400</area_height> + <hstep>10</hstep> + <vstep>10</vstep> + + <widget> + <class>GtkHBox</class> + <name>hbox15</name> + <x>136</x> + <y>8</y> + <width>570</width> + <height>27</height> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + + <widget> + <class>GtkLabel</class> + <name>documentation_logo_text</name> + <label>Documentation</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + </widget> + </widget> + </widget> + </widget> + + <widget> + <class>GtkNotebook</class> + <name>black_bg2</name> + <show_tabs>False</show_tabs> + <show_border>True</show_border> + <tab_pos>GTK_POS_TOP</tab_pos> + <scrollable>False</scrollable> + <tab_hborder>0</tab_hborder> + <tab_vborder>0</tab_vborder> + <popup_enable>False</popup_enable> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkHBox</class> + <name>hbox16</name> + <border_width>2</border_width> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + + <widget> + <class>GtkLabel</class> + <name>documentation_package_label</name> + <height>18</height> + <label>Package:</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>2.23517e-08</xalign> + <yalign>0.5</yalign> + <xpad>7</xpad> + <ypad>0</ypad> + <child> + <padding>3</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>_documentation_package_combo</name> + <width>60</width> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items></items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>_documentation_package_comboentry</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>Authenentication/sssss</text> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>documentation_view_label</name> + <height>18</height> + <label>View:</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>2.23517e-08</xalign> + <yalign>0.5</yalign> + <xpad>7</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkCombo</class> + <name>_documentation_view_combo</name> + <width>60</width> + <value_in_list>False</value_in_list> + <ok_if_empty>True</ok_if_empty> + <case_sensitive>False</case_sensitive> + <use_arrows>True</use_arrows> + <use_arrows_always>False</use_arrows_always> + <items>--Text Documentation-- +Auth_Simple +asdfasdfasdfasdfasdfasdf +'asdfasdfasdfasdfas +dfa +sdfa +sdf +asd +fa +sdf +</items> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkEntry</class> + <child_name>GtkCombo:entry</child_name> + <name>_documentation_view_comboentry</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text>Manual</text> + </widget> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label87</name> + <label>label77</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + + <widget> + <class>GtkVBox</class> + <name>_documentation_holder</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>Placeholder</class> + </widget> + </widget> + + <widget> + <class>Placeholder</class> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>Notebook:tab</child_name> + <name>label81</name> + <label>Help</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> Index: pear/PEAR_Frontend_Gtk/Gtk/Documentation.php +++ pear/PEAR_Frontend_Gtk/Gtk/Documentation.php <? /* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2002 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ $Id: Documentation.php,v 1.1 2002/06/13 09:37:02 alan_k Exp $ */ /** * Gtk Frontend Documentation -This class deals with the browsing and downloading? the documentation. * * #TODO : .. * * @author Alan Knowles <alan@akbkhome.com> */ require_once "PEAR/Frontend/Gtk/WidgetHTML.php"; class PEAR_Frontend_Gtk_Documentation { /** * The Main User interface object * @var object PEAR_Frontend_Gtk */ var $ui; // main interface /* * Gtk Installer Constructor * * #TODO: most of this can be moved to the glade file!? * @param object PEAR_Frontend_Gtk */ function PEAR_Frontend_Gtk_Documentation(&$ui) { $this->ui = &$ui; } /** * The HTML Browser component * @var object PEAR_Frontend_Gtk_WidgetHTML */ var $_html; /** * The Vbox holder for browser * @var object GtkVbox */ var $holder; function init() { $this->_html = &new PEAR_Frontend_Gtk_WidgetHTML; $this->_html->Interface(); $this->holder->add($this->_html->widget); $this->_loadPackages(); } /** * The List of packages on the documentaiton page * @var object GtkCombo */ var $package_combo; /** * The Currently Selected package (Text) to look at * @var object GtkCombo */ var $package_comboentry; function _loadPackages() { $packages = array_keys($this->ui->_packages->packages); $this->package_combo->set_popdown_strings($packages); $list = $this->package_combo->list; $list->connect_after('button-release-event',array(&$this,'_PackageSelected')); } /** * The Currently Selected package to look at * @var string */ var $_selectedPackage = ""; function _PackageSelected() { $new = $this->package_comboentry->get_text(); if ($new == $this->_selectedPackage) return; $this->_selectedPackage=$new; $this->_loadViews(); $category = str_replace(' ','_',strtolower($this->ui->_packages->packages[$new]->category)); $new = strtolower($new); $newurl = "http://pear.php.net/manual/en/html/packages.{$category}.{$new}.html"; if ($this->showURL($newurl)) return; $parts = explode('_', $new); $newurl = "http://pear.php.net/manual/en/html/packages.{$parts[0]}.{$new}.html"; if ($this->showURL($newurl)) return; $newurl = "http://pear.php.net/manual/en/html/core.{$new}.html"; if ($this->showURL($newurl)) return; $newurl = "http://pear.php.net/manual/en/html/class.{$new}.html"; if ($this->showURL($newurl)) return; $this->_html->loadTEXT("<BODY><H1>Sorry</H1>{$newurl} was not found</BODY>"); $this->_html->tokenize(); $this->_html->build(); } function show() { $this->ui->_widget_pages->set_page(3); return $this->showURL('http://pear.php.net/manual/en/html/index.html'); } function showURL($URL) { if (!$this->_html->loadURL($URL)) return; $this->_html->tokenize(); $this->_html->build(); return TRUE; } function _loadViews() { $views = array('PEAR Manual'); $this->view_combo->set_popdown_strings($views); } } ?>
« previous php.pear.cvs (#4594) next »