blob: e7fa4b56f053cbdf3a8fbf1307fb3e7f6c1669d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<?php
class php_logo extends php_element {
function __construct($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;
}
}
?>
|