diff options
Diffstat (limited to 'scripts/ext_skel_ng/php_logo.php')
| -rw-r--r-- | scripts/ext_skel_ng/php_logo.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/scripts/ext_skel_ng/php_logo.php b/scripts/ext_skel_ng/php_logo.php new file mode 100644 index 0000000000..5d2adf6fad --- /dev/null +++ b/scripts/ext_skel_ng/php_logo.php @@ -0,0 +1,51 @@ +<?php + + class php_logo extends php_element { + function php_logo($name, $attr) { + $this->name = $name; + $this->attr = $attr; + $this->id = '"'.strtoupper($name).'_LOGO_ID"'; + + $this->data = file_get_contents($attr['src']); + $this->size = strlen($this->data); + + $this->mime_type = "image/gif"; + } + + function docbook_xml($base) { + return ""; + } + + function minit_code() { + return " php_register_info_logo({$this->id}, \"{$this->mime_type}\", {$this->name}_logo, {$this->size});\n"; + } + + function c_code() { + return " +static unsigned char {$this->name}_logo[] = { +#include \"{$this->name}_logo.h\" +}; +"; + } + + function h_code() { + $len = strlen($this->data); + $code = " "; + $i=0; + for($n = 0; $n < $len; $n++) { + $code .= sprintf(" %3d",ord($this->data[$n])); + if($n == $len - 1) break; + $code .= ","; + if(++$i==8) { + $code .= "\n "; + $i=0; + } + } + + $code .= "\n"; + + return $code; + } + } + +?>
\ No newline at end of file |
