Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 11c5630b2c8f00f64861e0dac51a202a > files > 73

php-gtk2-2.0.1-12mdv2010.0.i586.rpm

<?php
/**
*   Small event generator to do automated unit tests with PHP-Gtk2
*   Supports different drivers.
*
*   A generator has the following methods:
*   - sendKey($key)
*   - sendKeyPress($key)
*   - sendKeyRelease($key)
*   where $key is a string/char what key to send.
*   For example, " " would send a space, "a" a lowercase a
*   "ctrl" a left control and so on.
*
*   @author Christian Weiske <cweiske@php.net>
*/
class EventGenerator
{
    function createGenerator($type = null)
    {
        if ($type == null) {
            $type = EventGenerator::getDefaultGenerator();
        }
        $class = 'EventGenerator_' . $type;
        include_once($class . '.php');
        if (!class_exists($class)) {
            die('Couldn\'t load class "' . $class . '"' . "\r\n");
        }
        return new $class();
    }//function createGenerator($type = 'xte')



    function getDefaultGenerator()
    {
        if (file_exists('EventGenerator.config.php')) {
            include_once('EventGenerator.config.php');
        }
        if (defined('EVENT_GENERATOR')) {
            return EVENT_GENERATOR;
        }
        //no static class properties in php4
        return 'xte';
    }//function getDefaultGenerator()
}//class EventGenerator

?>